xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ MV_SetReverbDelay(int);
void FX_SetReverbDelay(int delay) { MV_SetReverbDelay(delay); }


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

x86 assembly (clang, -O2):
<FX_SetReverbDelay>:
jmp    1030 <MV_SetReverbDelay@plt>

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

LLVM IR (-O2):
define void @FX_SetReverbDelay(i32 %0) {
%2 = tail call i32 @MV_SetReverbDelay(i32 %0)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void startTimer(struct timeval *t_start) { gettimeofday(t_start, NULL); }


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

x86 assembly (clang, -O2):
<startTimer>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @startTimer(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @startTimer(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
/* Type definitions */
typedef size_t ptrdiff_t;

/* Variables and functions */
char *strcpy(char *dest, const char *src) {
  char c;
  char *s = (char *)src;
  const ptrdiff_t off = dest - s - 1;
  do {
    c = *s++;
    s[off] = c;
  } while (c != '\0');
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
jne    1127 <strcpy+0x27>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    %rdi,%rcx
sub    %rsi,%rcx
nopl   0x0(%rax)
movzbl (%rsi),%edx
mov    %dl,(%rsi,%rcx,1)
add    $0x1,%rsi
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = xor i64 %4, -1
%6 = add i64 %5, %3
br label %7
7: ; preds = %7, %2
%8 = phi i8* [ %1, %2 ], [ %9, %7 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %8
%11 = getelementptr inbounds i8, i8* %9, i64 %6
store i8 %10, i8* %11
%12 = icmp eq i8 %10, 0
br i1 %12, label %13, label %7
13: ; preds = %7
ret i8* %0
}
void pthread_mutexattr_destroy() {}


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

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

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

LLVM IR (-O2):
define void @pthread_mutexattr_destroy() {
ret void
}
void add(int x, int y, int *sum) {
  int ret = x + y;
  *sum = ret;
}


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

x86 assembly (clang, -O2):
<add>:
add    %esi,%edi
mov    %edi,(%rdx)
ret

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

LLVM IR (-O2):
define void @add(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = add nsw i32 %1, %0
store i32 %4, i32* %2
ret void
}
long reversenumber(long num) {
  long reverse = 0, temp, remainder;
  temp = num;
  while (num > 0) {
    remainder = num % 10;
    reverse = reverse * 10 + remainder;
    num /= 10;
  }
  return reverse;
}


x86 assembly (clang, -O0):
<reversenumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1159 <reversenumber+0x59>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x20(%rbp)
imul   $0xa,-0x10(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
jmp    1118 <reversenumber+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reversenumber>:
test   %rdi,%rdi
jle    114a <reversenumber+0x4a>
mov    %rdi,%rcx
xor    %eax,%eax
movabs $0xcccccccccccccccd,%r8
cc cc cc
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rax,%rax,4),%rsi
mov    %rcx,%rax
mul    %r8
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rcx,%rdi
sub    %rax,%rdi
lea    (%rdi,%rsi,2),%rax
cmp    $0x9,%rcx
mov    %rdx,%rcx
ja     1120 <reversenumber+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @reversenumber(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i64 [ %9, %3 ], [ %0, %1 ]
%5 = phi i64 [ %8, %3 ], [ 0, %1 ]
%6 = urem i64 %4, 10
%7 = mul nsw i64 %5, 10
%8 = add nsw i64 %6, %7
%9 = udiv i64 %4, 10
%10 = icmp ult i64 %4, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i64 [ 0, %1 ], [ %8, %3 ]
ret i64 %12
}
/* Variables and functions */
int maximum(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int a = 2;
  int b = 42;
  printf("maximum(%d, %d) = %d\n", a, b, maximum(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x2a,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <maximum@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [22 x i8] c"maximum(%d, %d) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @maximum(i32 2, i32 42)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 2, i32 42, i32 %1)
ret i32 0
}
int first_dma_chan(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @first_dma_chan() {
ret i32 0
}
/* Variables and functions */
double fabsf(float);
__attribute__((unused)) int eq_float(float f1, float f2) {
  return f1 == f2 || fabsf(f1 - f2) < fabsf(f1) * 1.5 / 4096.0;
}


x86 assembly (clang, -O0):
<eq_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x1,%al
ucomiss -0x8(%rbp),%xmm0
mov    %al,-0x9(%rbp)
jne    1141 <eq_float+0x31>
jp     1141 <eq_float+0x31>
jmp    1186 <eq_float+0x76>
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
call   1030 <fabsf@plt>
movsd  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabsf@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xe9c(%rip),%xmm2
mulsd  %xmm2,%xmm0
movsd  0xe88(%rip),%xmm2
divsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq_float>:
mov    $0x1,%eax
ucomiss %xmm1,%xmm0
jne    111d <eq_float+0xd>
jp     111d <eq_float+0xd>
ret
sub    $0x18,%rsp
movss  %xmm0,0xc(%rsp)
subss  %xmm1,%xmm0
call   1030 <fabsf@plt>
movsd  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <fabsf@plt>
mulsd  0xeb7(%rip),%xmm0
mulsd  0xeb7(%rip),%xmm0
xor    %eax,%eax
ucomisd 0x10(%rsp),%xmm0
seta   %al
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @eq_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oeq float %5, %6
br i1 %7, label %18, label %8
8: ; preds = %2
%9 = load float, float* %3
%10 = load float, float* %4
%11 = fsub float %9, %10
%12 = call double @fabsf(float %11)
%13 = load float, float* %3
%14 = call double @fabsf(float %13)
%15 = fmul double %14, 1.500000e+00
%16 = fdiv double %15, 4.096000e+03
%17 = fcmp olt double %12, %16
br label %18
18: ; preds = %8, %2
%19 = phi i1 [ true, %2 ], [ %17, %8 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @eq_float(float %0, float %1) {
%3 = fcmp oeq float %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = fsub float %0, %1
%6 = tail call double @fabsf(float %5)
%7 = tail call double @fabsf(float %0)
%8 = fmul double %7, 1.500000e+00
%9 = fmul double %8, 0x3F30000000000000
%10 = fcmp olt double %6, %9
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %2
%13 = phi i32 [ 1, %2 ], [ %11, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
long int strtol(const char *restrict nptr, char **restrict endptr, int base) {
  (void)nptr;
  (void)endptr;
  (void)base;
  puts("strtol: not implemented");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"strtol: not implemented\00"
define i64 @strtol(i8* noalias %0, i8** noalias %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i64 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"strtol: not implemented\00"
define i64 @strtol(i8* noalias nocapture readnone %0, i8** noalias nocapture readnone %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i64 0
}
double integ(double (*pf)(double), double a, double b) {
  double x, sum;
  for (x = a; x <= b; x += 0.00001) {
    sum += pf(x) * 0.00001;
  }
  return sum;
}


x86 assembly (clang, -O0):
<integ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1170 <integ+0x70>
mov    -0x8(%rbp),%rax
movsd  -0x20(%rbp),%xmm0
call   *%rax
movsd  -0x28(%rbp),%xmm1
movsd  0xeb4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe9f(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1120 <integ+0x20>
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integ>:
push   %rbx
sub    $0x20,%rsp
ucomisd %xmm0,%xmm1
jb     1160 <integ+0x60>
mov    %rdi,%rbx
movsd  %xmm1,0x10(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm2,0x18(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   *%rbx
movsd  0x18(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
movsd  0xeb8(%rip),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm0,%xmm2
movsd  0x8(%rsp),%xmm0
addsd  %xmm3,%xmm0
ucomisd %xmm0,%xmm1
jae    1120 <integ+0x20>
movapd %xmm2,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @integ(double (double)* %0, double %1, double %2) {
%4 = alloca double (double)*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double (double)* %0, double (double)** %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %5
store double %9, double* %7
br label %10
10: ; preds = %20, %3
%11 = load double, double* %7
%12 = load double, double* %6
%13 = fcmp ole double %11, %12
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load double (double)*, double (double)** %4
%16 = load double, double* %7
%17 = call double %15(double %16)
%18 = load double, double* %8
%19 = call double @llvm.fmuladd.f64(double %17, double 1.000000e-05, double %18)
store double %19, double* %8
br label %20
20: ; preds = %14
%21 = load double, double* %7
%22 = fadd double %21, 1.000000e-05
store double %22, double* %7
br label %10
23: ; preds = %10
%24 = load double, double* %8
ret double %24
}

LLVM IR (-O2):
define double @integ(double (double)* nocapture %0, double %1, double %2) {
%4 = fcmp ugt double %1, %2
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi double [ %9, %5 ], [ undef, %3 ]
%7 = phi double [ %10, %5 ], [ %1, %3 ]
%8 = tail call double %0(double %7)
%9 = tail call double @llvm.fmuladd.f64(double %8, double 1.000000e-05, double %6)
%10 = fadd double %7, 1.000000e-05
%11 = fcmp ugt double %10, %2
br i1 %11, label %12, label %5
12: ; preds = %5, %3
%13 = phi double [ undef, %3 ], [ %9, %5 ]
ret double %13
}
int intmin(int a, int b) { return (a < b ? a : b); }


x86 assembly (clang, -O0):
<intmin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <intmin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <intmin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intmin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @intmin(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @intmin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
size_t ZBUFFv04_recommendedDOutSize() { return (128 * (1 << 10)); }


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

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

LLVM IR (-O0):
define i64 @ZBUFFv04_recommendedDOutSize() {
ret i64 131072
}

LLVM IR (-O2):
define i64 @ZBUFFv04_recommendedDOutSize() {
ret i64 131072
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void p1_rot2(void) { printf("p1_rot2()\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"p1_rot2()\00"
define void @p1_rot2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ z_streamp;

/* Variables and functions */
int inflateInit(int /*<<< orphan*/);
int /*<<< orphan*/ initialize(int /*<<< orphan*/);
extern int ssh_hans_zlib_inflateInit(z_streamp s) {
  initialize(s);
  return inflateInit(s);
}


x86 assembly (clang, -O0):
<ssh_hans_zlib_inflateInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <initialize@plt>
mov    -0x4(%rbp),%edi
call   1040 <inflateInit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssh_hans_zlib_inflateInit>:
push   %rbx
mov    %edi,%ebx
call   1030 <initialize@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <inflateInit@plt>

LLVM IR (-O0):
define i32 @ssh_hans_zlib_inflateInit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @initialize(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @inflateInit(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @ssh_hans_zlib_inflateInit(i32 %0) {
%2 = tail call i32 @initialize(i32 %0)
%3 = tail call i32 @inflateInit(i32 %0)
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ FAIL(char *);
int /*<<< orphan*/ PASS(char *);
scalar_t__ checkRebasing();
int main(int argc, const char *argv[]) {
  if (checkRebasing())
    PASS("prebased-performance");
  else
    FAIL("prebased-performance");
  return EXIT_SUCCESS;
}


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    $0x0,%al
call   1030 <checkRebasing@plt>
cmp    $0x0,%rax
je     1168 <main+0x38>
lea    0xea2(%rip),%rdi
call   1040 <PASS@plt>
jmp    1174 <main+0x44>
lea    0xe91(%rip),%rdi
call   1050 <FAIL@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <checkRebasing@plt>
lea    0xec1(%rip),%rdi
test   %rax,%rax
je     114b <main+0x1b>
call   1040 <PASS@plt>
jmp    1150 <main+0x20>
call   1050 <FAIL@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"prebased-performance\00"
@EXIT_SUCCESS = 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 = call i64 (...) @checkRebasing()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @PASS(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @FAIL(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@.str = [21 x i8] c"prebased-performance\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @checkRebasing()
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @PASS(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %2
%8 = tail call i32 @FAIL(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}
int getGcm(int a, int b) {
  int c;
  while (b != 0) {
    c = a % b;
    a = b;
    b = c;
  }
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @getGcm(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
ret i32 %10
}
float brick_noise(int n) {
  int nn;
  n = (n >> 13) ^ n;
  nn = (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff;
  return 0.5f * ((float)nn / 1073741824.0f);
}


x86 assembly (clang, -O0):
<brick_noise>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xd,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
imul   $0xec4d,%ecx,%ecx
add    $0x131071f,%ecx
imul   %ecx,%eax
add    $0x5208dd0d,%eax
and    $0x7fffffff,%eax
mov    %eax,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm1
movss  0xebe(%rip),%xmm0
divss  %xmm0,%xmm1
movss  0xeae(%rip),%xmm0
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<brick_noise>:
mov    %edi,%eax
sar    $0xd,%eax
xor    %edi,%eax
mov    %eax,%ecx
imul   %eax,%ecx
imul   $0xec4d,%ecx,%ecx
add    $0x131071f,%ecx
imul   %eax,%ecx
add    $0x5208dd0d,%ecx
and    $0x7fffffff,%ecx
cvtsi2ss %ecx,%xmm0
mulss  0xecd(%rip),%xmm0
mulss  0xec9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @brick_noise(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 13
%6 = load i32, i32* %2
%7 = xor i32 %5, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = mul nsw i32 %11, 60493
%13 = add nsw i32 %12, 19990303
%14 = mul nsw i32 %8, %13
%15 = add nsw i32 %14, 1376312589
%16 = and i32 %15, 2147483647
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = sitofp i32 %17 to float
%19 = fdiv float %18, 0x41D0000000000000
%20 = fmul float 5.000000e-01, %19
ret float %20
}

LLVM IR (-O2):
define float @brick_noise(i32 %0) {
%2 = ashr i32 %0, 13
%3 = xor i32 %2, %0
%4 = mul i32 %3, 60493
%5 = mul i32 %4, %3
%6 = add nuw nsw i32 %5, 19990303
%7 = mul nsw i32 %6, %3
%8 = add nsw i32 %7, 1376312589
%9 = and i32 %8, 2147483647
%10 = sitofp i32 %9 to float
%11 = fmul float %10, 0x3E10000000000000
%12 = fmul float %11, 5.000000e-01
ret float %12
}
void HardFault_Handler(void) {
  while (1) {
  };
}


x86 assembly (clang, -O0):
<HardFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <HardFault_Handler+0x9>
jmp    1109 <HardFault_Handler+0x9>

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

LLVM IR (-O0):
define void @HardFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @HardFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int test_imm_72int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x72 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_72int64_midword_mem>:
testb  $0x72,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_72int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7471104
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ print_i2c_busses(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void help(void) {
  fprintf(stderr, "Syntax: i2cdetect [-y] [-a] [-q|-r] I2CBUS [FIRST LAST]\n"
                  "        i2cdetect -l\n"
                  "        i2cdetect -V\n"
                  "  I2CBUS is an integer\n"
                  "  With -a, probe all addresses (NOT RECOMMENDED)\n"
                  "  With -q, uses only quick write commands for probing (NOT "
                  "RECOMMENDED)\n"
                  "  With -r, uses only read byte commands for probing (NOT "
                  "RECOMMENDED)\n"
                  "  If provided, FIRST and LAST limit the probing range.\n"
                  "  With -l, lists installed busses only\n");
  print_i2c_busses(0);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <print_i2c_busses@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <print_i2c_busses@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [407 x i8] c"Syntax: i2cdetect [-y] [-a] [-q|-r] I2CBUS [FIRST LAST]\0A i2cdetect -l\0A i2cdetect -V\0A I2CBUS is an integer\0A With -a, probe all addresses (NOT RECOMMENDED)\0A With -q, uses only quick write commands for probing (NOT RECOMMENDED)\0A With -r, uses only read byte commands for probing (NOT RECOMMENDED)\0A If provided, FIRST and LAST limit the probing range.\0A With -l, lists installed busses only\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([407 x i8], [407 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @print_i2c_busses(i32 0)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [407 x i8] c"Syntax: i2cdetect [-y] [-a] [-q|-r] I2CBUS [FIRST LAST]\0A i2cdetect -l\0A i2cdetect -V\0A I2CBUS is an integer\0A With -a, probe all addresses (NOT RECOMMENDED)\0A With -q, uses only quick write commands for probing (NOT RECOMMENDED)\0A With -r, uses only read byte commands for probing (NOT RECOMMENDED)\0A If provided, FIRST and LAST limit the probing range.\0A With -l, lists installed busses only\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([407 x i8], [407 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_i2c_busses(i32 0)
ret void
}
void lmh_debug_deregister(struct lmh_debug_ops *ops) {}


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

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

LLVM IR (-O0):
%struct.lmh_debug_ops = type opaque
define void @lmh_debug_deregister(%struct.lmh_debug_ops* %0) {
%2 = alloca %struct.lmh_debug_ops*
store %struct.lmh_debug_ops* %0, %struct.lmh_debug_ops** %2
ret void
}

LLVM IR (-O2):
%struct.lmh_debug_ops = type opaque
define void @lmh_debug_deregister(%struct.lmh_debug_ops* nocapture %0) {
ret void
}
char *my_strcpy(char *dest, const char *src) {
  char *ret = dest;
  while (*dest++ = *src++)
    ;
  return ret;
}


x86 assembly (clang, -O0):
<my_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <my_strcpy+0x43>
jmp    1114 <my_strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <my_strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @my_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
double cos(double);
double f5_cosx_x(double x) { return cos(x) - x; }


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

x86 assembly (clang, -O2):
<f5_cosx_x>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <cos@plt>
subsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f5_cosx_x(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @cos(double %3)
%5 = load double, double* %2
%6 = fsub double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @f5_cosx_x(double %0) {
%2 = tail call double @cos(double %0)
%3 = fsub double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ _DIAGASSERT(int /*<<< orphan*/);
scalar_t__ __gettemp(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
char *_mktemp(char *path) {
  _DIAGASSERT(path != NULL);
  return __gettemp(path, NULL, 0) ? path : NULL;
}


x86 assembly (clang, -O0):
<_mktemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <_DIAGASSERT@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <__gettemp@plt>
cmp    $0x0,%rax
je     1164 <_mktemp+0x44>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    116f <_mktemp+0x4f>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    116f <_mktemp+0x4f>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mktemp>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <_DIAGASSERT@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <__gettemp@plt>
test   %rax,%rax
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_mktemp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @_DIAGASSERT(i32 %5)
%7 = load i8*, i8** %2
%8 = call i64 @__gettemp(i8* %7, i32* null, i32 0)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i8*, i8** %2
br label %13
12: ; preds = %1
br label %13
13: ; preds = %12, %10
%14 = phi i8* [ %11, %10 ], [ null, %12 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @_mktemp(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @_DIAGASSERT(i32 %3)
%5 = tail call i64 @__gettemp(i8* %0, i32* null, i32 0)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* null, i8* %0
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_arr(int *arr, int len) {
  int i = 0;
  for (; i < len; i++) {
    printf("%d", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_arr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_arr+0x16>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_arr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_arr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @print_arr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
int __nepowerset(left, right, bitlength)
unsigned char *left;
unsigned char *right;
unsigned long bitlength;
{ return !__eqpowerset(left, right, bitlength); }


x86 assembly (clang, -O0):
<__nepowerset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <__eqpowerset@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__nepowerset>:
push   %rax
xor    %eax,%eax
call   1030 <__eqpowerset@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__nepowerset(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 (i8*, i8*, i64, ...) bitcast (i32 (...)* @__eqpowerset to i32 (i8*, i8*, i64, ...)*)(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @__nepowerset(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 (i8*, i8*, i64, ...) bitcast (i32 (...)* @__eqpowerset to i32 (i8*, i8*, i64, ...)*)(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
float r_abs(float *);
float intr_wrap_087(float p1) { return r_abs(&p1); }


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

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

LLVM IR (-O0):
define float @intr_wrap_087(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float @r_abs(float* %2)
ret float %3
}

LLVM IR (-O2):
define float @intr_wrap_087(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float @r_abs(float* %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *wmalloc(size_t size) {
  void *tmp;
  tmp = NULL;
  tmp = malloc(size);
  if (tmp == NULL) {
    fprintf(stderr, "Malloc() error: Out of memory.\n");
    exit(EXIT_FAILURE);
  }
  return (tmp);
}


x86 assembly (clang, -O0):
<wmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117f <wmalloc+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <wmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Malloc() error: Out of memory.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @wmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* null, i8** %3
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Malloc() error: Out of memory.\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @wmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
void draw_(x, y, z) float *x, *y, *z;
{ draw(*x, *y, *z); }


x86 assembly (clang, -O0):
<draw_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <draw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
movss  (%rdx),%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <draw@plt>

LLVM IR (-O0):
define void @draw_(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = load float*, float** %5
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = load float*, float** %6
%14 = load float, float* %13
%15 = fpext float %14 to double
%16 = call i32 (double, double, double, ...) bitcast (i32 (...)* @draw to i32 (double, double, double, ...)*)(double %9, double %12, double %15)
ret void
}

LLVM IR (-O2):
define void @draw_(float* nocapture %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %0
%5 = fpext float %4 to double
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @draw to i32 (double, double, double, ...)*)(double %5, double %7, double %9)
ret void
}
int is_end_of_token(char byte) { return ((byte == ';') || (byte == '\n')); }


x86 assembly (clang, -O0):
<is_end_of_token>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3b,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_end_of_token+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_end_of_token>:
cmp    $0x3b,%dil
sete   %al
cmp    $0xa,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_end_of_token(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, 59
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 10
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_end_of_token(i8 signext %0) {
%2 = icmp eq i8 %0, 59
%3 = icmp eq i8 %0, 10
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ err(char *, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void abortGame() {
  err("<abortGame>", +1);
  err("on quitte le jeu, la fonction abortgame() a ete appelee", 0);
  endwin();
  err("good bye", 0);
  err("</abortGame>", -1);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<abortGame>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
mov    $0x1,%esi
call   1030 <err@plt>
lea    0xec0(%rip),%rdi
xor    %esi,%esi
call   1030 <err@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
lea    0xee3(%rip),%rdi
xor    %esi,%esi
call   1030 <err@plt>
lea    0xede(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <err@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<abortGame>:
push   %rax
lea    0xec8(%rip),%rdi
mov    $0x1,%esi
call   1030 <err@plt>
lea    0xec3(%rip),%rdi
xor    %esi,%esi
call   1030 <err@plt>
xor    %eax,%eax
call   1040 <endwin@plt>
lea    0xee6(%rip),%rdi
xor    %esi,%esi
call   1030 <err@plt>
lea    0xee1(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <err@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"<abortGame>\00"
@.str.1 = [56 x i8] c"on quitte le jeu, la fonction abortgame() a ete appelee\00"
@.str.2 = [9 x i8] c"good bye\00"
@.str.3 = [13 x i8] c"</abortGame>\00"
@EXIT_SUCCESS = global i32 0
define void @abortGame() {
%1 = call i32 @err(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = call i32 @err(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = call i32 (...) @endwin()
%4 = call i32 @err(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 0)
%5 = call i32 @err(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 -1)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"<abortGame>\00"
@.str.1 = [56 x i8] c"on quitte le jeu, la fonction abortgame() a ete appelee\00"
@.str.2 = [9 x i8] c"good bye\00"
@.str.3 = [13 x i8] c"</abortGame>\00"
@EXIT_SUCCESS = global i32 0
define void @abortGame() {
%1 = tail call i32 @err(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @err(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 (...) @endwin()
%4 = tail call i32 @err(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 0)
%5 = tail call i32 @err(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 -1)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
}