xunge/DecIR huggingface dataset:
unsigned symhash(char *sym) {
  unsigned int hash = 0;
  unsigned c;
  while (c = *sym++)
    hash = hash * 9 ^ c;
  return hash;
}


x86 assembly (clang, -O0):
<symhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     113c <symhash+0x3c>
imul   $0x9,-0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <symhash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <symhash+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,8),%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <symhash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @symhash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = load i32, i32* %3
%13 = mul i32 %12, 9
%14 = load i32, i32* %4
%15 = xor i32 %13, %14
store i32 %15, i32* %3
br label %5
16: ; preds = %5
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @symhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 9
%11 = xor i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
unsigned int __dos_assemble_4le(const unsigned char *p) {
  return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
}


x86 assembly (clang, -O0):
<__dos_assemble_4le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dos_assemble_4le>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @__dos_assemble_4le(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @__dos_assemble_4le(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fail(char *msg) {
  fprintf(stderr, "Error: %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
define void @fail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int __infer_nondet_int();
int isdigit(int x) { return __infer_nondet_int(); }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
xor    %eax,%eax
jmp    1030 <__infer_nondet_int@plt>

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned int);
void mov_reg64_preg64pimm8(int reg1, int reg2, unsigned int imm8) {
  put8(0x48);
  put8(0x8B);
  put8(0x40 | (reg1 << 3) | reg2);
  put8(imm8);
}


x86 assembly (clang, -O0):
<mov_reg64_preg64pimm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x8b,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x40,%edi
or     -0x8(%rbp),%edi
call   1030 <put8@plt>
mov    -0xc(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_reg64_preg64pimm8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0x8b,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0x40,%ebx
mov    %ebx,%edi
call   1030 <put8@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @mov_reg64_preg64pimm8(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @put8(i32 72)
%8 = call i32 @put8(i32 139)
%9 = load i32, i32* %4
%10 = shl i32 %9, 3
%11 = or i32 64, %10
%12 = load i32, i32* %5
%13 = or i32 %11, %12
%14 = call i32 @put8(i32 %13)
%15 = load i32, i32* %6
%16 = call i32 @put8(i32 %15)
ret void
}

LLVM IR (-O2):
define void @mov_reg64_preg64pimm8(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @put8(i32 72)
%5 = tail call i32 @put8(i32 139)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 64
%9 = tail call i32 @put8(i32 %8)
%10 = tail call i32 @put8(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ _wymum(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
uint64_t wy2u0k(uint64_t r, uint64_t k) {
  _wymum(&r, &k);
  return k;
}


x86 assembly (clang, -O0):
<wy2u0k>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <_wymum@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wy2u0k>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <_wymum@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @wy2u0k(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_wymum(i32* %3, i32* %4)
%6 = load i32, i32* %4
ret i32 %6
}

LLVM IR (-O2):
define i32 @wy2u0k(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_wymum(i32* %3, i32* %4)
%6 = load i32, i32* %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void generic_end(void) { endwin(); }


x86 assembly (clang, -O0):
<generic_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_end>:
xor    %eax,%eax
jmp    1030 <endwin@plt>

LLVM IR (-O0):
define void @generic_end() {
%1 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @generic_end() {
%1 = tail call i32 (...) @endwin()
ret void
}
nested(a, b) {
  if ((a < 4 && b == 'r') || (a == 1 && (b == 'h' || b == 'i')) ||
      (a == 2 && (b == 'o' || b == 'y')))
    a = b;
}


x86 assembly (clang, -O0):
<nested>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x4,-0x8(%rbp)
jge    111e <nested+0x1e>
cmpl   $0x72,-0xc(%rbp)
je     115a <nested+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    113c <nested+0x3c>
cmpl   $0x68,-0xc(%rbp)
je     115a <nested+0x5a>
cmpl   $0x69,-0xc(%rbp)
je     115a <nested+0x5a>
cmpl   $0x2,-0x8(%rbp)
jne    1160 <nested+0x60>
cmpl   $0x6f,-0xc(%rbp)
je     115a <nested+0x5a>
cmpl   $0x79,-0xc(%rbp)
jne    1160 <nested+0x60>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nested>:
ret

LLVM IR (-O0):
define i32 @nested(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 114
br i1 %10, label %29, label %11
11: ; preds = %8, %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 104
br i1 %16, label %29, label %17
17: ; preds = %14
%18 = load i32, i32* %5
%19 = icmp eq i32 %18, 105
br i1 %19, label %29, label %20
20: ; preds = %17, %11
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 2
br i1 %22, label %23, label %31
23: ; preds = %20
%24 = load i32, i32* %5
%25 = icmp eq i32 %24, 111
br i1 %25, label %29, label %26
26: ; preds = %23
%27 = load i32, i32* %5
%28 = icmp eq i32 %27, 121
br i1 %28, label %29, label %31
29: ; preds = %26, %23, %17, %14, %8
%30 = load i32, i32* %5
store i32 %30, i32* %4
br label %31
31: ; preds = %29, %26, %20
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @nested(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int IPC_CREAT;
int msgget(int, int);
int /*<<< orphan*/ perror(char *);
int main() {
  int msgid;
  msgid = msgget(0xABC, 0666 | IPC_CREAT);
  if (msgid == -1) {
    perror("Couldn't create msg queue:");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
or     $0x1b6,%esi
mov    $0xabc,%edi
call   1030 <msgget@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1161 <main+0x41>
lea    0xea4(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    $0x1b6,%esi
or     (%rax),%esi
mov    $0xabc,%edi
call   1030 <msgget@plt>
cmp    $0xffffffff,%eax
je     1142 <main+0x22>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
jmp    113e <main+0x1e>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
@.str = [27 x i8] c"Couldn't create msg queue:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @IPC_CREAT
%4 = or i32 438, %3
%5 = call i32 @msgget(i32 2748, i32 %4)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
@.str = [27 x i8] c"Couldn't create msg queue:\00"
define i32 @main() {
%1 = load i32, i32* @IPC_CREAT
%2 = or i32 %1, 438
%3 = tail call i32 @msgget(i32 2748, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 0
}
void cs5535_disable_internal_uart(void) {}


x86 assembly (clang, -O0):
<cs5535_disable_internal_uart>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs5535_disable_internal_uart>:
ret

LLVM IR (-O0):
define void @cs5535_disable_internal_uart() {
ret void
}

LLVM IR (-O2):
define void @cs5535_disable_internal_uart() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ glutPostRedisplay();
void key(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(1);
  default:
    glutPostRedisplay();
    return;
  }
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    114e <key+0x2e>
jmp    1144 <key+0x24>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    $0x0,%al
call   1030 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
cmp    $0x1b,%dil
je     112d <key+0xd>
xor    %eax,%eax
jmp    1030 <glutPostRedisplay@plt>
push   %rax
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %3
%12 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %3
%8 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t b6b_hash_init(void) { return 0; }


x86 assembly (clang, -O0):
<b6b_hash_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b6b_hash_init>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @b6b_hash_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @b6b_hash_init() {
ret i32 0
}
void modif_front_ext2modif_front_unit() {}


x86 assembly (clang, -O0):
<modif_front_ext2modif_front_unit>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modif_front_ext2modif_front_unit>:
ret

LLVM IR (-O0):
define void @modif_front_ext2modif_front_unit() {
ret void
}

LLVM IR (-O2):
define void @modif_front_ext2modif_front_unit() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ set_log_file(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
FILE *log_init() {
  FILE *f;
  f = fopen("/tmp/server.log", "w");
  if (f == NULL) {
    fprintf(stderr, "server: cannot open log");
    exit(-1);
  }
  set_log_file(f);
  return f;
}


x86 assembly (clang, -O0):
<log_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1189 <log_init+0x49>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rdi
call   1040 <set_log_file@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_init>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1169 <log_init+0x29>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <set_log_file@plt>
mov    %rbx,%rax
pop    %rbx
ret
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"/tmp/server.log\00"
@.str.1 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.2 = [24 x i8] c"server: cannot open log\00"
define i32* @log_init() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %0
%10 = load i32*, i32** %1
%11 = call i32 @set_log_file(i32* %10)
%12 = load i32*, i32** %1
ret i32* %12
}

LLVM IR (-O2):
@.str = [16 x i8] c"/tmp/server.log\00"
@.str.1 = [2 x i8] c"w\00"
@stderr = global i32 0
@.str.2 = [24 x i8] c"server: cannot open log\00"
define i32* @log_init() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %0
%8 = tail call i32 @set_log_file(i32* %1)
ret i32* %1
}
unsigned int hasAmp(char *line) {
  unsigned int i = 0;
  while (line[i] != '\0') {
    if (line[i] == '&') {
      line[i] = ' ';
      return 1;
    }
    ++i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<hasAmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115c <hasAmp+0x5c>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x26,%eax
jne    114e <hasAmp+0x4e>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movb   $0x20,(%rax,%rcx,1)
movl   $0x1,-0x4(%rbp)
jmp    1163 <hasAmp+0x63>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <hasAmp+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasAmp>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
movzbl (%rdi,%rcx,1),%edx
test   %dl,%dl
je     1124 <hasAmp+0x24>
cmp    $0x26,%dl
je     1127 <hasAmp+0x27>
add    $0x1,%eax
jmp    1110 <hasAmp+0x10>
xor    %eax,%eax
ret
movb   $0x20,(%rdi,%rcx,1)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @hasAmp(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %26, %1
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %29
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 38
br i1 %20, label %21, label %26
21: ; preds = %13
%22 = load i8*, i8** %3
%23 = load i32, i32* %4
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 32, i8* %25
store i32 1, i32* %2
br label %30
26: ; preds = %13
%27 = load i32, i32* %4
%28 = add i32 %27, 1
store i32 %28, i32* %4
br label %5
29: ; preds = %5
store i32 0, i32* %2
br label %30
30: ; preds = %29, %21
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @hasAmp(i8* nocapture %0) {
br label %2
2: ; preds = %10, %1
%3 = phi i32 [ 0, %1 ], [ %11, %10 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %10 [
i8 0, label %12
i8 38, label %7
]
7: ; preds = %2
%8 = zext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 32, i8* %9
br label %12
10: ; preds = %2
%11 = add i32 %3, 1
br label %2
12: ; preds = %2, %7
%13 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
struct tm *get_current_time(void) {
  time_t rawtime;
  struct tm *current_time;
  time(&rawtime);
  current_time = localtime(&rawtime);
  return current_time;
}


x86 assembly (clang, -O0):
<get_current_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_time>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @get_current_time() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
ret %struct.tm* %5
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @get_current_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
ret %struct.tm* %4
}
/* Type definitions */
struct utmpx {
  int dummy;
};
struct utmp {
  int dummy;
};

/* Variables and functions */
scalar_t__ __getutline(struct utmp const *);
struct utmpx *__getutxline(const struct utmpx *line) {
  return (struct utmpx *)__getutline((const struct utmp *)line);
}


x86 assembly (clang, -O0):
<__getutxline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__getutline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getutxline>:
jmp    1030 <__getutline@plt>

LLVM IR (-O0):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define %struct.utmpx* @__getutxline(%struct.utmpx* %0) {
%2 = alloca %struct.utmpx*
store %struct.utmpx* %0, %struct.utmpx** %2
%3 = load %struct.utmpx*, %struct.utmpx** %2
%4 = bitcast %struct.utmpx* %3 to %struct.utmp*
%5 = call i64 @__getutline(%struct.utmp* %4)
%6 = inttoptr i64 %5 to %struct.utmpx*
ret %struct.utmpx* %6
}

LLVM IR (-O2):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define %struct.utmpx* @__getutxline(%struct.utmpx* %0) {
%2 = bitcast %struct.utmpx* %0 to %struct.utmp*
%3 = tail call i64 @__getutline(%struct.utmp* %2)
%4 = inttoptr i64 %3 to %struct.utmpx*
ret %struct.utmpx* %4
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void test_fmt(char *fmt, int val) {
  fputs(fmt, stdout);
  putc(':', stdout);
  printf(fmt, val);
  putc('\n', stdout);
}


x86 assembly (clang, -O0):
<test_fmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    $0x3a,%edi
call   1050 <putc@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <printf@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1050 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fmt>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ea0(%rip),%r14
mov    (%r14),%esi
call   1040 <fputs@plt>
mov    (%r14),%esi
mov    $0x3a,%edi
call   1050 <putc@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    (%r14),%esi
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @test_fmt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @stdout
%7 = call i32 @fputs(i8* %5, i32 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @putc(i8 signext 58, i32 %8)
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* %10, i32 %11)
%13 = load i32, i32* @stdout
%14 = call i32 @putc(i8 signext 10, i32 %13)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @test_fmt(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* %0, i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @putc(i8 signext 58, i32 %5)
%7 = tail call i32 @printf(i8* %0, i32 %1)
%8 = load i32, i32* @stdout
%9 = tail call i32 @putc(i8 signext 10, i32 %8)
ret void
}
void usleep_range(unsigned long min, unsigned long max) {}


x86 assembly (clang, -O0):
<usleep_range>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep_range>:
ret

LLVM IR (-O0):
define void @usleep_range(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @usleep_range(i64 %0, i64 %1) {
ret void
}
unsigned long PWMGenPeriodGet(unsigned long ulBase, unsigned long ulGen) {
  ;
  ;
  ulGen = ((ulBase) + (ulGen));
  if ((*((volatile unsigned long *)(ulGen + 0x00000000))) & 0x00000002) {
    return ((*((volatile unsigned long *)(ulGen + 0x00000010))) * 2);
  } else {
    return ((*((volatile unsigned long *)(ulGen + 0x00000010))) + 1);
  }
}


x86 assembly (clang, -O0):
<PWMGenPeriodGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
je     1142 <PWMGenPeriodGet+0x42>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
shl    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <PWMGenPeriodGet+0x52>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenPeriodGet>:
mov    (%rsi,%rdi,1),%rcx
mov    0x10(%rsi,%rdi,1),%rax
lea    (%rax,%rax,1),%rdx
add    $0x1,%rax
test   $0x2,%rcx
cmovne %rdx,%rax
ret

LLVM IR (-O0):
define i64 @PWMGenPeriodGet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = add i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = add i64 %9, 0
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, 2
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %2
%16 = load i64, i64* %5
%17 = add i64 %16, 16
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
%20 = mul i64 %19, 2
store i64 %20, i64* %3
br label %27
21: ; preds = %2
%22 = load i64, i64* %5
%23 = add i64 %22, 16
%24 = inttoptr i64 %23 to i64*
%25 = load volatile i64, i64* %24
%26 = add i64 %25, 1
store i64 %26, i64* %3
br label %27
27: ; preds = %21, %15
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
define i64 @PWMGenPeriodGet(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, 2
%7 = icmp eq i64 %6, 0
%8 = add i64 %3, 16
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = shl i64 %10, 1
%12 = add i64 %10, 1
%13 = select i1 %7, i64 %12, i64 %11
ret i64 %13
}
/* Variables and functions */
int O_NONBLOCK;
int O_RDONLY;
int _sg_io_open(char *, char const *, int *, int);
int _sg_io_open_ro(char *err_msg, const char *disk_path, int *fd) {
  return _sg_io_open(err_msg, disk_path, fd, O_RDONLY | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<_sg_io_open_ro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2ea9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea8(%rip),%rax
or     (%rax),%ecx
call   1030 <_sg_io_open@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sg_io_open_ro>:
mov    0x2ec9(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
jmp    1030 <_sg_io_open@plt>

LLVM IR (-O0):
@O_RDONLY = global i32 0
@O_NONBLOCK = global i32 0
define i32 @_sg_io_open_ro(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32*, i32** %6
%10 = load i32, i32* @O_RDONLY
%11 = load i32, i32* @O_NONBLOCK
%12 = or i32 %10, %11
%13 = call i32 @_sg_io_open(i8* %7, i8* %8, i32* %9, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@O_NONBLOCK = global i32 0
define i32 @_sg_io_open_ro(i8* %0, i8* %1, i32* %2) {
%4 = load i32, i32* @O_RDONLY
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %4
%7 = tail call i32 @_sg_io_open(i8* %0, i8* %1, i32* %2, i32 %6)
ret i32 %7
}
void VMR3AtStateDeregister(void) {}


x86 assembly (clang, -O0):
<VMR3AtStateDeregister>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VMR3AtStateDeregister>:
ret

LLVM IR (-O0):
define void @VMR3AtStateDeregister() {
ret void
}

LLVM IR (-O2):
define void @VMR3AtStateDeregister() {
ret void
}
/* Type definitions */
typedef scalar_t__ const uint32_t;

/* Variables and functions */
uint32_t ui_frame_difference(const uint32_t frame1, const uint32_t frame2) {
  return frame2 - frame1;
}


x86 assembly (clang, -O0):
<ui_frame_difference>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui_frame_difference>:
mov    %rsi,%rax
sub    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @ui_frame_difference(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = sub nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @ui_frame_difference(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int max(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 10, b = 9;
  printf("max = %d\n", max(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <max@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x9,%esi
call   1040 <max@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"max = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 9, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @max(i32 %4, i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"max = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @max(i32 10, i32 9)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
int get_plugin_info(int opcode, char *buf, int buflen) {
  switch (opcode) {
  case 0:
    strncpy(buf, "result process plugin for Julius", buflen);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_plugin_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
test   %eax,%eax
jne    1145 <get_plugin_info+0x35>
jmp    1132 <get_plugin_info+0x22>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xec0(%rip),%rsi
call   1030 <strncpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_plugin_info>:
test   %edi,%edi
je     1117 <get_plugin_info+0x7>
xor    %eax,%eax
ret
push   %rax
lea    0xee1(%rip),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strncpy@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"result process plugin for Julius\00"
define i32 @get_plugin_info(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %12 [
i32 0, label %8
]
8: ; preds = %3
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @strncpy(i8* %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %3, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"result process plugin for Julius\00"
define i32 @get_plugin_info(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %3, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char *getcwd(int /*<<< orphan*/ *, int /*<<< orphan*/);
char *getlogin();
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ stdout;
void print_prompt(void) {
  char *cwd = getcwd(NULL, 0);
  char *login = getlogin();
  printf("%s@%s => ", login, cwd);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1040 <getcwd@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <getlogin@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_prompt>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <getcwd@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <getlogin@plt>
lea    0xea5(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
pop    %rbx
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%s@%s => \00"
@stdout = global i32 0
define void @print_prompt() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @getcwd(i32* null, i32 0)
store i8* %3, i8** %1
%4 = call i8* (...) @getlogin()
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = load i8*, i8** %1
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s@%s => \00"
@stdout = global i32 0
define void @print_prompt() {
%1 = tail call i8* @getcwd(i32* null, i32 0)
%2 = tail call i8* (...) @getlogin()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %1)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void dicebag_init(void) { srand(time(NULL)); }


x86 assembly (clang, -O0):
<dicebag_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dicebag_init>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @dicebag_init() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @dicebag_init() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ message(char *, int, int);
void opm_collision_disadvantage(int k_self, int k_other, float v2) {
  message("colliding disadvantage opm %d from %d\n", k_self, k_other);
}


x86 assembly (clang, -O0):
<opm_collision_disadvantage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed0(%rip),%rdi
call   1030 <message@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opm_collision_disadvantage>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <message@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"colliding disadvantage opm %d from %d\0A\00"
define void @opm_collision_disadvantage(i32 %0, i32 %1, float %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @message(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"colliding disadvantage opm %d from %d\0A\00"
define void @opm_collision_disadvantage(i32 %0, i32 %1, float %2) {
%4 = tail call i32 @message(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t WatchdogIntStatus(uint32_t ui32Base, bool bMasked) {
  ASSERT((ui32Base == 0x40000000) || (ui32Base == 0x40001000));
  if (bMasked) {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000014))));
  } else {
    return ((*((volatile uint32_t *)(ui32Base + 0x00000010))));
  }
}


x86 assembly (clang, -O0):
<WatchdogIntStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x40000000,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     113d <WatchdogIntStatus+0x2d>
cmpl   $0x40001000,-0x8(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
cmpl   $0x0,-0xc(%rbp)
je     1166 <WatchdogIntStatus+0x56>
mov    -0x8(%rbp),%eax
add    $0x14,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <WatchdogIntStatus+0x63>
mov    -0x8(%rbp),%eax
add    $0x10,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogIntStatus>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40000000,%eax
sete   %dil
call   1030 <ASSERT@plt>
xor    %eax,%eax
test   %ebx,%ebx
setne  %al
lea    0x10(,%rax,4),%eax
movslq %ebp,%rcx
mov    (%rax,%rcx,1),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @WatchdogIntStatus(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1073741824
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1073745920
br label %11
11: ; preds = %8, %2
%12 = phi i1 [ true, %2 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
%14 = call i32 @ASSERT(i32 %13)
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %11
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 20
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
%22 = load volatile i32, i32* %21
store i32 %22, i32* %3
br label %29
23: ; preds = %11
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 16
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i32*
%28 = load volatile i32, i32* %27
store i32 %28, i32* %3
br label %29
29: ; preds = %23, %17
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @WatchdogIntStatus(i32 %0, i32 %1) {
%3 = and i32 %0, -4097
%4 = icmp eq i32 %3, 1073741824
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = icmp eq i32 %1, 0
%8 = select i1 %7, i32 16, i32 20
%9 = add nsw i32 %8, %0
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
ret i32 %12
}
/* Variables and functions */
scalar_t__ bcm_2708_power_off();
int bcm_2708_power_on();
int /*<<< orphan*/ wait(int);
int bcm_2708_power_cycle() {
  if (bcm_2708_power_off() < 0)
    return -1;
  wait(5000);
  return bcm_2708_power_on();
}


x86 assembly (clang, -O0):
<bcm_2708_power_cycle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <bcm_2708_power_off@plt>
cmp    $0x0,%rax
jge    1155 <bcm_2708_power_cycle+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <bcm_2708_power_cycle+0x39>
mov    $0x1388,%edi
call   1050 <wait@plt>
mov    $0x0,%al
call   1030 <bcm_2708_power_on@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcm_2708_power_cycle>:
push   %rax
xor    %eax,%eax
call   1040 <bcm_2708_power_off@plt>
test   %rax,%rax
js     114f <bcm_2708_power_cycle+0x1f>
mov    $0x1388,%edi
call   1050 <wait@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bcm_2708_power_on@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bcm_2708_power_cycle() {
%1 = alloca i32
%2 = call i64 (...) @bcm_2708_power_off()
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %8
5: ; preds = %0
%6 = call i32 @wait(i32 5000)
%7 = call i32 (...) @bcm_2708_power_on()
store i32 %7, i32* %1
br label %8
8: ; preds = %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @bcm_2708_power_cycle() {
%1 = tail call i64 (...) @bcm_2708_power_off()
%2 = icmp slt i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @wait(i32 5000)
%5 = tail call i32 (...) @bcm_2708_power_on()
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ -1, %0 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;

/* Variables and functions */
double getpksec(int /*<<< orphan*/, int);
double getpkrtime(u_int64_t speed_bps, int mtu, double refresh_time) {
  return getpksec(speed_bps, mtu) * refresh_time;
}


x86 assembly (clang, -O0):
<getpkrtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <getpksec@plt>
mulsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpkrtime>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <getpksec@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @getpkrtime(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call double @getpksec(i32 %7, i32 %8)
%10 = load double, double* %6
%11 = fmul double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @getpkrtime(i32 %0, i32 %1, double %2) {
%4 = tail call double @getpksec(i32 %0, i32 %1)
%5 = fmul double %4, %2
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "Usage: %s [-t tablist] [file ...]\n", getprogname());
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: %s [-t tablist] [file ...]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: %s [-t tablist] [file ...]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void free_keys(char **keyt, int n) {
  int i;
  if (n < 1)
    return;
  for (i = 0; i < n; i++)
    free(keyt[i]);
  free(keyt);
}


x86 assembly (clang, -O0):
<free_keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    112e <free_keys+0x1e>
jmp    1169 <free_keys+0x59>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <free_keys+0x50>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <free_keys+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_keys>:
test   %esi,%esi
jle    114f <free_keys+0x3f>
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_keys+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @free_keys(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %26
9: ; preds = %2
store i32 0, i32* %5
br label %10
10: ; preds = %20, %9
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load i8**, i8*** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8*, i8** %15, i64 %17
%19 = load i8*, i8** %18
br label %20
20: ; preds = %14
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %10
23: ; preds = %10
%24 = load i8**, i8*** %3
%25 = bitcast i8** %24 to i8*
br label %26
26: ; preds = %23, %8
ret void
}

LLVM IR (-O2):
define void @free_keys(i8** nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
br label %14
14: ; preds = %2, %12
ret void
}
int output(void) { return 42; }


x86 assembly (clang, -O0):
<output>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<output>:
mov    $0x2a,%eax
ret

LLVM IR (-O0):
define i32 @output() {
ret i32 42
}

LLVM IR (-O2):
define i32 @output() {
ret i32 42
}