xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int stat(char *, struct stat *);
int myls_is_dir(char *filename) {
  struct stat filename_stat;
  if (stat(filename, &filename_stat) == -1) {
    return -1;
  }
  return S_ISDIR(filename_stat.st_mode);
}


x86 assembly (clang, -O0):
<myls_is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
jne    114e <myls_is_dir+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <myls_is_dir+0x39>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myls_is_dir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1137 <myls_is_dir+0x17>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @myls_is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISDIR(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @myls_is_dir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWGRP;
int S_IWUSR;
int S_IXUSR;
int /*<<< orphan*/ chmod(char *, int);
int main(int argc, char *argv[]) {
  chmod(argv[1], S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IROTH);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e83(%rip),%rax
mov    (%rax),%esi
mov    0x2e9a(%rip),%rax
or     (%rax),%esi
mov    0x2ea1(%rip),%rax
or     (%rax),%esi
mov    0x2e78(%rip),%rax
or     (%rax),%esi
mov    0x2e87(%rip),%rax
or     (%rax),%esi
mov    0x2e5e(%rip),%rax
or     (%rax),%esi
call   1030 <chmod@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea0(%rip),%rcx
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    0x2ebe(%rip),%rcx
or     (%rcx),%eax
mov    0x2e95(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea4(%rip),%rcx
or     (%rcx),%eax
mov    0x8(%rsi),%rdi
mov    0x2e77(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
call   1030 <chmod@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IXUSR = global i32 0
@S_IRGRP = global i32 0
@S_IWGRP = global i32 0
@S_IROTH = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = load i32, i32* @S_IRUSR
%10 = load i32, i32* @S_IWUSR
%11 = or i32 %9, %10
%12 = load i32, i32* @S_IXUSR
%13 = or i32 %11, %12
%14 = load i32, i32* @S_IRGRP
%15 = or i32 %13, %14
%16 = load i32, i32* @S_IWGRP
%17 = or i32 %15, %16
%18 = load i32, i32* @S_IROTH
%19 = or i32 %17, %18
%20 = call i32 @chmod(i8* %8, i32 %19)
ret i32 0
}

LLVM IR (-O2):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IXUSR = global i32 0
@S_IRGRP = global i32 0
@S_IWGRP = global i32 0
@S_IROTH = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = load i32, i32* @S_IRUSR
%6 = load i32, i32* @S_IWUSR
%7 = or i32 %6, %5
%8 = load i32, i32* @S_IXUSR
%9 = or i32 %7, %8
%10 = load i32, i32* @S_IRGRP
%11 = or i32 %9, %10
%12 = load i32, i32* @S_IWGRP
%13 = or i32 %11, %12
%14 = load i32, i32* @S_IROTH
%15 = or i32 %13, %14
%16 = tail call i32 @chmod(i8* %4, i32 %15)
ret i32 0
}
/* Variables and functions */
int getnum(char const *);
int /*<<< orphan*/ shiftright_(int);
void rolleft(const char *s) {
  int le = getnum(s);
  if (le == 0 || le == 128)
    return;
  shiftright_(128 - le);
}


x86 assembly (clang, -O0):
<rolleft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getnum@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114f <rolleft+0x2f>
cmpl   $0x80,-0xc(%rbp)
jne    1154 <rolleft+0x34>
jmp    1161 <rolleft+0x41>
mov    $0x80,%edi
sub    -0xc(%rbp),%edi
call   1040 <shiftright_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rolleft>:
push   %rax
call   1030 <getnum@plt>
test   $0xffffff7f,%eax
je     113a <rolleft+0x1a>
mov    $0x80,%edi
sub    %eax,%edi
pop    %rax
jmp    1040 <shiftright_@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @rolleft(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @getnum(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 128
br i1 %10, label %11, label %12
11: ; preds = %8, %1
br label %16
12: ; preds = %8
%13 = load i32, i32* %3
%14 = sub nsw i32 128, %13
%15 = call i32 @shiftright_(i32 %14)
br label %16
16: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @rolleft(i8* %0) {
%2 = tail call i32 @getnum(i8* %0)
%3 = and i32 %2, -129
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = sub nsw i32 128, %2
%7 = tail call i32 @shiftright_(i32 %6)
br label %8
8: ; preds = %1, %5
ret void
}
float dfunction_bipolar(float fx) {
  if (fx >= 1 || fx <= -1)
    return 0;
  return 0.5 * (1 + fx) * (1 - fx);
}


x86 assembly (clang, -O0):
<dfunction_bipolar>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
jae    1131 <dfunction_bipolar+0x31>
movss  0xedd(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     113e <dfunction_bipolar+0x3e>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1179 <dfunction_bipolar+0x79>
movss  0xeba(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  0xe9d(%rip),%xmm1
subss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfunction_bipolar>:
ucomiss 0xef9(%rip),%xmm0
xorps  %xmm1,%xmm1
jae    114a <dfunction_bipolar+0x4a>
movss  0xef0(%rip),%xmm2
ucomiss %xmm0,%xmm2
jae    114a <dfunction_bipolar+0x4a>
movss  0xedf(%rip),%xmm1
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  0xed4(%rip),%xmm2
subss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  %xmm2,%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @dfunction_bipolar(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 1.000000e+00
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load float, float* %3
%8 = fcmp ole float %7, -1.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store float 0.000000e+00, float* %2
br label %20
10: ; preds = %6
%11 = load float, float* %3
%12 = fadd float 1.000000e+00, %11
%13 = fpext float %12 to double
%14 = fmul double 5.000000e-01, %13
%15 = load float, float* %3
%16 = fsub float 1.000000e+00, %15
%17 = fpext float %16 to double
%18 = fmul double %14, %17
%19 = fptrunc double %18 to float
store float %19, float* %2
br label %20
20: ; preds = %10, %9
%21 = load float, float* %2
ret float %21
}

LLVM IR (-O2):
define float @dfunction_bipolar(float %0) {
%2 = fcmp oge float %0, 1.000000e+00
%3 = fcmp ole float %0, -1.000000e+00
%4 = or i1 %2, %3
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = fadd float %0, 1.000000e+00
%7 = fpext float %6 to double
%8 = fmul double %7, 5.000000e-01
%9 = fsub float 1.000000e+00, %0
%10 = fpext float %9 to double
%11 = fmul double %8, %10
%12 = fptrunc double %11 to float
br label %13
13: ; preds = %1, %5
%14 = phi float [ %12, %5 ], [ 0.000000e+00, %1 ]
ret float %14
}
void calc_thick(double a, double h, double k, double t1, double t2, double *x) {
  *x = k * a * (t2 - t1) / h;
}


x86 assembly (clang, -O0):
<calc_thick>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
mov    %rdi,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_thick>:
mulsd  %xmm2,%xmm0
subsd  %xmm3,%xmm4
mulsd  %xmm0,%xmm4
divsd  %xmm1,%xmm4
movsd  %xmm4,(%rdi)
ret

LLVM IR (-O0):
define void @calc_thick(double %0, double %1, double %2, double %3, double %4, double* %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double*
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double* %5, double** %12
%13 = load double, double* %9
%14 = load double, double* %7
%15 = fmul double %13, %14
%16 = load double, double* %11
%17 = load double, double* %10
%18 = fsub double %16, %17
%19 = fmul double %15, %18
%20 = load double, double* %8
%21 = fdiv double %19, %20
%22 = load double*, double** %12
store double %21, double* %22
ret void
}

LLVM IR (-O2):
define void @calc_thick(double %0, double %1, double %2, double %3, double %4, double* nocapture writeonly %5) {
%7 = fmul double %0, %2
%8 = fsub double %4, %3
%9 = fmul double %7, %8
%10 = fdiv double %9, %1
store double %10, double* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *run2(void *arg) {
  printf("this is thread 2\n");
  printf("Freedom is nothing but a chance to be better\n");
  printf("thread 2 exits\n");
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<run2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"this is thread 2\0A\00"
@.str.1 = [46 x i8] c"Freedom is nothing but a chance to be better\0A\00"
@.str.2 = [16 x i8] c"thread 2 exits\0A\00"
define i8* @run2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @pthread_exit(i32* null)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@str = [17 x i8] c"this is thread 2\00"
@str.3 = [45 x i8] c"Freedom is nothing but a chance to be better\00"
@str.4 = [15 x i8] c"thread 2 exits\00"
define noalias i8* @run2(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
char *RCSid() {
  return RCSid("$Id: bitmap.c,v 1.26 2008/11/15 19:38:54 sfeam Exp $");
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"$Id: bitmap.c,v 1.26 2008/11/15 19:38:54 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
int _IsPowerOfTwo(unsigned int x) { return (x != 0) && !(x & (x - 1)); }


x86 assembly (clang, -O0):
<_IsPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112c <_IsPowerOfTwo+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_IsPowerOfTwo>:
test   %edi,%edi
je     110f <_IsPowerOfTwo+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_IsPowerOfTwo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @_IsPowerOfTwo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
double celsius(int tempf) {
  double tempc = 0;
  tempc = (5 * (tempf - 32)) / 9.0;
  return tempc;
}


x86 assembly (clang, -O0):
<celsius>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
imul   $0x5,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  0xedc(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius>:
lea    (%rdi,%rdi,4),%eax
add    $0xffffff60,%eax
cvtsi2sd %eax,%xmm0
divsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @celsius(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
store double 0.000000e+00, double* %3
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 32
%6 = mul nsw i32 5, %5
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 9.000000e+00
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @celsius(i32 %0) {
%2 = mul i32 %0, 5
%3 = add i32 %2, -160
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 9.000000e+00
ret double %5
}
unsigned gcd(unsigned a, unsigned b) { return (b == 0) ? a : gcd(b, a % b); }


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <gcd+0x23>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1148 <gcd+0x38>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = urem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ __u32;
typedef scalar_t__ __le32;

/* Variables and functions */
int /*<<< orphan*/ le32toh(int /*<<< orphan*/);
uint32_t le32_to_cpu(__le32 x) { return le32toh((__u32)x); }


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

x86 assembly (clang, -O2):
<le32_to_cpu>:
jmp    1030 <le32toh@plt>

LLVM IR (-O0):
define i32 @le32_to_cpu(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @le32toh(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @le32_to_cpu(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @le32toh(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ A();
int main() {
  A();
  A();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @A()
%2 = tail call i32 (...) @A()
ret i32 0
}
/* Variables and functions */
char *deciphering(char *, char *, int);
scalar_t__ strcmp(char *, char *);
int accept(char *a) {
  char *c, pass[20];
  c = deciphering("passwd", pass, 555);
  if (strcmp(a, c)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x22b,%edx
call   1040 <deciphering@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1168 <accept+0x48>
movl   $0x0,-0x4(%rbp)
jmp    116f <accept+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
mov    %rsp,%rsi
mov    $0x22b,%edx
call   1040 <deciphering@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"passwd\00"
define i32 @accept(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [20 x i8]
store i8* %0, i8** %3
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = call i8* @deciphering(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6, i32 555)
store i8* %7, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i64 @strcmp(i8* %8, i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 0, i32* %2
br label %14
13: ; preds = %1
store i32 1, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [7 x i8] c"passwd\00"
define i32 @accept(i8* %0) {
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i8* @deciphering(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3, i32 555)
%5 = call i64 @strcmp(i8* %0, i8* %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void error(char *name) { exit(1); }


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

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

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

LLVM IR (-O2):
define void @error(i8* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
size_t strlen(const char *pString) {
  unsigned int length = 0;
  while (*pString++ != 0) {
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <strlen+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111e <strlen+0x1e>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
mov    %eax,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = zext i32 %8 to i64
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ 0, %1 ], [ %12, %11 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void multipla_1(int number) {
  if (number == 0)
    printf("fim\n");
  else {
    printf("%d\n", number);
    multipla_1(number - 1);
    multipla_1(number - 1);
  }
}


x86 assembly (clang, -O0):
<multipla_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1148 <multipla_1+0x28>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116f <multipla_1+0x4f>
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <multipla_1@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <multipla_1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multipla_1>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     1169 <multipla_1+0x39>
mov    %edi,%ebx
lea    0xebf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x1(%rbx),%edi
call   1050 <multipla_1@plt>
add    $0xffffffff,%ebx
jne    1150 <multipla_1+0x20>
lea    0xe94(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"fim\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @multipla_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %14
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 1
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 1
br label %14
14: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [4 x i8] c"fim\00"
define void @multipla_1(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %5, %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ %0, %1 ]
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = add nsw i32 %6, -1
tail call void @multipla_1(i32 %8)
%9 = icmp eq i32 %8, 0
br i1 %9, label %3, label %5
}
int *f2(int **ap, int **bp) {
  int *cp, **ip, *dp;
  ap = bp;
  cp = *ap;
  ip = &cp;
  dp = *ip;
  return dp;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32* @f2(i32** %0, i32** %1) {
%3 = alloca i32**
%4 = alloca i32**
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
store i32** %0, i32*** %3
store i32** %1, i32*** %4
%8 = load i32**, i32*** %4
store i32** %8, i32*** %3
%9 = load i32**, i32*** %3
%10 = load i32*, i32** %9
store i32* %10, i32** %5
store i32** %5, i32*** %6
%11 = load i32**, i32*** %6
%12 = load i32*, i32** %11
store i32* %12, i32** %7
%13 = load i32*, i32** %7
ret i32* %13
}

LLVM IR (-O2):
define i32* @f2(i32** nocapture readnone %0, i32** nocapture %1) {
%3 = load i32*, i32** %1
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ e_exit(int);
int /*<<< orphan*/ printf(char *, int);
void WpeSignalUnknown(int sig) {
  printf("Xwpe: unexpected signal %d, exiting ...\n", sig);
  e_exit(1);
}


x86 assembly (clang, -O0):
<WpeSignalUnknown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <e_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WpeSignalUnknown>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <e_exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Xwpe: unexpected signal %d, exiting ...\0A\00"
define void @WpeSignalUnknown(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @e_exit(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Xwpe: unexpected signal %d, exiting ...\0A\00"
define void @WpeSignalUnknown(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @e_exit(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ useOfFunction();
int main() {
  printf("This is a very very very very very very very very very very very "
         "very very very long line!\n");
  useOfFunction();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [92 x i8] c"This is a very very very very very very very very very very very very very very long line!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @useOfFunction()
ret i32 0
}

LLVM IR (-O2):
@str = [91 x i8] c"This is a very very very very very very very very very very very very very very long line!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @useOfFunction()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
double floor(double);
int /*<<< orphan*/ isfinite(double);
double az_mod2pi_nonneg(double theta) {
  assert(isfinite(theta));
  return theta - 6.2831853071795862 * floor(theta / 6.2831853071795862);
}


x86 assembly (clang, -O0):
<az_mod2pi_nonneg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <isfinite@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea3(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <floor@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xe85(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<az_mod2pi_nonneg>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <isfinite@plt>
mov    %eax,%edi
call   1030 <assert@plt>
movsd  (%rsp),%xmm0
divsd  0xeb1(%rip),%xmm0
call   1050 <floor@plt>
mulsd  0xeac(%rip),%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @az_mod2pi_nonneg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @isfinite(double %3)
%5 = call i32 @assert(i32 %4)
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fdiv double %7, 0x401921FB54442D18
%9 = call double @llvm.floor.f64(double %8)
%10 = call double @llvm.fmuladd.f64(double 0xC01921FB54442D18, double %9, double %6)
ret double %10
}

LLVM IR (-O2):
define double @az_mod2pi_nonneg(double %0) {
%2 = tail call i32 @isfinite(double %0)
%3 = tail call i32 @assert(i32 %2)
%4 = fdiv double %0, 0x401921FB54442D18
%5 = tail call double @llvm.floor.f64(double %4)
%6 = tail call double @llvm.fmuladd.f64(double %5, double 0xC01921FB54442D18, double %0)
ret double %6
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
int get_file_size(char *filename) {
  struct stat st;
  stat(filename, &st);
  return st.st_size;
}


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

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_file_size(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_file_size(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
void ExttPeriodAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttPeriodAuxTable() {
ret void
}
long util_expand(long i) { return i << 2; }


x86 assembly (clang, -O0):
<util_expand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_expand>:
lea    0x0(,%rdi,4),%rax
ret

LLVM IR (-O0):
define i64 @util_expand(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 2
ret i64 %4
}

LLVM IR (-O2):
define i64 @util_expand(i64 %0) {
%2 = shl i64 %0, 2
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ init_vla(int);
int main(int argc, const char **argv) {
  init_vla(23);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x17,%edi
call   1030 <init_vla@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x17,%edi
call   1030 <init_vla@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @init_vla(i32 23)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @init_vla(i32 23)
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/, struct timespec *);
int clock_gettime(clockid_t clk, struct timespec *ts) {
  return syscall((259 + 6), clk, ts);
}


x86 assembly (clang, -O0):
<clock_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x109,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_gettime>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x109,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i32 @syscall(i32 265, i32 %5, %struct.timespec* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = tail call i32 @syscall(i32 265, i32 %0, %struct.timespec* %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                   int /*<<< orphan*/);
int sched_yield() { return (int)syscall(158, 0, 0, 0); }


x86 assembly (clang, -O0):
<sched_yield>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9e,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_yield>:
mov    $0x9e,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @sched_yield() {
%1 = call i64 @syscall(i32 158, i32 0, i32 0, i32 0)
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @sched_yield() {
%1 = tail call i64 @syscall(i32 158, i32 0, i32 0, i32 0)
%2 = trunc i64 %1 to i32
ret i32 %2
}
int test_imm_39int64_midword_reg(long long val) {
  return ((val >> 16) & (0x39 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_39int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x39,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_39int64_midword_reg>:
test   $0x390000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_39int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 57
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_39int64_midword_reg(i64 %0) {
%2 = and i64 %0, 3735552
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int is_special(const char *s) {
  switch (s[0]) {
  case '.':
    break;
  default:
    return 0;
  }
  switch (s[1]) {
  case '\0':
    return 1;
  case '.':
    break;
  default:
    return 0;
  }
  switch (s[2]) {
  case '\0':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_special>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
sub    $0x2e,%al
jne    1120 <is_special+0x20>
jmp    111b <is_special+0x1b>
jmp    112c <is_special+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1199 <is_special+0x99>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     1155 <is_special+0x55>
jmp    1144 <is_special+0x44>
mov    -0x14(%rbp),%eax
sub    $0x2e,%eax
je     1161 <is_special+0x61>
jmp    1166 <is_special+0x66>
movl   $0x1,-0x4(%rbp)
jmp    1199 <is_special+0x99>
jmp    1172 <is_special+0x72>
movl   $0x0,-0x4(%rbp)
jmp    1199 <is_special+0x99>
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%al
test   %al,%al
jne    1192 <is_special+0x92>
jmp    1186 <is_special+0x86>
movl   $0x1,-0x4(%rbp)
jmp    1199 <is_special+0x99>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_special>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
jne    111d <is_special+0x1d>
movsbl 0x1(%rdi),%ecx
test   %ecx,%ecx
je     111e <is_special+0x1e>
cmp    $0x2e,%ecx
jne    111d <is_special+0x1d>
xor    %eax,%eax
cmpb   $0x0,0x2(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_special(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %8 [
i32 0, label %14
i32 46, label %9
]
8: ; preds = %4
br label %14
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %9, %4, %1, %8
%15 = phi i32 [ 0, %8 ], [ 0, %1 ], [ 1, %4 ], [ %13, %9 ]
ret i32 %15
}
char *reallo(p, n)
register char *p;
{
  if (!(p = realloc(p, (unsigned)n)))
    doabort("malloc : out of memory\n");
  return (p);
}


x86 assembly (clang, -O0):
<reallo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1159 <reallo+0x39>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <doabort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallo>:
push   %rbx
mov    %esi,%esi
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113e <reallo+0x1e>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <doabort@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"malloc : out of memory\0A\00"
define i8* @reallo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = call i8* @realloc(i8* %5, i64 %7)
store i8* %8, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @doabort to i32 (i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [24 x i8] c"malloc : out of memory\0A\00"
define i8* @reallo(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = tail call i8* @realloc(i8* %0, i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @doabort to i32 (i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i8* %4
}
emit1or2(n) {
  if (n & ~0xFF)
    emit1(n >> 8);
  emit1(n);
}


x86 assembly (clang, -O0):
<emit1or2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffffff00,%eax
cmp    $0x0,%eax
je     1139 <emit1or2+0x29>
mov    -0x8(%rbp),%edi
sar    $0x8,%edi
mov    $0x0,%al
call   1030 <emit1@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <emit1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit1or2>:
push   %rbx
mov    %edi,%ebx
cmp    $0x100,%edi
jb     1127 <emit1or2+0x17>
mov    %ebx,%edi
sar    $0x8,%edi
xor    %eax,%eax
call   1030 <emit1@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <emit1@plt>

LLVM IR (-O0):
define i32 @emit1or2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, -256
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = ashr i32 %8, 8
%10 = call i32 (i32, ...) bitcast (i32 (...)* @emit1 to i32 (i32, ...)*)(i32 %9)
br label %11
11: ; preds = %7, %1
%12 = load i32, i32* %3
%13 = call i32 (i32, ...) bitcast (i32 (...)* @emit1 to i32 (i32, ...)*)(i32 %12)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @emit1or2(i32 %0) {
%2 = icmp ult i32 %0, 256
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = ashr i32 %0, 8
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @emit1 to i32 (i32, ...)*)(i32 %4)
br label %6
6: ; preds = %3, %1
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @emit1 to i32 (i32, ...)*)(i32 %0)
ret i32 undef
}
int main() { return 0UL < 1UL; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int fabs(double);
int AproxEqual(double a, double b) {
  if (fabs(a - b) < 1e-6)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AproxEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xec3(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1153 <AproxEqual+0x43>
movl   $0x1,-0x4(%rbp)
jmp    115a <AproxEqual+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AproxEqual>:
push   %rax
subsd  %xmm1,%xmm0
call   1030 <fabs@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @AproxEqual(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fsub double %6, %7
%9 = call i32 @fabs(double %8)
%10 = sitofp i32 %9 to double
%11 = fcmp olt double %10, 0x3EB0C6F7A0B5ED8D
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @AproxEqual(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call i32 @fabs(double %3)
%5 = icmp slt i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
void rop3_153_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = *D ^ S;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_153_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_153_0_0>:
xor    (%rdi),%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_153_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8, i8* %7
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %7
%19 = load i8, i8* %7
%20 = load i8*, i8** %4
store i8 %19, i8* %20
ret void
}

LLVM IR (-O2):
define void @rop3_153_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = xor i8 %5, -1
store i8 %6, i8* %0
ret void
}