xunge/DecIR huggingface dataset:
/* Variables and functions */
int fact(int);
int P(int n, int r) { return fact(n) / fact(n - r); }


x86 assembly (clang, -O0):
<P>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fact@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <fact@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<P>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <fact@plt>
mov    %eax,%r14d
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <fact@plt>
mov    %eax,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @P(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 = call i32 @fact(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = sub nsw i32 %7, %8
%10 = call i32 @fact(i32 %9)
%11 = sdiv i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @P(i32 %0, i32 %1) {
%3 = tail call i32 @fact(i32 %0)
%4 = sub nsw i32 %0, %1
%5 = tail call i32 @fact(i32 %4)
%6 = sdiv i32 %3, %5
ret i32 %6
}
void gtk_cell_renderer_render() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_renderer_render() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x6a() {
  Assert_real((isodigit(106) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              535, ("isodigit should be 0 for j"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x6a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6a,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x217,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x6a>:
push   %rax
mov    $0x6a,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x217,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for j\00"
define void @t_isodigit_0x6a() {
%1 = call i64 @isodigit(i32 106)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 535, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for j\00"
define void @t_isodigit_0x6a() {
%1 = tail call i64 @isodigit(i32 106)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 535, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int assignValueToParam(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ getParamEnumFromString(char const *);
int /*<<< orphan*/ getParamFromParamEnum(int /*<<< orphan*/);
int setParam(const char *paramName, const char *paramValue) {
  int err = EXIT_SUCCESS;
  err = assignValueToParam(
      getParamFromParamEnum(getParamEnumFromString(paramName)), paramValue);
  return err;
}


x86 assembly (clang, -O0):
<setParam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getParamEnumFromString@plt>
mov    %eax,%edi
call   1030 <getParamFromParamEnum@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1050 <assignValueToParam@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setParam>:
push   %rbx
mov    %rsi,%rbx
call   1040 <getParamEnumFromString@plt>
mov    %eax,%edi
call   1030 <getParamFromParamEnum@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1050 <assignValueToParam@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @setParam(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i32, i32* @EXIT_SUCCESS
store i32 %6, i32* %5
%7 = load i8*, i8** %3
%8 = call i32 @getParamEnumFromString(i8* %7)
%9 = call i32 @getParamFromParamEnum(i32 %8)
%10 = load i8*, i8** %4
%11 = call i32 @assignValueToParam(i32 %9, i8* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @setParam(i8* %0, i8* %1) {
%3 = tail call i32 @getParamEnumFromString(i8* %0)
%4 = tail call i32 @getParamFromParamEnum(i32 %3)
%5 = tail call i32 @assignValueToParam(i32 %4, i8* %1)
ret i32 %5
}
void OSW_GnrlcallsWDT(void) {}


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

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

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

LLVM IR (-O2):
define void @OSW_GnrlcallsWDT() {
ret void
}
/* Variables and functions */
char *strncat(char *, char const *, size_t);
char *lenient_strncat(char *dest, const char *src, size_t len) {
  if (dest && src) {
    return strncat(dest, src, len);
  }
  return dest;
}


x86 assembly (clang, -O0):
<lenient_strncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1154 <lenient_strncat+0x44>
cmpq   $0x0,-0x18(%rbp)
je     1154 <lenient_strncat+0x44>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncat@plt>
mov    %rax,-0x8(%rbp)
jmp    115c <lenient_strncat+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lenient_strncat>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1126 <lenient_strncat+0x16>
test   %rsi,%rsi
je     1126 <lenient_strncat+0x16>
mov    %rbx,%rdi
call   1030 <strncat@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @lenient_strncat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = load i64, i64* %7
%17 = call i8* @strncat(i8* %14, i8* %15, i64 %16)
store i8* %17, i8** %4
br label %20
18: ; preds = %10, %3
%19 = load i8*, i8** %5
store i8* %19, i8** %4
br label %20
20: ; preds = %18, %13
%21 = load i8*, i8** %4
ret i8* %21
}

LLVM IR (-O2):
define i8* @lenient_strncat(i8* returned %0, i8* %1, i64 %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i8* %1, null
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i8* @strncat(i8* %0, i8* %1, i64 %2)
br label %9
9: ; preds = %3, %7
ret i8* %0
}
const long min(long a, long b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int fabs(double);
double tanh(double);
double ladder_shape_gain(double x) { return fabs(x) < 1e-20 ? 1 : tanh(x) / x; }


x86 assembly (clang, -O0):
<ladder_shape_gain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xebd(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    115f <ladder_shape_gain+0x3f>
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1173 <ladder_shape_gain+0x53>
movsd  -0x8(%rbp),%xmm0
call   1030 <tanh@plt>
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ladder_shape_gain>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <fabs@plt>
test   %eax,%eax
jle    1140 <ladder_shape_gain+0x20>
movsd  (%rsp),%xmm0
call   1030 <tanh@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret
movsd  0xeb8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ladder_shape_gain(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @fabs(double %3)
%5 = sitofp i32 %4 to double
%6 = fcmp olt double %5, 0x3BC79CA10C924223
br i1 %6, label %7, label %8
7: ; preds = %1
br label %13
8: ; preds = %1
%9 = load double, double* %2
%10 = call double @tanh(double %9)
%11 = load double, double* %2
%12 = fdiv double %10, %11
br label %13
13: ; preds = %8, %7
%14 = phi double [ 1.000000e+00, %7 ], [ %12, %8 ]
ret double %14
}

LLVM IR (-O2):
define double @ladder_shape_gain(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call double @tanh(double %0)
%6 = fdiv double %5, %0
br label %7
7: ; preds = %1, %4
%8 = phi double [ %6, %4 ], [ 1.000000e+00, %1 ]
ret double %8
}
bar() {}


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

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

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 undef
}
int fun187() { return 187; }


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

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

LLVM IR (-O0):
define i32 @fun187() {
ret i32 187
}

LLVM IR (-O2):
define i32 @fun187() {
ret i32 187
}
char *skip(char *s, char c) {
  while (*s != c && *s != '\0')
    s++;
  if (*s != '\0')
    *s++ = '\0';
  return s;
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0xa(%rbp)
je     1136 <skip+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1146 <skip+0x46>
jmp    1157 <skip+0x57>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <skip+0xe>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1179 <skip+0x79>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
add    $0x1,%rax
cmp    %sil,%cl
je     1120 <skip+0x20>
test   %cl,%cl
jne    1110 <skip+0x10>
lea    -0x1(%rax),%rdx
test   %cl,%cl
je     112c <skip+0x2c>
movb   $0x0,(%rdx)
ret
mov    %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @skip(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %1
%7 = icmp eq i8 %5, 0
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
br i1 %7, label %12, label %11
11: ; preds = %10
store i8 0, i8* %4
br label %12
12: ; preds = %11, %10
%13 = phi i8* [ %9, %11 ], [ %4, %10 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xd5() {
  Assert_real((iscntrl(213) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              1070, ("iscntrl should be 0 for 0xd5"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0xd5>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd5,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x42e,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0xd5>:
push   %rax
mov    $0xd5,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x42e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xd5\00"
define void @t_iscntrl_0xd5() {
%1 = call i64 @iscntrl(i32 213)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1070, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xd5\00"
define void @t_iscntrl_0xd5() {
%1 = tail call i64 @iscntrl(i32 213)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1070, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double stress_funccall_double_1(double const);
double stress_funcdeep_double_3(double const, double const, double const);
double __attribute__((no))
stress_funcdeep_double_4(const double a, const double b, const double c,
                         const double d) {
  return stress_funcdeep_double_3(d, c, b) + stress_funccall_double_1(a);
}


x86 assembly (clang, -O0):
<stress_funcdeep_double_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
call   1030 <stress_funcdeep_double_3@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <stress_funccall_double_1@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_funcdeep_double_4>:
sub    $0x18,%rsp
movaps %xmm1,%xmm4
movsd  %xmm0,0x10(%rsp)
movaps %xmm3,%xmm0
movaps %xmm2,%xmm1
movaps %xmm4,%xmm2
call   1030 <stress_funcdeep_double_3@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <stress_funccall_double_1@plt>
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @stress_funcdeep_double_4(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %8
%10 = load double, double* %7
%11 = load double, double* %6
%12 = call double @stress_funcdeep_double_3(double %9, double %10, double %11)
%13 = load double, double* %5
%14 = call double @stress_funccall_double_1(double %13)
%15 = fadd double %12, %14
ret double %15
}

LLVM IR (-O2):
define double @stress_funcdeep_double_4(double %0, double %1, double %2, double %3) {
%5 = tail call double @stress_funcdeep_double_3(double %3, double %2, double %1)
%6 = tail call double @stress_funccall_double_1(double %0)
%7 = fadd double %5, %6
ret double %7
}
/* Type definitions */
struct omap_mbq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct omap_mbq *);
void mbq_exit(struct omap_mbq **addr) {
  if (*addr)
    kfree(*addr);
}


x86 assembly (clang, -O0):
<mbq_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <mbq_exit+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <kfree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbq_exit>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <mbq_exit+0xd>
jmp    1030 <kfree@plt>
ret

LLVM IR (-O0):
%struct.omap_mbq = type { i32 }
define void @mbq_exit(%struct.omap_mbq** %0) {
%2 = alloca %struct.omap_mbq**
store %struct.omap_mbq** %0, %struct.omap_mbq*** %2
%3 = load %struct.omap_mbq**, %struct.omap_mbq*** %2
%4 = load %struct.omap_mbq*, %struct.omap_mbq** %3
%5 = icmp ne %struct.omap_mbq* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.omap_mbq**, %struct.omap_mbq*** %2
%8 = load %struct.omap_mbq*, %struct.omap_mbq** %7
%9 = call i32 @kfree(%struct.omap_mbq* %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.omap_mbq = type { i32 }
define void @mbq_exit(%struct.omap_mbq** nocapture %0) {
%2 = load %struct.omap_mbq*, %struct.omap_mbq** %0
%3 = icmp eq %struct.omap_mbq* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @kfree(%struct.omap_mbq* %2)
br label %6
6: ; preds = %4, %1
ret void
}
const char *wildref(name) const char *name;
{ return (concat(name, '?')); }


x86 assembly (clang, -O0):
<wildref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3f,%esi
mov    $0x0,%al
call   1030 <concat@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wildref>:
push   %rax
mov    $0x3f,%esi
xor    %eax,%eax
call   1030 <concat@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @wildref(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @concat to i32 (i8*, i32, ...)*)(i8* %3, i32 63)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @wildref(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @concat to i32 (i8*, i32, ...)*)(i8* %0, i32 63)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_GREEN_LED_OUTPUT() { set_io_bit(0x39, 6); }


x86 assembly (clang, -O0):
<TOSH_MAKE_GREEN_LED_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x39,%edi
mov    $0x6,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_GREEN_LED_OUTPUT>:
mov    $0x39,%edi
mov    $0x6,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_GREEN_LED_OUTPUT() {
%1 = call i32 @set_io_bit(i32 57, i32 6)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_GREEN_LED_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 57, i32 6)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t gfadd(uint8_t a, uint8_t b) { return a ^ b; }


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

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

LLVM IR (-O0):
define i32 @gfadd(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 = xor i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @gfadd(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
double cbrt(double);
double airCbrt(double v) { return cbrt(v); }


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

x86 assembly (clang, -O2):
<airCbrt>:
jmp    1030 <cbrt@plt>

LLVM IR (-O0):
define double @airCbrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @cbrt(double %3)
ret double %4
}

LLVM IR (-O2):
define double @airCbrt(double %0) {
%2 = tail call double @cbrt(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int distance = 100;
  printf("You are %d miles away. \n", distance);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"You are %d miles away. \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dec_to_hex();
int /*<<< orphan*/ hex_to_dec();
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char n;
  scanf("%c", &n);
  switch (n) {
  case 'h':
    hex_to_dec();
    break;
  case 'd':
    dec_to_hex();
    break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x64,%eax
je     1181 <main+0x51>
jmp    1164 <main+0x34>
mov    -0xc(%rbp),%eax
sub    $0x68,%eax
jne    1188 <main+0x58>
jmp    1175 <main+0x45>
mov    $0x0,%al
call   1040 <hex_to_dec@plt>
jmp    1188 <main+0x58>
mov    $0x0,%al
call   1030 <dec_to_hex@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0x7(%rsp),%eax
cmp    $0x64,%eax
je     115a <main+0x2a>
cmp    $0x68,%eax
jne    1161 <main+0x31>
xor    %eax,%eax
call   1040 <hex_to_dec@plt>
jmp    1161 <main+0x31>
xor    %eax,%eax
call   1030 <dec_to_hex@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %10 [
i32 104, label %6
i32 100, label %8
]
6: ; preds = %0
%7 = call i32 (...) @hex_to_dec()
br label %10
8: ; preds = %0
%9 = call i32 (...) @dec_to_hex()
br label %10
10: ; preds = %0, %8, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
switch i32 %4, label %9 [
i32 104, label %5
i32 100, label %7
]
5: ; preds = %0
%6 = call i32 (...) @hex_to_dec()
br label %9
7: ; preds = %0
%8 = call i32 (...) @dec_to_hex()
br label %9
9: ; preds = %0, %7, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int array_sum(int *);
int /*<<< orphan*/ foo(int *, int);
int main(void) {
  int a[50];
  foo(a, 50);
  int res = array_sum(a);
  if (res != 49)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
mov    $0x32,%esi
call   1040 <foo@plt>
lea    -0xd0(%rbp),%rdi
call   1050 <array_sum@plt>
mov    %eax,-0xd4(%rbp)
cmpl   $0x31,-0xd4(%rbp)
je     1179 <main+0x49>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x32,%esi
call   1040 <foo@plt>
mov    %rbx,%rdi
call   1050 <array_sum@plt>
cmp    $0x31,%eax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
%5 = call i32 @foo(i32* %4, i32 50)
%6 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
%7 = call i32 @array_sum(i32* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 49
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [50 x i32]
%2 = bitcast [50 x i32]* %1 to i8*
%3 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3, i32 50)
%5 = call i32 @array_sum(i32* %3)
%6 = icmp eq i32 %5, 49
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ csr_perror(char const *);
int /*<<< orphan*/ exit(int);
void csr_exit_perror(const char *s) {
  csr_perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<csr_exit_perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <csr_perror@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<csr_exit_perror>:
push   %rax
call   1040 <csr_perror@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @csr_exit_perror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @csr_perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @csr_exit_perror(i8* %0) {
%2 = tail call i32 @csr_perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ M_PI;
float rad2deg(float rad) { return rad * 180.0f / (float)M_PI; }


x86 assembly (clang, -O0):
<rad2deg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mov    0x2ecb(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad2deg>:
mulss  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
cvtsi2ssq (%rax),%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i64 0
define float @rad2deg(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.800000e+02
%5 = load i64, i64* @M_PI
%6 = sitofp i64 %5 to float
%7 = fdiv float %4, %6
ret float %7
}

LLVM IR (-O2):
@M_PI = global i64 0
define float @rad2deg(float %0) {
%2 = fmul float %0, 1.800000e+02
%3 = load i64, i64* @M_PI
%4 = sitofp i64 %3 to float
%5 = fdiv float %2, %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ my_reboot(int);
void do_poweroff(void) { my_reboot(0x4321FEDC); }


x86 assembly (clang, -O0):
<do_poweroff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4321fedc,%edi
call   1030 <my_reboot@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_poweroff>:
mov    $0x4321fedc,%edi
jmp    1030 <my_reboot@plt>

LLVM IR (-O0):
define void @do_poweroff() {
%1 = call i32 @my_reboot(i32 1126301404)
ret void
}

LLVM IR (-O2):
define void @do_poweroff() {
%1 = tail call i32 @my_reboot(i32 1126301404)
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ t1(int, int);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  int nprocs, nreps;
  if (argc < 3) {
    usage();
  }
  nprocs = atoi(argv[1]);
  nreps = atoi(argv[2]);
  t1(nprocs, nreps);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1157 <main+0x27>
mov    $0x0,%al
call   1040 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <t1@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x2,%edi
jg     1142 <main+0x12>
xor    %eax,%eax
call   1040 <usage@plt>
mov    0x8(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <t1@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (...) @usage()
br label %12
12: ; preds = %10, %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %6
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
store i32 %20, i32* %7
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = call i32 @t1(i32 %21, i32 %22)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = tail call i32 @t1(i32 %9, i32 %12)
ret i32 0
}
/* Variables and functions */
char *mlr_malloc_or_die(int);
int snprintf(int /*<<< orphan*/ *, int /*<<< orphan*/, char *, long long);
int /*<<< orphan*/ sprintf(char *, char *, long long);
char *mlr_alloc_string_from_ll(long long value) {
  int n = snprintf(NULL, 0, "%lli", value);
  char *string = mlr_malloc_or_die(n + 1);
  sprintf(string, "%lli", value);
  return string;
}


x86 assembly (clang, -O0):
<mlr_alloc_string_from_ll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <mlr_malloc_or_die@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe8d(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlr_alloc_string_from_ll>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xec1(%rip),%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    %r15,%rcx
call   1030 <snprintf@plt>
lea    0x1(%rax),%edi
call   1040 <mlr_malloc_or_die@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lli\00"
define i8* @mlr_alloc_string_from_ll(i64 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i8*
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = call i32 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i8* @mlr_malloc_or_die(i32 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i64, i64* %2
%12 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lli\00"
define i8* @mlr_alloc_string_from_ll(i64 %0) {
%2 = tail call i32 @snprintf(i32* null, i32 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @mlr_malloc_or_die(i32 %3)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i8* %4
}
int free_xxx_array(the_array, length)
short **the_array;
long length;
{
  int i;
  for (i = 0; i < length; i++)
    free(the_array[i]);
  free(the_array);
  return (1);
}


x86 assembly (clang, -O0):
<free_xxx_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1154 <free_xxx_array+0x44>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <free_xxx_array+0x17>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_xxx_array>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %rsi,%rsi
jle    1142 <free_xxx_array+0x32>
mov    %rsi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_xxx_array+0x20>
mov    %r14,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @free_xxx_array(i16** nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %11
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i16*, i16** %0, i64 %5
%7 = bitcast i16** %6 to i8**
%8 = load i8*, i8** %7
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = bitcast i16** %0 to i8*
tail call void @free(i8* %12)
ret i32 1
}
/* Variables and functions */
int ispowof2(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 3;
  printf("%d\n", ispowof2(x));
  x = 4;
  printf("%d\n", ispowof2(x));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
call   1040 <ispowof2@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x4,%edi
call   1040 <ispowof2@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @ispowof2(i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @ispowof2(i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
struct DynArr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ popDynArr(struct DynArr *);
int /*<<< orphan*/ pushDynArr(struct DynArr *, double);
double topDynArr(struct DynArr *);
void multiply(struct DynArr *stack) {
  double i = topDynArr(stack);
  popDynArr(stack);
  double j = topDynArr(stack);
  popDynArr(stack);
  pushDynArr(stack, (i * j));
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1050 <pushDynArr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <topDynArr@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
mov    %rbx,%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
movsd  (%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <pushDynArr@plt>

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define void @multiply(%struct.DynArr* %0) {
%2 = alloca %struct.DynArr*
%3 = alloca double
%4 = alloca double
store %struct.DynArr* %0, %struct.DynArr** %2
%5 = load %struct.DynArr*, %struct.DynArr** %2
%6 = call double @topDynArr(%struct.DynArr* %5)
store double %6, double* %3
%7 = load %struct.DynArr*, %struct.DynArr** %2
%8 = call i32 @popDynArr(%struct.DynArr* %7)
%9 = load %struct.DynArr*, %struct.DynArr** %2
%10 = call double @topDynArr(%struct.DynArr* %9)
store double %10, double* %4
%11 = load %struct.DynArr*, %struct.DynArr** %2
%12 = call i32 @popDynArr(%struct.DynArr* %11)
%13 = load %struct.DynArr*, %struct.DynArr** %2
%14 = load double, double* %3
%15 = load double, double* %4
%16 = fmul double %14, %15
%17 = call i32 @pushDynArr(%struct.DynArr* %13, double %16)
ret void
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define void @multiply(%struct.DynArr* %0) {
%2 = tail call double @topDynArr(%struct.DynArr* %0)
%3 = tail call i32 @popDynArr(%struct.DynArr* %0)
%4 = tail call double @topDynArr(%struct.DynArr* %0)
%5 = tail call i32 @popDynArr(%struct.DynArr* %0)
%6 = fmul double %2, %4
%7 = tail call i32 @pushDynArr(%struct.DynArr* %0, double %6)
ret void
}
/* Variables and functions */
int atoi(char *);
char *convert(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int num = atoi(argv[2]);
  char *p = convert(argv[1], num);
  printf("%s\n", p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x14(%rbp),%esi
call   1030 <convert@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x10(%rsi),%rdi
call   1050 <atoi@plt>
mov    0x8(%rbx),%rdi
mov    %eax,%esi
call   1030 <convert@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 2
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %6
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = load i32, i32* %6
%16 = call i8* @convert(i8* %14, i32 %15)
store i8* %16, i8** %7
%17 = load i8*, i8** %7
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 2
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i8* @convert(i8* %7, i32 %5)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}
volatile char *copyright_notice(void) {
  return "Contains multiple-precision arithmetic code originally written by "
         "David Ireland,"
         " copyright (c) 2001-16 by D.I. Management Services Pty Limited "
         "<www.di-mgt.com.au>.";
}


x86 assembly (clang, -O0):
<copyright_notice>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyright_notice>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [164 x i8] c"Contains multiple-precision arithmetic code originally written by David Ireland, copyright (c) 2001-16 by D.I. Management Services Pty Limited <www.di-mgt.com.au>.\00"
define i8* @copyright_notice() {
ret i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [164 x i8] c"Contains multiple-precision arithmetic code originally written by David Ireland, copyright (c) 2001-16 by D.I. Management Services Pty Limited <www.di-mgt.com.au>.\00"
define i8* @copyright_notice() {
ret i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
unsigned int stb_randLCG_explicit(unsigned int seed) {
  return seed * 2147001325 + 715136305;
}


x86 assembly (clang, -O0):
<stb_randLCG_explicit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x7ff8a3ed,-0x4(%rbp),%eax
add    $0x2aa01d31,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_randLCG_explicit>:
imul   $0x7ff8a3ed,%edi,%eax
add    $0x2aa01d31,%eax
ret

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

LLVM IR (-O2):
define i32 @stb_randLCG_explicit(i32 %0) {
%2 = mul i32 %0, 2147001325
%3 = add i32 %2, 715136305
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ out_byte(int, int);
void init_8259A() {
  out_byte(0x20, 0x11);
  out_byte(0xA0, 0x11);
  out_byte(0x21, 0x20);
  out_byte(0xA1, 0x28);
  out_byte(0x21, 0x4);
  out_byte(0xA1, 0x2);
  out_byte(0x21, 0x1);
  out_byte(0xA1, 0x1);
  out_byte(0x21, 0xFE);
  out_byte(0xA1, 0xFF);
}


x86 assembly (clang, -O0):
<init_8259A>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <out_byte@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0xfe,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1030 <out_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_8259A>:
push   %rax
mov    $0x20,%edi
mov    $0x11,%esi
call   1030 <out_byte@plt>
mov    $0xa0,%edi
mov    $0x11,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x20,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x28,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x4,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x2,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0x1,%esi
call   1030 <out_byte@plt>
mov    $0x21,%edi
mov    $0xfe,%esi
call   1030 <out_byte@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
pop    %rax
jmp    1030 <out_byte@plt>

LLVM IR (-O0):
define void @init_8259A() {
%1 = call i32 @out_byte(i32 32, i32 17)
%2 = call i32 @out_byte(i32 160, i32 17)
%3 = call i32 @out_byte(i32 33, i32 32)
%4 = call i32 @out_byte(i32 161, i32 40)
%5 = call i32 @out_byte(i32 33, i32 4)
%6 = call i32 @out_byte(i32 161, i32 2)
%7 = call i32 @out_byte(i32 33, i32 1)
%8 = call i32 @out_byte(i32 161, i32 1)
%9 = call i32 @out_byte(i32 33, i32 254)
%10 = call i32 @out_byte(i32 161, i32 255)
ret void
}

LLVM IR (-O2):
define void @init_8259A() {
%1 = tail call i32 @out_byte(i32 32, i32 17)
%2 = tail call i32 @out_byte(i32 160, i32 17)
%3 = tail call i32 @out_byte(i32 33, i32 32)
%4 = tail call i32 @out_byte(i32 161, i32 40)
%5 = tail call i32 @out_byte(i32 33, i32 4)
%6 = tail call i32 @out_byte(i32 161, i32 2)
%7 = tail call i32 @out_byte(i32 33, i32 1)
%8 = tail call i32 @out_byte(i32 161, i32 1)
%9 = tail call i32 @out_byte(i32 33, i32 254)
%10 = tail call i32 @out_byte(i32 161, i32 255)
ret void
}