xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgldlw(int n) { ngen("%s\t%d(%%rbp),%%rax", "movq", n); }


x86 assembly (clang, -O0):
<cgldlw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgldlw>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xef3(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%s\09%d(%%rbp),%%rax\00"
@.str.1 = [5 x i8] c"movq\00"
define void @cgldlw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%s\09%d(%%rbp),%%rax\00"
@.str.1 = [5 x i8] c"movq\00"
define void @cgldlw(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trap_SendConsoleCommand(char *);
void CG_TauntGauntlet_f(void) {
  trap_SendConsoleCommand("cmd vsay kill_guantlet\n");
}


x86 assembly (clang, -O0):
<CG_TauntGauntlet_f>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <trap_SendConsoleCommand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_TauntGauntlet_f>:
lea    0xee9(%rip),%rdi
jmp    1030 <trap_SendConsoleCommand@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"cmd vsay kill_guantlet\0A\00"
define void @CG_TauntGauntlet_f() {
%1 = call i32 @trap_SendConsoleCommand(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"cmd vsay kill_guantlet\0A\00"
define void @CG_TauntGauntlet_f() {
%1 = tail call i32 @trap_SendConsoleCommand(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int);
void *ftell(int /*<<< orphan*/ *);
size_t _a_string_file_length(FILE *fp) {
  unsigned char temp[1000000];
  size_t count = 0;
  long pos;
  pos = ftell(fp);
  fseek(fp, 0L, 2);
  count = ftell(fp);
  fseek(fp, pos, 0);
  return count;
}


x86 assembly (clang, -O0):
<_a_string_file_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf4260,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0xf4258(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0xf4260(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x2,%edx
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0xf4258(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xf4260(%rbp),%rsi
xor    %edx,%edx
call   1040 <fseek@plt>
mov    -0xf4258(%rbp),%rax
add    $0xf4260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_a_string_file_length>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @_a_string_file_length(i32* %0) {
%2 = alloca i32*
%3 = alloca [1000000 x i8]
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %2
store i64 0, i64* %4
%6 = load i32*, i32** %2
%7 = call i8* @ftell(i32* %6)
%8 = ptrtoint i8* %7 to i64
store i64 %8, i64* %5
%9 = load i32*, i32** %2
%10 = call i32 @fseek(i32* %9, i64 0, i32 2)
%11 = load i32*, i32** %2
%12 = call i8* @ftell(i32* %11)
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %4
%14 = load i32*, i32** %2
%15 = load i64, i64* %5
%16 = call i32 @fseek(i32* %14, i64 %15, i32 0)
%17 = load i64, i64* %4
ret i64 %17
}

LLVM IR (-O2):
define i64 @_a_string_file_length(i32* nocapture %0) {
%2 = tail call i8* @ftell(i32* %0)
%3 = ptrtoint i8* %2 to i64
%4 = tail call i32 @fseek(i32* %0, i64 0, i32 2)
%5 = tail call i8* @ftell(i32* %0)
%6 = ptrtoint i8* %5 to i64
%7 = tail call i32 @fseek(i32* %0, i64 %3, i32 0)
ret i64 %6
}
void StrCpy(char *str1, const char *str2) {
  while ((*str1++ = *str2++)) {
    ;
  }
}


x86 assembly (clang, -O0):
<StrCpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <StrCpy+0x3b>
jmp    110c <StrCpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrCpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <StrCpy+0x10>
ret

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

LLVM IR (-O2):
define void @StrCpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printMessage();
int main(void) {
  int i;
  for (i = 1; i <= 5; ++i) {
    printMessage();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     1145 <main+0x35>
mov    $0x0,%al
call   1030 <printMessage@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <printMessage@plt>
xor    %eax,%eax
call   1030 <printMessage@plt>
xor    %eax,%eax
call   1030 <printMessage@plt>
xor    %eax,%eax
call   1030 <printMessage@plt>
xor    %eax,%eax
call   1030 <printMessage@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 5
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 (...) @printMessage()
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printMessage()
%2 = tail call i32 (...) @printMessage()
%3 = tail call i32 (...) @printMessage()
%4 = tail call i32 (...) @printMessage()
%5 = tail call i32 (...) @printMessage()
ret i32 0
}
__attribute__((no)) void inner(void) {
  __asm__ __volatile__("movl $0x101, %%eax\n"
                       "movl $0x102, %%ebx\n"
                       "movl $0x103, %%ecx\n"
                       "movl $0x104, %%edx\n"
                       "movl $0x105, %%esi\n"
                       "movl $0x106, %%edi\n"
                       "movl $0x108, %%esp\n"
                       "movl $0x1234, (%%eax)\n"
                       "ud2"
                       :
                       :
                       : "memory", "%eax", "%ebx", "%ecx", "%edx", "%esi",
                         "%edi");
}


x86 assembly (clang, -O0):
<inner>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x101,%eax
mov    $0x102,%ebx
mov    $0x103,%ecx
mov    $0x104,%edx
mov    $0x105,%esi
mov    $0x106,%edi
mov    $0x108,%esp
movl   $0x1234,(%eax)
ud2
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<inner>:
push   %rbx
mov    $0x101,%eax
mov    $0x102,%ebx
mov    $0x103,%ecx
mov    $0x104,%edx
mov    $0x105,%esi
mov    $0x106,%edi
mov    $0x108,%esp
movl   $0x1234,(%eax)
ud2
pop    %rbx
ret

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

LLVM IR (-O2):
define void @inner() {
tail call void asm sideeffect "movl $$0x101, %eax\0Amovl $$0x102, %ebx\0Amovl $$0x103, %ecx\0Amovl $$0x104, %edx\0Amovl $$0x105, %esi\0Amovl $$0x106, %edi\0Amovl $$0x108, %esp\0Amovl $$0x1234, (%eax)\0Aud2", "~{memory},~{eax},~{ebx},~{ecx},~{edx},~{esi},~{edi},~{dirflag},~{fpsr},~{flags}"()
ret void
}
unsigned short vdp22_get_vlanid(unsigned short x) { return x & 0xfff; }


x86 assembly (clang, -O0):
<vdp22_get_vlanid>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xfff,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdp22_get_vlanid>:
mov    %edi,%eax
and    $0xfff,%eax
ret

LLVM IR (-O0):
define zeroext i16 @vdp22_get_vlanid(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 4095
%6 = trunc i32 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @vdp22_get_vlanid(i16 zeroext %0) {
%2 = and i16 %0, 4095
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_pointerToConstInt(int *);
void f_1(void) {
  int t;
  int *tp = &t;
  doStuff_pointerToConstInt(tp);
}


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

x86 assembly (clang, -O2):
<f_1>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <doStuff_pointerToConstInt@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @f_1() {
%1 = alloca i32
%2 = alloca i32*
store i32* %1, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @doStuff_pointerToConstInt(i32* %3)
ret void
}

LLVM IR (-O2):
define void @f_1() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @doStuff_pointerToConstInt(i32* %1)
ret void
}
int bcd(int I, int J) {
  int t, R;
  if (J > I) {
    t = J;
    J = I;
    I = t;
  }
  R = I % J;
  while (R != 0) {
    I = J;
    J = R;
    R = I % J;
  }
  return J;
}


x86 assembly (clang, -O0):
<bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    1128 <bcd+0x28>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1157 <bcd+0x57>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
jmp    1132 <bcd+0x32>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd>:
mov    %edi,%eax
cmp    %edi,%esi
mov    %esi,%ecx
cmovg  %edi,%ecx
cmovg  %esi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1130 <bcd+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %edx,%esi
mov    %ecx,%eax
cltd
idiv   %esi
mov    %esi,%ecx
test   %edx,%edx
jne    1120 <bcd+0x20>
mov    %esi,%eax
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
%6 = srem i32 %5, %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %8
%9 = phi i32 [ %11, %8 ], [ %6, %2 ]
%10 = phi i32 [ %9, %8 ], [ %4, %2 ]
%11 = srem i32 %10, %9
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %2
%14 = phi i32 [ %4, %2 ], [ %9, %8 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg) {
  if (errno) {
    perror(msg);
  } else {
    fprintf(stderr, "ERROR: %s", msg);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
cmpq   $0x0,(%rax)
je     115b <error+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    1174 <error+0x44>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2e9d(%rip),%rax
cmpq   $0x0,(%rax)
je     1153 <error+0x23>
mov    %rdx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@stderr = global i32 0
@.str = [10 x i8] c"ERROR: %s\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
br label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %5
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@stderr = global i32 0
@.str = [10 x i8] c"ERROR: %s\00"
define void @error(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %9
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %6, %4
%10 = tail call i32 @exit(i32 1)
unreachable
}
int _mutex_acquire(unsigned int tid, unsigned int mid) {
  unsigned int cmd;
  unsigned int sta;
  cmd = (((0x13000000)) | ((0 & ((1 << 3) - 1)) << (8 + (6 + 2))) |
         ((tid & ((1 << 8) - 1)) << (6 + 2)) | ((mid & ((1 << 6) - 1)) << 2));
  sta = (*(volatile unsigned int *)(cmd));
  return sta;
}


x86 assembly (clang, -O0):
<_mutex_acquire>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
or     $0x13000000,%eax
mov    -0x8(%rbp),%ecx
and    $0x3f,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mutex_acquire>:
shl    $0x8,%edi
movzwl %di,%eax
and    $0x3f,%esi
lea    (%rax,%rsi,4),%eax
mov    0x13000000(%rax),%eax
ret

LLVM IR (-O0):
define i32 @_mutex_acquire(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = and i32 %7, 255
%9 = shl i32 %8, 8
%10 = or i32 318767104, %9
%11 = load i32, i32* %4
%12 = and i32 %11, 63
%13 = shl i32 %12, 2
%14 = or i32 %10, %13
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = zext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
store i32 %18, i32* %6
%19 = load i32, i32* %6
ret i32 %19
}

LLVM IR (-O2):
define i32 @_mutex_acquire(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = and i32 %3, 65280
%5 = shl i32 %1, 2
%6 = and i32 %5, 252
%7 = or i32 %4, %6
%8 = or i32 %7, 318767104
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
ret i32 %11
}
/* Variables and functions */
int exp2(float);
float sp_midi2cps(float nn) { return exp2((nn - 69.) / 12.) * 440.; }


x86 assembly (clang, -O0):
<sp_midi2cps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <exp2@plt>
cvtsi2sd %eax,%xmm0
movsd  0xead(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_midi2cps>:
push   %rax
cvtss2sd %xmm0,%xmm0
addsd  0xee3(%rip),%xmm0
divsd  0xee3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <exp2@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sp_midi2cps(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 6.900000e+01
%6 = fdiv double %5, 1.200000e+01
%7 = fptrunc double %6 to float
%8 = call i32 @exp2(float %7)
%9 = sitofp i32 %8 to double
%10 = fmul double %9, 4.400000e+02
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @sp_midi2cps(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -6.900000e+01
%4 = fdiv double %3, 1.200000e+01
%5 = fptrunc double %4 to float
%6 = tail call i32 @exp2(float %5)
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 4.400000e+02
%9 = fptrunc double %8 to float
ret float %9
}
/* Variables and functions */
int rom_present(char *);
int et4000w32p_cardex_available(void) {
  return rom_present(L"roms/video/et4000w32/cardex.vbi");
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <rom_present@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
lea    0xee9(%rip),%rdi
jmp    1030 <rom_present@plt>

LLVM IR (-O0):
@.str = [32 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 101, i32 116, i32 52, i32 48, i32 48, i32 48, i32 119, i32 51, i32 50, i32 47, i32 99, i32 97, i32 114, i32 100, i32 101, i32 120, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @et4000w32p_cardex_available() {
%1 = call i32 @rom_present(i8* bitcast ([32 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [32 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 101, i32 116, i32 52, i32 48, i32 48, i32 48, i32 119, i32 51, i32 50, i32 47, i32 99, i32 97, i32 114, i32 100, i32 101, i32 120, i32 46, i32 118, i32 98, i32 105, i32 0]
define i32 @et4000w32p_cardex_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([32 x i32]* @.str to i8*))
ret i32 %1
}
long spi_read_status() {
  volatile unsigned long *fifo = (volatile unsigned long *)0xd4035010;
  volatile unsigned long *stat = (volatile unsigned long *)0xd4035008;
  unsigned long regval;
  *fifo = 5;
  *fifo = 0;
  while ((*stat & 8) == 0)
    ;
  regval = (unsigned char)*fifo;
  while ((*stat & 8) == 0)
    ;
  return *fifo;
}


x86 assembly (clang, -O0):
<spi_read_status>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd4035010,%eax
mov    %rax,-0x8(%rbp)
mov    $0xd4035008,%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x5,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
and    $0x8,%rax
cmp    $0x0,%rax
jne    1146 <spi_read_status+0x46>
jmp    112c <spi_read_status+0x2c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl %al,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
and    $0x8,%rax
cmp    $0x0,%rax
jne    116e <spi_read_status+0x6e>
jmp    1154 <spi_read_status+0x54>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_read_status>:
mov    $0xd4035010,%eax
movq   $0x5,(%rax)
movq   $0x0,(%rax)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testq  $0x8,-0x8(%rax)
je     1120 <spi_read_status+0x20>
mov    (%rax),%rcx
nopl   (%rax)
testq  $0x8,-0x8(%rax)
je     1130 <spi_read_status+0x30>
mov    (%rax),%rax
ret

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

LLVM IR (-O2):
define i64 @spi_read_status() {
store volatile i64 5, i64* inttoptr (i64 3556986896 to i64*)
store volatile i64 0, i64* inttoptr (i64 3556986896 to i64*)
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 3556986888 to i64*)
%3 = and i64 %2, 8
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 3556986896 to i64*)
br label %7
7: ; preds = %7, %5
%8 = load volatile i64, i64* inttoptr (i64 3556986888 to i64*)
%9 = and i64 %8, 8
%10 = icmp eq i64 %9, 0
br i1 %10, label %7, label %11
11: ; preds = %7
%12 = load volatile i64, i64* inttoptr (i64 3556986896 to i64*)
ret i64 %12
}
void ut2doy(year, doy) int *year;
double *doy;
{
  double date, time;
  ut2dt(&date, &time);
  dt2doy(date, time, year, doy);
  return;
}


x86 assembly (clang, -O0):
<ut2doy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <ut2dt@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%al
call   1030 <dt2doy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut2doy>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <ut2dt@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%al
call   1030 <dt2doy@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ut2doy(i32* %0, double* %1) {
%3 = alloca i32*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store i32* %0, i32** %3
store double* %1, double** %4
%7 = call i32 (double*, double*, ...) bitcast (i32 (...)* @ut2dt to i32 (double*, double*, ...)*)(double* %5, double* %6)
%8 = load double, double* %5
%9 = load double, double* %6
%10 = load i32*, i32** %3
%11 = load double*, double** %4
%12 = call i32 (double, double, i32*, double*, ...) bitcast (i32 (...)* @dt2doy to i32 (double, double, i32*, double*, ...)*)(double %8, double %9, i32* %10, double* %11)
ret void
}

LLVM IR (-O2):
define void @ut2doy(i32* %0, double* %1) {
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = call i32 (double*, double*, ...) bitcast (i32 (...)* @ut2dt to i32 (double*, double*, ...)*)(double* %3, double* %4)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i32 (double, double, i32*, double*, ...) bitcast (i32 (...)* @dt2doy to i32 (double, double, i32*, double*, ...)*)(double %8, double %9, i32* %0, double* %1)
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int64_t x264_mdate(void) {
  struct timeval tv_date;
  gettimeofday(&tv_date, NULL);
  return ((int64_t)tv_date.tv_sec * 1000000 + (int64_t)tv_date.tv_usec);
}


x86 assembly (clang, -O0):
<x264_mdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
mov    -0x10(%rbp),%rcx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x264_mdate>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @x264_mdate() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @x264_mdate() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %7, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int);
int /*<<< orphan*/ report(int);
void fail(char *func, int line) {
  printf("Test failed in %s:%i\n", func, line);
  report(0xeeeeeeee);
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xeeeeeeee,%edi
call   1050 <report@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xeeeeeeee,%edi
call   1050 <report@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Test failed in %s:%i\0A\00"
define void @fail(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* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = call i32 @report(i32 -286331154)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"Test failed in %s:%i\0A\00"
define void @fail(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 @report(i32 -286331154)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t gcd(int32_t a, int32_t b) {
  int32_t tmp;
  while (b) {
    tmp = a % b;
    a = b;
    b = tmp;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello git\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"hello git\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"hello git\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct inputSource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pm_error(char *);
void IoServer(struct inputSource *const inputSourceP,
              const char *const parallelHostName, int const portNum) {
  pm_error("This version of Ppmtompeg cannot run an I/O server because "
           "it does not have socket capability.");
}


x86 assembly (clang, -O0):
<IoServer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <pm_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IoServer>:
lea    0xee9(%rip),%rdi
jmp    1030 <pm_error@plt>

LLVM IR (-O0):
%struct.inputSource = type { i32 }
@.str = [95 x i8] c"This version of Ppmtompeg cannot run an I/O server because it does not have socket capability.\00"
define void @IoServer(%struct.inputSource* %0, i8* %1, i32 %2) {
%4 = alloca %struct.inputSource*
%5 = alloca i8*
%6 = alloca i32
store %struct.inputSource* %0, %struct.inputSource** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @pm_error(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.inputSource = type { i32 }
@.str = [95 x i8] c"This version of Ppmtompeg cannot run an I/O server because it does not have socket capability.\00"
define void @IoServer(%struct.inputSource* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @pm_error(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
double frexp(double x, int *ex) {
  uint64_t *dir = (uint64_t *)&x;
  *ex = ((*dir >> 52) & ((1 << 11) - 1)) - 1022;
  *dir &= ~(((1LL << 11) - 1) << 52);
  *dir |= 1022LL << 52;
  return x;
}


x86 assembly (clang, -O0):
<frexp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    $0x34,%ecx
sar    %cl,%eax
mov    %eax,%ecx
and    $0x7ff,%ecx
sub    $0x3fe,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
movslq (%rax),%rcx
movabs $0x800fffffffffffff,%rdx
ff 0f 80
and    %rdx,%rcx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
movslq (%rax),%rcx
movabs $0x3fe0000000000000,%rdx
or     %rdx,%rcx
mov    %ecx,(%rax)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @frexp(double %0, i32* %1) {
%3 = alloca double
%4 = alloca i32*
%5 = alloca i32*
store double %0, double* %3
store i32* %1, i32** %4
%6 = bitcast double* %3 to i32*
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %7
%9 = ashr i32 %8, 52
%10 = and i32 %9, 2047
%11 = sub nsw i32 %10, 1022
%12 = load i32*, i32** %4
store i32 %11, i32* %12
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = sext i32 %14 to i64
%16 = and i64 %15, -9218868437227405313
%17 = trunc i64 %16 to i32
store i32 %17, i32* %13
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = sext i32 %19 to i64
%21 = or i64 %20, 4602678819172646912
%22 = trunc i64 %21 to i32
store i32 %22, i32* %18
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
define double @frexp(double returned %0, i32* nocapture readnone %1) {
ret double %0
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER;

/* Variables and functions */
int /*<<< orphan*/ const *EVP_des_ede_cfb64();
const EVP_CIPHER *EVP_des_ede_cfb(void) { return EVP_des_ede_cfb64(); }


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

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

LLVM IR (-O0):
define i32* @EVP_des_ede_cfb() {
%1 = call i32* (...) @EVP_des_ede_cfb64()
ret i32* %1
}

LLVM IR (-O2):
define i32* @EVP_des_ede_cfb() {
%1 = tail call i32* (...) @EVP_des_ede_cfb64()
ret i32* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fwrite(void const *, int, size_t, int /*<<< orphan*/ *);
size_t WriteBytes(const void *bytes, size_t num_bytes, void *io_ptr) {
  return fwrite(bytes, 1, num_bytes, (FILE *)io_ptr);
}


x86 assembly (clang, -O0):
<WriteBytes>:
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),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteBytes>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define i64 @WriteBytes(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i32*
%11 = call i64 @fwrite(i8* %7, i32 1, i64 %8, i32* %10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @WriteBytes(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = tail call i64 @fwrite(i8* %0, i32 1, i64 %1, i32* %4)
ret i64 %5
}
void yy_2_XmlCharRefChoice(char *yytext, int yyleng) {
  ;
  ;
}


x86 assembly (clang, -O0):
<yy_2_XmlCharRefChoice>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @yy_2_XmlCharRefChoice(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t get_timer16(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_timer16() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CRL;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *ASN1_item_d2i_bio(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ **);
int /*<<< orphan*/ X509_CRL_it;
X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl) {
  return ASN1_item_d2i_bio(&X509_CRL_it, bp, crl);
}


x86 assembly (clang, -O0):
<d2i_X509_CRL_bio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    0x2eb1(%rip),%rdi
call   1030 <ASN1_item_d2i_bio@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2i_X509_CRL_bio>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rdi
jmp    1030 <ASN1_item_d2i_bio@plt>

LLVM IR (-O0):
@X509_CRL_it = global i32 0
define i32* @d2i_X509_CRL_bio(i32* %0, i32** %1) {
%3 = alloca i32*
%4 = alloca i32**
store i32* %0, i32** %3
store i32** %1, i32*** %4
%5 = load i32*, i32** %3
%6 = load i32**, i32*** %4
%7 = call i32* @ASN1_item_d2i_bio(i32* @X509_CRL_it, i32* %5, i32** %6)
ret i32* %7
}

LLVM IR (-O2):
@X509_CRL_it = global i32 0
define i32* @d2i_X509_CRL_bio(i32* %0, i32** %1) {
%3 = tail call i32* @ASN1_item_d2i_bio(i32* @X509_CRL_it, i32* %0, i32** %1)
ret i32* %3
}
int abc(int x) { return x + x; }


x86 assembly (clang, -O0):
<abc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abc>:
lea    (%rdi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @abc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @abc(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bno_delay_ms(uint32_t delay_time) {
  while (delay_time--)
    printf("Delay");
}


x86 assembly (clang, -O0):
<bno_delay_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1140 <bno_delay_ms+0x30>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    111b <bno_delay_ms+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bno_delay_ms>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     113d <bno_delay_ms+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <bno_delay_ms+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Delay\00"
define void @bno_delay_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Delay\00"
define void @bno_delay_ms(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("O tipo de 123.4 tem %ld bytes.\n", sizeof(typeof(123.4)));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"O tipo de 123.4 tem %ld bytes.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"O tipo de 123.4 tem %ld bytes.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ client_cmd(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void client_dump() { client_cmd(4, NULL, NULL); }


x86 assembly (clang, -O0):
<client_dump>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <client_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_dump>:
mov    $0x4,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <client_cmd@plt>

LLVM IR (-O0):
define void @client_dump() {
%1 = call i32 @client_cmd(i32 4, i32* null, i32* null)
ret void
}

LLVM IR (-O2):
define void @client_dump() {
%1 = tail call i32 @client_cmd(i32 4, i32* null, i32* null)
ret void
}
/* Variables and functions */
float strtox(char const *, char **, int /*<<< orphan*/);
float strtof(const char *restrict s, char **restrict p) {
  return strtox(s, p, 0);
}


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

x86 assembly (clang, -O2):
<strtof>:
xor    %edx,%edx
jmp    1030 <strtox@plt>

LLVM IR (-O0):
define float @strtof(i8* noalias %0, i8** noalias %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = call float @strtox(i8* %5, i8** %6, i32 0)
ret float %7
}

LLVM IR (-O2):
define float @strtof(i8* noalias %0, i8** noalias %1) {
%3 = tail call float @strtox(i8* %0, i8** %1, i32 0)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int a = 2, b = 4;
  if ((a = 2) & (b = 4))
    printf("TAK\n");
  else
    printf("NIE\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    114a <main+0x3a>
jmp    115b <main+0x4b>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    1167 <main+0x57>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"TAK\0A\00"
@.str.1 = [5 x i8] c"NIE\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 4, i32* %3
store i32 2, i32* %2
store i32 4, i32* %3
br i1 false, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 0
}

LLVM IR (-O2):
@str = [4 x i8] c"NIE\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct rbTree {
  int dummy;
};
struct bed {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bedIntoRangeTree(struct bed *, struct rbTree *);
struct rbTree *rangeTreeNew();
struct rbTree *bedToRangeTree(struct bed *bed) {
  struct rbTree *rangeTree = rangeTreeNew();
  bedIntoRangeTree(bed, rangeTree);
  return rangeTree;
}


x86 assembly (clang, -O0):
<bedToRangeTree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rangeTreeNew@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <bedIntoRangeTree@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bedToRangeTree>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <rangeTreeNew@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <bedIntoRangeTree@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.rbTree = type { i32 }
%struct.bed = type { i32 }
define %struct.rbTree* @bedToRangeTree(%struct.bed* %0) {
%2 = alloca %struct.bed*
%3 = alloca %struct.rbTree*
store %struct.bed* %0, %struct.bed** %2
%4 = call %struct.rbTree* (...) @rangeTreeNew()
store %struct.rbTree* %4, %struct.rbTree** %3
%5 = load %struct.bed*, %struct.bed** %2
%6 = load %struct.rbTree*, %struct.rbTree** %3
%7 = call i32 @bedIntoRangeTree(%struct.bed* %5, %struct.rbTree* %6)
%8 = load %struct.rbTree*, %struct.rbTree** %3
ret %struct.rbTree* %8
}

LLVM IR (-O2):
%struct.rbTree = type { i32 }
%struct.bed = type { i32 }
define %struct.rbTree* @bedToRangeTree(%struct.bed* %0) {
%2 = tail call %struct.rbTree* (...) @rangeTreeNew()
%3 = tail call i32 @bedIntoRangeTree(%struct.bed* %0, %struct.rbTree* %2)
ret %struct.rbTree* %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t f1(uint32_t x, uint32_t y, uint32_t z) { return x ^ y ^ z; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %edi,%eax
xor    %esi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f1(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 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = xor i32 %7, %8
%10 = load i32, i32* %6
%11 = xor i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, %0
%5 = xor i32 %4, %2
ret i32 %5
}