xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/,
                                           int /*<<< orphan*/);
int /*<<< orphan*/ fminl(long double, long double);
void test_macro(long double xl) { __emit_expression_range(0, fminl(xl, xl)); }


x86 assembly (clang, -O0):
<test_macro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
mov    %rsp,%rax
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fminl@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1040 <__emit_expression_range@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_macro>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <fminl@plt>
xor    %edi,%edi
mov    %eax,%esi
add    $0x28,%rsp
jmp    1040 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_macro(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = call i32 @fminl(x86_fp80 %3, x86_fp80 %4)
%6 = call i32 @__emit_expression_range(i32 0, i32 %5)
ret void
}

LLVM IR (-O2):
define void @test_macro(x86_fp80 %0) {
%2 = tail call i32 @fminl(x86_fp80 %0, x86_fp80 %0)
%3 = tail call i32 @__emit_expression_range(i32 0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int recv(int, char *, int, int /*<<< orphan*/);
int zkp_recv(int sockfd, char *dest) {
  int numbytes;
  if ((numbytes = recv(sockfd, dest, 1024 - 1, 0)) == -1) {
    perror("recv");
    return (0);
  }
  dest[numbytes] = '\0';
  return (1);
}


x86 assembly (clang, -O0):
<zkp_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x3ff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1166 <zkp_recv+0x46>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    1179 <zkp_recv+0x59>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zkp_recv>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %ebp,%ebp
mov    $0x3ff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
je     114d <zkp_recv+0x2d>
cltq
movb   $0x0,(%rbx,%rax,1)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xeac(%rip),%rdi
call   1040 <perror@plt>
jmp    1144 <zkp_recv+0x24>

LLVM IR (-O0):
@.str = [5 x i8] c"recv\00"
define i32 @zkp_recv(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = call i32 @recv(i32 %7, i8* %8, i32 1023, i32 0)
store i32 %9, i32* %6
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %18
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
store i32 1, i32* %3
br label %18
18: ; preds = %13, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [5 x i8] c"recv\00"
define i32 @zkp_recv(i32 %0, i8* %1) {
%3 = tail call i32 @recv(i32 %0, i8* %1, i32 1023, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %2
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i8, i8* %1, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ 0, %5 ], [ 1, %7 ]
ret i32 %11
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XKeymapEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XKeymapEvent_display(void *_p, void *_v) {
  ((XKeymapEvent *)_p)->display = (Display *)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XKeymapEvent_display(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XKeymapEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func0() { printf("func0\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"func0\0A\00"
define void @func0() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"func0\00"
define void @func0() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int msgcnterr();
int sgmlgcnterr() { return msgcnterr(); }


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

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

LLVM IR (-O0):
define i32 @sgmlgcnterr() {
%1 = call i32 (...) @msgcnterr()
ret i32 %1
}

LLVM IR (-O2):
define i32 @sgmlgcnterr() {
%1 = tail call i32 (...) @msgcnterr()
ret i32 %1
}
int itrunc(double f) {
  int i;
  i = (int)f;
  if (i < 0)
    i = 0;
  if (i > 255)
    i = 255;
  return i;
}


x86 assembly (clang, -O0):
<itrunc>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1122 <itrunc+0x22>
movl   $0x0,-0xc(%rbp)
cmpl   $0xff,-0xc(%rbp)
jle    1136 <itrunc+0x36>
movl   $0xff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itrunc>:
cvttsd2si %xmm0,%eax
xor    %ecx,%ecx
test   %eax,%eax
cmovns %eax,%ecx
cmp    $0xff,%ecx
mov    $0xff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @itrunc(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %3
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 255
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 255, i32* %3
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @itrunc(double %0) {
%2 = fptosi double %0 to i32
%3 = icmp sgt i32 %2, 0
%4 = select i1 %3, i32 %2, i32 0
%5 = icmp ult i32 %4, 255
%6 = select i1 %5, i32 %4, i32 255
ret i32 %6
}
void _llnull(void) {
  _llnull();
  return;
}


x86 assembly (clang, -O0):
<_llnull>:
push   %rbp
mov    %rsp,%rbp
call   1030 <_llnull@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_llnull>:
jmp    1100 <_llnull>

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

LLVM IR (-O2):
define void @_llnull() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
char *fflagstostr(unsigned long);
int /*<<< orphan*/ free(char *);
char *xfflagstostr(unsigned long fflags) {
  static char *str = NULL;
  if (str != NULL)
    free(str);
  str = fflagstostr(fflags);
  if (str == NULL)
    err(1, "fflagstostr");
  return (str);
}


x86 assembly (clang, -O0):
<xfflagstostr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,0x2efc(%rip)
je     1156 <xfflagstostr+0x26>
mov    0x2eef(%rip),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflagstostr@plt>
mov    %rax,0x2eda(%rip)
cmpq   $0x0,0x2ed2(%rip)
jne    1185 <xfflagstostr+0x55>
mov    $0x1,%edi
lea    0xe80(%rip),%rsi
call   1050 <err@plt>
mov    0x2eb4(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfflagstostr>:
push   %rbx
mov    %rdi,%rbx
mov    0x2f05(%rip),%rdi
test   %rdi,%rdi
je     1145 <xfflagstostr+0x15>
call   1030 <free@plt>
mov    %rbx,%rdi
call   1040 <fflagstostr@plt>
mov    %rax,0x2eec(%rip)
test   %rax,%rax
je     115b <xfflagstostr+0x2b>
pop    %rbx
ret
lea    0xe9e(%rip),%rsi
mov    $0x1,%edi
call   1050 <err@plt>
mov    0x2ecd(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@xfflagstostr.str = internal global i8* null
@.str = [12 x i8] c"fflagstostr\00"
define i8* @xfflagstostr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i8*, i8** @xfflagstostr.str
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** @xfflagstostr.str
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
%9 = load i64, i64* %2
%10 = call i8* @fflagstostr(i64 %9)
store i8* %10, i8** @xfflagstostr.str
%11 = load i8*, i8** @xfflagstostr.str
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 @err(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
%16 = load i8*, i8** @xfflagstostr.str
ret i8* %16
}

LLVM IR (-O2):
@xfflagstostr.str = internal unnamed_addr global i8* null
@.str = [12 x i8] c"fflagstostr\00"
define i8* @xfflagstostr(i64 %0) {
%2 = load i8*, i8** @xfflagstostr.str
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
br label %6
6: ; preds = %4, %1
%7 = tail call i8* @fflagstostr(i64 %0)
store i8* %7, i8** @xfflagstostr.str
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** @xfflagstostr.str
br label %12
12: ; preds = %9, %6
%13 = phi i8* [ %11, %9 ], [ %7, %6 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bigOrSmallEndian() {
  int test_int = 1;
  printf("byte order: ");
  if (*(char *)&test_int == 1)
    printf("little-endian\n\n");
  else
    printf("big-endian\n\n");
}


x86 assembly (clang, -O0):
<bigOrSmallEndian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x4(%rbp),%eax
cmp    $0x1,%eax
jne    1149 <bigOrSmallEndian+0x39>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
jmp    1155 <bigOrSmallEndian+0x45>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigOrSmallEndian>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"byte order: \00"
@.str.1 = [16 x i8] c"little-endian\0A\0A\00"
@.str.2 = [13 x i8] c"big-endian\0A\0A\00"
define void @bigOrSmallEndian() {
%1 = alloca i32
store i32 1, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"byte order: \00"
@str = [15 x i8] c"little-endian\0A\00"
define void @bigOrSmallEndian() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vt_write_str(char *);
void vt_reset(void) {
  vt_write_str("\x1B"
               "c");
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"\1Bc\00"
define void @vt_reset() {
%1 = call i32 @vt_write_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1Bc\00"
define void @vt_reset() {
%1 = tail call i32 @vt_write_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double _sincos(double, double, int, int /*<<< orphan*/);
double sin(double x) {
  if (x < 0.0)
    return _sincos(-x, -x, -1, 0);
  else
    return _sincos(x, x, 1, 0);
}


x86 assembly (clang, -O0):
<sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1179 <sin+0x69>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <_sincos@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1194 <sin+0x84>
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <_sincos@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin>:
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1132 <sin+0x22>
xorpd  0xede(%rip),%xmm0
movapd %xmm0,%xmm1
mov    $0xffffffff,%edi
xor    %esi,%esi
jmp    1030 <_sincos@plt>
movapd %xmm0,%xmm1
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <_sincos@plt>

LLVM IR (-O0):
define double @sin(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
%9 = load double, double* %3
%10 = fneg double %9
%11 = call double @_sincos(double %8, double %10, i32 -1, i32 0)
store double %11, double* %2
br label %16
12: ; preds = %1
%13 = load double, double* %3
%14 = load double, double* %3
%15 = call double @_sincos(double %13, double %14, i32 1, i32 0)
store double %15, double* %2
br label %16
16: ; preds = %12, %6
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @sin(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fneg double %0
%5 = tail call double @_sincos(double %4, double %4, i32 -1, i32 0)
br label %8
6: ; preds = %1
%7 = tail call double @_sincos(double %0, double %0, i32 1, i32 0)
br label %8
8: ; preds = %6, %3
%9 = phi double [ %5, %3 ], [ %7, %6 ]
ret double %9
}
/* Variables and functions */
int RandomInteger(int, int);
int RollDie(void) { return (RandomInteger(1, 6)); }


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

x86 assembly (clang, -O2):
<RollDie>:
mov    $0x1,%edi
mov    $0x6,%esi
jmp    1030 <RandomInteger@plt>

LLVM IR (-O0):
define i32 @RollDie() {
%1 = call i32 @RandomInteger(i32 1, i32 6)
ret i32 %1
}

LLVM IR (-O2):
define i32 @RollDie() {
%1 = tail call i32 @RandomInteger(i32 1, i32 6)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set_int64(int /*<<< orphan*/, int /*<<< orphan*/);
void mpz_mul_int64(mpz_t z, int64_t x) {
  mpz_t aux;
  mpz_init(aux);
  mpz_set_int64(aux, x);
  mpz_mul(z, z, aux);
  mpz_clear(aux);
}


x86 assembly (clang, -O0):
<mpz_mul_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <mpz_init@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <mpz_set_int64@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1050 <mpz_mul@plt>
mov    -0xc(%rbp),%edi
call   1060 <mpz_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpz_mul_int64>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <mpz_init@plt>
mov    %ebx,%esi
call   1030 <mpz_set_int64@plt>
mov    %ebp,%edi
mov    %ebp,%esi
call   1050 <mpz_mul@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <mpz_clear@plt>

LLVM IR (-O0):
define void @mpz_mul_int64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %5
%7 = call i32 @mpz_init(i32 %6)
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @mpz_set_int64(i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = call i32 @mpz_mul(i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %5
%16 = call i32 @mpz_clear(i32 %15)
ret void
}

LLVM IR (-O2):
define void @mpz_mul_int64(i32 %0, i32 %1) {
%3 = tail call i32 @mpz_init(i32 undef)
%4 = tail call i32 @mpz_set_int64(i32 undef, i32 %1)
%5 = tail call i32 @mpz_mul(i32 %0, i32 %0, i32 undef)
%6 = tail call i32 @mpz_clear(i32 undef)
ret void
}
unsigned char ft_ech_check(const char c) {
  return (c == 'e' || c == 'E' || c == 'n');
}


x86 assembly (clang, -O0):
<ft_ech_check>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x65,%ecx
mov    %al,-0x2(%rbp)
je     113b <ft_ech_check+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x45,%ecx
mov    %al,-0x2(%rbp)
je     113b <ft_ech_check+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x6e,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_ech_check>:
mov    %edi,%eax
and    $0xdf,%al
cmp    $0x45,%al
sete   %cl
cmp    $0x6e,%dil
sete   %al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @ft_ech_check(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 101
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 69
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 110
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @ft_ech_check(i8 signext %0) {
%2 = and i8 %0, -33
%3 = icmp eq i8 %2, 69
%4 = icmp eq i8 %0, 110
%5 = or i1 %4, %3
%6 = zext i1 %5 to i8
ret i8 %6
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn22() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn22");
  return result;
}


x86 assembly (clang, -O0):
<fn22>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn22>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn22\00"
define i8* @fn22() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn22\00"
define i8* @fn22() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
cmd_perform(cmd, confirm_string) char *cmd, *confirm_string;
{
  (cmd);
  if (!confirm_string)
    confirm_string = "";
  queue_mudline(cmd, confirm_string);
}


x86 assembly (clang, -O0):
<cmd_perform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1136 <cmd_perform+0x26>
lea    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <queue_mudline@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_perform>:
test   %rsi,%rsi
lea    0xee6(%rip),%rax
cmove  %rax,%rsi
xor    %eax,%eax
jmp    1030 <queue_mudline@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @cmd_perform(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %5
br label %10
10: ; preds = %9, %2
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @queue_mudline to i32 (i8*, i8*, ...)*)(i8* %11, i8* %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @cmd_perform(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1
%5 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @queue_mudline to i32 (i8*, i8*, ...)*)(i8* %0, i8* %4)
ret i32 undef
}
int do_678() { return 678; }


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

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

LLVM IR (-O0):
define i32 @do_678() {
ret i32 678
}

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

/* Variables and functions */
int feof(int /*<<< orphan*/ *);
int pc_eofsrc(void *handle) { return feof((FILE *)handle); }


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

x86 assembly (clang, -O2):
<pc_eofsrc>:
jmp    1030 <feof@plt>

LLVM IR (-O0):
define i32 @pc_eofsrc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @feof(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @pc_eofsrc(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @feof(i32* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char s[] = "Gabriele is smth";
  printf("%s %s\n", s, &s[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%al
mov    %al,-0x10(%rbp)
lea    -0x20(%rbp),%rsi
lea    -0x20(%rbp),%rdx
add    $0x2,%rdx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
lea    0x2(%rsp),%rdx
lea    0xee1(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [17 x i8] c"Gabriele is smth\00"
@.str = [7 x i8] c"%s %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [17 x i8]
store i32 0, i32* %1
%3 = bitcast [17 x i8]* %2 to i8*
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 2
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [17 x i8] c"Gabriele is smth\00"
@.str = [7 x i8] c"%s %s\0A\00"
define i32 @main() {
%1 = alloca [17 x i8]
%2 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %1, i64 0, i64 2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3)
ret i32 0
}
/* Variables and functions */
char *read_binary_string(char **, scalar_t__, char const *);
scalar_t__ strlen(char *);
char *read_string(char **from, const char *max) {
  return read_binary_string(from, strlen(*from) + 1, max);
}


x86 assembly (clang, -O0):
<read_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
mov    -0x10(%rbp),%rdx
call   1030 <read_binary_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <read_binary_string@plt>

LLVM IR (-O0):
define i8* @read_string(i8** %0, i8* %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*** %3
%7 = load i8*, i8** %6
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = load i8*, i8** %4
%11 = call i8* @read_binary_string(i8** %5, i64 %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @read_string(i8** %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @read_binary_string(i8** %0, i64 %5, i8* %1)
ret i8* %6
}
/* Variables and functions */
scalar_t__ opaquePropertyCheck(void *);
int *dynCastOrNull(void *ptr) {
  if (!ptr)
    return 0;
  if (opaquePropertyCheck(ptr))
    return (int *)ptr;
  return 0;
}


x86 assembly (clang, -O0):
<dynCastOrNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <dynCastOrNull+0x24>
movq   $0x0,-0x8(%rbp)
jmp    115c <dynCastOrNull+0x4c>
mov    -0x10(%rbp),%rdi
call   1030 <opaquePropertyCheck@plt>
cmp    $0x0,%rax
je     1154 <dynCastOrNull+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115c <dynCastOrNull+0x4c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynCastOrNull>:
push   %rbx
test   %rdi,%rdi
je     1127 <dynCastOrNull+0x17>
mov    %rdi,%rbx
call   1030 <opaquePropertyCheck@plt>
test   %rax,%rax
cmove  %rax,%rbx
jmp    1129 <dynCastOrNull+0x19>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @dynCastOrNull(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @opaquePropertyCheck(i8* %0)
%5 = icmp eq i64 %4, 0
%6 = bitcast i8* %0 to i32*
%7 = select i1 %5, i32* null, i32* %6
br label %8
8: ; preds = %3, %1
%9 = phi i32* [ null, %1 ], [ %7, %3 ]
ret i32* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *fun(void *s) { printf("run function\n"); }


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"run function\0A\00"
define i8* @fun(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
@str = [13 x i8] c"run function\00"
define noalias i8* @fun(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i8* undef
}
int binToDecimal(int num) {
  int total = 0;
  int multiplier = 1;
  int remainder;
  while (num > 0) {
    remainder = num % 10;
    num /= 10;
    total += remainder * multiplier;
    multiplier *= 2;
  }
  return total;
}


x86 assembly (clang, -O0):
<binToDecimal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1156 <binToDecimal+0x56>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <binToDecimal+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binToDecimal>:
xor    %eax,%eax
test   %edi,%edi
jle    1144 <binToDecimal+0x44>
mov    $0x1,%ecx
mov    $0xcccccccd,%r8d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %edi,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%edx
lea    (%rdx,%rdx,4),%r9d
mov    %edi,%edx
sub    %r9d,%edx
imul   %ecx,%edx
add    %edx,%eax
add    %ecx,%ecx
cmp    $0x9,%edi
mov    %esi,%edi
ja     1120 <binToDecimal+0x20>
ret

LLVM IR (-O0):
define i32 @binToDecimal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
br label %6
6: ; preds = %9, %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
store i32 %11, i32* %5
%12 = load i32, i32* %2
%13 = sdiv i32 %12, 10
store i32 %13, i32* %2
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %3
%18 = add nsw i32 %17, %16
store i32 %18, i32* %3
%19 = load i32, i32* %4
%20 = mul nsw i32 %19, 2
store i32 %20, i32* %4
br label %6
21: ; preds = %6
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @binToDecimal(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %11, %3 ], [ 1, %1 ]
%6 = phi i32 [ %10, %3 ], [ 0, %1 ]
%7 = urem i32 %4, 10
%8 = udiv i32 %4, 10
%9 = mul nsw i32 %7, %5
%10 = add nsw i32 %9, %6
%11 = shl nsw i32 %5, 1
%12 = icmp ult i32 %4, 10
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %14
}
int test15(int fd, __attribute__((__unused__)) int argc,
           const __attribute__((__unused__)) char **argv) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @test15(i32 %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @test15(i32 %0, i32 %1, i8** nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int softc_private_registered_storage_driver_count();
int softc_storage_driver_count() {
  return softc_private_registered_storage_driver_count();
}


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

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

LLVM IR (-O0):
define i32 @softc_storage_driver_count() {
%1 = call i32 (...) @softc_private_registered_storage_driver_count()
ret i32 %1
}

LLVM IR (-O2):
define i32 @softc_storage_driver_count() {
%1 = tail call i32 (...) @softc_private_registered_storage_driver_count()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int a = 0;
  while (1) {
    printf("%d\n", a);
    a = a + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1120 <main+0x10>

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 0, i32* %2
br label %3
3: ; preds = %0, %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
br label %3
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(int);
void uart_puts_ln(void) {
  uart_putc(0x0D);
  uart_putc(0x0A);
}


x86 assembly (clang, -O0):
<uart_puts_ln>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%edi
call   1030 <uart_putc@plt>
mov    $0xa,%edi
call   1030 <uart_putc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_puts_ln>:
push   %rax
mov    $0xd,%edi
call   1030 <uart_putc@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <uart_putc@plt>

LLVM IR (-O0):
define void @uart_puts_ln() {
%1 = call i32 @uart_putc(i32 13)
%2 = call i32 @uart_putc(i32 10)
ret void
}

LLVM IR (-O2):
define void @uart_puts_ln() {
%1 = tail call i32 @uart_putc(i32 13)
%2 = tail call i32 @uart_putc(i32 10)
ret void
}
/* Variables and functions */
int fInline(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 7;
  int b = 42;
  int c = fInline(a, b);
  printf("%d\n", c);
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 7, i32* %1
store i32 42, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @fInline(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%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 @fInline(i32 7, i32 42)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
long time(int /*<<< orphan*/);
long xtime_epoch() { return time(0); }


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

x86 assembly (clang, -O2):
<xtime_epoch>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define i64 @xtime_epoch() {
%1 = call i64 @time(i32 0)
ret i64 %1
}

LLVM IR (-O2):
define i64 @xtime_epoch() {
%1 = tail call i64 @time(i32 0)
ret i64 %1
}
int linearSearch(int n, int *A, int key) {
  for (int i = 0; i < n; i++) {
    if (A[i] == key) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<linearSearch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1153 <linearSearch+0x53>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    1140 <linearSearch+0x40>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <linearSearch+0x5a>
jmp    1145 <linearSearch+0x45>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <linearSearch+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearSearch>:
mov    $0xffffffff,%eax
test   %edi,%edi
jle    111e <linearSearch+0x1e>
mov    %edi,%edi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rsi,%rcx,4)
je     111f <linearSearch+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rdi
jne    1110 <linearSearch+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @linearSearch(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
void XSetRegion() {}


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

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

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

LLVM IR (-O2):
define void @XSetRegion() {
ret void
}
int isdigit(int c) { return '0' <= c && c <= '9'; }


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x30,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <isdigit+0x24>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 48, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ io_wait();
int /*<<< orphan*/ outl(unsigned int, int);
void outl_p(unsigned int value, int port) {
  outl(value, port);
  io_wait();
}


x86 assembly (clang, -O0):
<outl_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <outl@plt>
mov    $0x0,%al
call   1040 <io_wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outl_p>:
push   %rax
call   1030 <outl@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <io_wait@plt>

LLVM IR (-O0):
define void @outl_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 = load i32, i32* %4
%7 = call i32 @outl(i32 %5, i32 %6)
%8 = call i32 (...) @io_wait()
ret void
}

LLVM IR (-O2):
define void @outl_p(i32 %0, i32 %1) {
%3 = tail call i32 @outl(i32 %0, i32 %1)
%4 = tail call i32 (...) @io_wait()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bounce_east();
void do_west(void) { bounce_east(); }


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

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

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

LLVM IR (-O2):
define void @do_west() {
%1 = tail call i32 (...) @bounce_east()
ret void
}
void dmc_unrar_io_dummy_close_func(void *opaque) { (void)opaque; }


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

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

LLVM IR (-O0):
define void @dmc_unrar_io_dummy_close_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @dmc_unrar_io_dummy_close_func(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EOVERFLOW;
scalar_t__ LONG_MAX;
int /*<<< orphan*/ errno;
scalar_t__ ftello(int /*<<< orphan*/ *);
long ftell(FILE *file) {
  off_t offset = ftello(file);
  if (offset > LONG_MAX) {
    errno = EOVERFLOW;
    return -1;
  }
  return (long)offset;
}


x86 assembly (clang, -O0):
<ftell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ftello@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x2ea4(%rip),%rcx
cmp    (%rcx),%rax
jle    115c <ftell+0x4c>
mov    0x2eac(%rip),%rax
mov    (%rax),%ecx
mov    0x2e83(%rip),%rax
mov    %ecx,(%rax)
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1164 <ftell+0x54>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftell>:
push   %rax
call   1030 <ftello@plt>
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%rax
jle    113b <ftell+0x2b>
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
mov    0x2e9e(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
@LONG_MAX = global i64 0
@EOVERFLOW = global i32 0
@errno = global i32 0
define i64 @ftell(i32* %0) {
%2 = alloca i64
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i64 @ftello(i32* %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = load i64, i64* @LONG_MAX
%9 = icmp sgt i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* @EOVERFLOW
store i32 %11, i32* @errno
store i64 -1, i64* %2
br label %14
12: ; preds = %1
%13 = load i64, i64* %4
store i64 %13, i64* %2
br label %14
14: ; preds = %12, %10
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
@LONG_MAX = global i64 0
@EOVERFLOW = global i32 0
@errno = global i32 0
define i64 @ftell(i32* nocapture %0) {
%2 = tail call i64 @ftello(i32* %0)
%3 = load i64, i64* @LONG_MAX
%4 = icmp sgt i64 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* @EOVERFLOW
store i32 %6, i32* @errno
br label %7
7: ; preds = %1, %5
%8 = phi i64 [ -1, %5 ], [ %2, %1 ]
ret i64 %8
}