xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fatal_error(int);
int /*<<< orphan*/ finite(double);
int cmp_flonum(double op1, double op2) {
  double value = op1 - op2;
  if (!finite(value))
    fatal_error(1);
  return (value > 0.0 ? 1 : value < 0.0 ? -1 : 0);
}


x86 assembly (clang, -O0):
<cmp_flonum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movaps 0xed3(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xeb7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    115d <cmp_flonum+0x4d>
mov    $0x1,%edi
call   1030 <fatal_error@plt>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    117c <cmp_flonum+0x6c>
mov    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1195 <cmp_flonum+0x85>
movsd  -0x18(%rbp),%xmm1
xorps  %xmm0,%xmm0
xor    %eax,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_flonum>:
sub    $0x18,%rsp
subsd  %xmm1,%xmm0
movapd 0xee0(%rip),%xmm1
andpd  %xmm0,%xmm1
ucomisd 0xee4(%rip),%xmm1
jne    1142 <cmp_flonum+0x32>
mov    $0x1,%edi
movapd %xmm0,(%rsp)
call   1030 <fatal_error@plt>
movapd (%rsp),%xmm0
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cmp_flonum(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fsub double %6, %7
store double %8, double* %5
%9 = load double, double* %5
%10 = call double @llvm.fabs.f64(double %9)
%11 = fcmp one double %10, 0x7FF0000000000000
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 @fatal_error(i32 1)
br label %14
14: ; preds = %12, %2
%15 = load double, double* %5
%16 = fcmp ogt double %15, 0.000000e+00
br i1 %16, label %17, label %18
17: ; preds = %14
br label %23
18: ; preds = %14
%19 = load double, double* %5
%20 = fcmp olt double %19, 0.000000e+00
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 -1, i32 0
br label %23
23: ; preds = %18, %17
%24 = phi i32 [ 1, %17 ], [ %22, %18 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @cmp_flonum(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
%5 = fcmp ueq double %4, 0x7FF0000000000000
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @fatal_error(i32 1)
br label %8
8: ; preds = %6, %2
%9 = fcmp ogt double %3, 0.000000e+00
%10 = fcmp olt double %3, 0.000000e+00
%11 = sext i1 %10 to i32
%12 = select i1 %9, i32 1, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ rt_systick_init();
__attribute__((weak)) int os_tick_init(void) {
  rt_systick_init();
  return (-1);
}


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

x86 assembly (clang, -O2):
<os_tick_init>:
push   %rax
xor    %eax,%eax
call   1030 <rt_systick_init@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define weak i32 @os_tick_init() {
%1 = call i32 (...) @rt_systick_init()
ret i32 -1
}

LLVM IR (-O2):
define weak i32 @os_tick_init() {
%1 = tail call i32 (...) @rt_systick_init()
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putstr(char *str) {
  int index;
  index = 0;
  while (str[index] != '\0') {
    write(1, &str[index], 1);
    index++;
  }
  write(1, "\n", 1);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115d <ft_putstr+0x4d>
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putstr+0x13>
mov    $0x1,%edx
lea    0xe97(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113c <ft_putstr+0x2c>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_putstr+0x10>
lea    0xebd(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i32 @write(i32 1, i8* %6, i32 1)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
int min(int a, int b) { return b < a ? b : a; }


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

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
long int cast_ushort_long_fast(unsigned short int x) { return (long int)x; }


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

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

LLVM IR (-O0):
define i64 @cast_ushort_long_fast(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @cast_ushort_long_fast(i16 zeroext %0) {
%2 = zext i16 %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int evens[5] = {0, 2, 4, 6, 8};
  printf("The first even number is, of course, %i\n", *evens);
  int *positive_evens = &evens[1];
  printf("The first positive even number is %i\n", positive_evens[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    -0x20(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.evens = [5 x i32] [i32 0, i32 2, i32 4, i32 6, i32 8]
@.str = [41 x i8] c"The first even number is, of course, %i\0A\00"
@.str.1 = [38 x i8] c"The first positive even number is %i\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca i32*
%3 = bitcast [5 x i32]* %1 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
store i32* %7, i32** %2
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"The first even number is, of course, %i\0A\00"
@.str.1 = [38 x i8] c"The first positive even number is %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void sleep_ns(int ns) { usleep(ns); }


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

x86 assembly (clang, -O2):
<sleep_ns>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @sleep_ns(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void unknown_symbol(void) { printf("unknown symbol in msvcrt called\n"); }


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

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

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

LLVM IR (-O2):
@str = [32 x i8] c"unknown symbol in msvcrt called\00"
define void @unknown_symbol() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char, char);
int /*<<< orphan*/ scanf(char *, char *);
void main() {
  char c, d;
  scanf("%c", &c);
  getchar();
  scanf("%c", &d);
  printf("%c,%c\n", c, d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xeaa(%rip),%rdi
lea    -0x2(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x1(%rbp),%al
lea    0xe9a(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xf(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsbl 0xf(%rsp),%esi
movsbl 0xe(%rsp),%edx
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [7 x i8] c"%c,%c\0A\00"
define void @main() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = call i32 (...) @getchar()
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %1
%7 = load i8, i8* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8 signext %6, i8 signext %7)
ret void
}
void f2(int q) { q = 5; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x5,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store i32 5, i32* %2
ret void
}

LLVM IR (-O2):
define void @f2(i32 %0) {
ret void
}
int mtts_tscomp(unsigned int ts1_high, unsigned int ts1_low,
                unsigned int ts2_high, unsigned int ts2_low) {
  register int ret;
  if (ts1_high > ts2_high) {
    ret = 1;
  } else {
    if (ts1_high < ts2_high) {
      ret = -1;
    } else {
      if (ts1_low > ts2_low) {
        ret = 1;
      } else if (ts1_low < ts2_low) {
        ret = -1;
      } else {
        ret = 0;
      }
    }
  }
  return (ret);
}


x86 assembly (clang, -O0):
<mtts_tscomp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1128 <mtts_tscomp+0x28>
movl   $0x1,-0x14(%rbp)
jmp    1186 <mtts_tscomp+0x86>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1140 <mtts_tscomp+0x40>
movl   $0xffffffff,-0x14(%rbp)
jmp    1181 <mtts_tscomp+0x81>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jbe    1158 <mtts_tscomp+0x58>
movl   $0x1,-0x14(%rbp)
jmp    117c <mtts_tscomp+0x7c>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    1170 <mtts_tscomp+0x70>
movl   $0xffffffff,-0x14(%rbp)
jmp    1177 <mtts_tscomp+0x77>
movl   $0x0,-0x14(%rbp)
jmp    117c <mtts_tscomp+0x7c>
jmp    1181 <mtts_tscomp+0x81>
jmp    1186 <mtts_tscomp+0x86>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtts_tscomp>:
mov    $0x1,%eax
cmp    %edx,%edi
ja     111b <mtts_tscomp+0x1b>
mov    $0xffffffff,%eax
jb     111b <mtts_tscomp+0x1b>
mov    $0x1,%eax
cmp    %ecx,%esi
ja     111b <mtts_tscomp+0x1b>
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mtts_tscomp(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ugt i32 %0, %2
br i1 %5, label %13, label %6
6: ; preds = %4
%7 = icmp ult i32 %0, %2
br i1 %7, label %13, label %8
8: ; preds = %6
%9 = icmp ugt i32 %1, %3
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = icmp ult i32 %1, %3
%12 = sext i1 %11 to i32
br label %13
13: ; preds = %10, %8, %6, %4
%14 = phi i32 [ 1, %4 ], [ -1, %6 ], [ 1, %8 ], [ %12, %10 ]
ret i32 %14
}
/* Variables and functions */
int strtol(char const *, char **, int);
int capture_int(const char *carg, void *pvar) {
  int *pi = pvar;
  char *end;
  *pi = strtol(carg, &end, 10);
  return end != carg ? 0 : 1;
}


x86 assembly (clang, -O0):
<capture_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_int>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,(%r14)
xor    %eax,%eax
cmp    %rbx,(%rsp)
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @capture_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %3
%10 = call i32 @strtol(i8* %9, i8** %6, i32 10)
%11 = load i32*, i32** %5
store i32 %10, i32* %11
%12 = load i8*, i8** %6
%13 = load i8*, i8** %3
%14 = icmp ne i8* %12, %13
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 0, i32 1
ret i32 %16
}

LLVM IR (-O2):
define i32 @capture_int(i8* %0, i8* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8* %1 to i32*
%5 = bitcast i8** %3 to i8*
%6 = call i32 @strtol(i8* %0, i8** %3, i32 10)
store i32 %6, i32* %4
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, %0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_avg4_16(int, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ const *, int, int);
void MC_avg_xy_16_3dnow(uint8_t *dest, const uint8_t *ref, int stride,
                        int height) {
  MC_avg4_16(height, dest, ref, stride, 1);
}


x86 assembly (clang, -O0):
<MC_avg_xy_16_3dnow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%r8d
call   1030 <MC_avg4_16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_avg_xy_16_3dnow>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %eax,%ecx
mov    $0x1,%r8d
jmp    1030 <MC_avg4_16@plt>

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

LLVM IR (-O2):
define void @MC_avg_xy_16_3dnow(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_avg4_16(i32 %3, i32* %0, i32* %1, i32 %2, i32 1)
ret void
}
int sysfs_create_link(struct kobject *kobj, struct kobject *target,
                      char *name) {
  int a;
  return a;
}


x86 assembly (clang, -O0):
<sysfs_create_link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.kobject = type opaque
define i32 @sysfs_create_link(%struct.kobject* %0, %struct.kobject* %1, i8* %2) {
%4 = alloca %struct.kobject*
%5 = alloca %struct.kobject*
%6 = alloca i8*
%7 = alloca i32
store %struct.kobject* %0, %struct.kobject** %4
store %struct.kobject* %1, %struct.kobject** %5
store i8* %2, i8** %6
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
%struct.kobject = type opaque
define i32 @sysfs_create_link(%struct.kobject* nocapture readnone %0, %struct.kobject* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 undef
}
void test(unsigned char uch_param) {
  char ch;
  unsigned char uch;
  uch = uch_param;
  ch = uch_param;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test(i8 zeroext %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int strlen(char const *);
int /*<<< orphan*/ vsnprintf(char *, int, char const *, int /*<<< orphan*/);
char *xmalloc(int);
char *valloc_line(const char *fmt, va_list listp) {
  assert(strlen(fmt) < 128);
  char *ptr = xmalloc(128);
  vsnprintf(ptr, 127, fmt, listp);
  ptr[127] = 0;
  return ptr;
}


x86 assembly (clang, -O0):
<valloc_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x80,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    $0x80,%edi
call   1050 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    $0x7f,%esi
call   1030 <vsnprintf@plt>
mov    -0x18(%rbp),%rax
movb   $0x0,0x7f(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valloc_line>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1040 <strlen@plt>
xor    %edi,%edi
cmp    $0x80,%eax
setl   %dil
call   1060 <assert@plt>
mov    $0x80,%edi
call   1050 <xmalloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    $0x7f,%esi
mov    %rbx,%rdx
mov    %r14d,%ecx
call   1030 <vsnprintf@plt>
movb   $0x0,0x7f(%rbp)
mov    %rbp,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @valloc_line(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = icmp slt i32 %7, 128
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i8* @xmalloc(i32 128)
store i8* %11, i8** %5
%12 = load i8*, i8** %5
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @vsnprintf(i8* %12, i32 127, i8* %13, i32 %14)
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 127
store i8 0, i8* %17
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @valloc_line(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp slt i32 %3, 128
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i8* @xmalloc(i32 128)
%8 = tail call i32 @vsnprintf(i8* %7, i32 127, i8* %0, i32 %1)
%9 = getelementptr inbounds i8, i8* %7, i64 127
store i8 0, i8* %9
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int /*<<< orphan*/ iswupper(int /*<<< orphan*/);
void uninitvar_iswupper(void) {
  wint_t i;
  (void)iswupper(i);
}


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

x86 assembly (clang, -O2):
<uninitvar_iswupper>:
jmp    1030 <iswupper@plt>

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

LLVM IR (-O2):
define void @uninitvar_iswupper() {
%1 = tail call i32 @iswupper(i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mkfilecheck(int, char **);
int main(int argc, char **argv) {
  mkfilecheck(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <mkfilecheck@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <mkfilecheck@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @mkfilecheck(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @mkfilecheck(i32 %0, i8** %1)
ret i32 0
}
double __ddiv_rz(double x, double y) { return x / y; }


x86 assembly (clang, -O0):
<__ddiv_rz>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ddiv_rz>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @__ddiv_rz(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @__ddiv_rz(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double rand100() { return ((double)rand() / RAND_MAX) * 100.0L; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ebd(%rip),%rax
movsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
fldl   -0x8(%rbp)
flds   0xebf(%rip)
fmulp  %st,%st(1)
fstpl  -0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
mulsd  0xed0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @rand100() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
%5 = fpext double %4 to x86_fp80
%6 = fmul x86_fp80 %5, 0xK4005C800000000000000
%7 = fptrunc x86_fp80 %6 to double
ret double %7
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rand100() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
%5 = fmul double %4, 1.000000e+02
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ atomic_long;

/* Variables and functions */
int /*<<< orphan*/ my_atomic_exchange(int /*<<< orphan*/ *, long);
void writeV(atomic_long *v, long w) { my_atomic_exchange(v, w); }


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

x86 assembly (clang, -O2):
<writeV>:
jmp    1030 <my_atomic_exchange@plt>

LLVM IR (-O0):
define void @writeV(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = call i32 @my_atomic_exchange(i32* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @writeV(i32* %0, i64 %1) {
%3 = tail call i32 @my_atomic_exchange(i32* %0, i64 %1)
ret void
}
int test_imm_57uint32_reg(unsigned int val) {
  return ((val) & (0x57 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_57uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x57,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_57uint32_reg>:
test   $0x57,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_57uint32_reg(i32 %0) {
%2 = and i32 %0, 87
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int is_dos_path(const char *path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_dos_path(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sectioning_underscore(char *);
void cm_appendixsubsubsec(void) { sectioning_underscore("appendixsubsubsec"); }


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"appendixsubsubsec\00"
define void @cm_appendixsubsubsec() {
%1 = tail call i32 @sectioning_underscore(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fwrite(char const *, int, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void alchemy_stdout_callback(const char *buf, size_t len, void *data) {
  if (NULL != buf && len > 0u)
    fwrite(buf, sizeof(char), len, stdout);
}


x86 assembly (clang, -O0):
<alchemy_stdout_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1156 <alchemy_stdout_callback+0x46>
cmpq   $0x0,-0x10(%rbp)
jbe    1156 <alchemy_stdout_callback+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    0x2e96(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alchemy_stdout_callback>:
test   %rdi,%rdi
je     1130 <alchemy_stdout_callback+0x20>
mov    %rsi,%rdx
test   %rsi,%rsi
je     1130 <alchemy_stdout_callback+0x20>
mov    0x2ebc(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
jmp    1030 <fwrite@plt>
ret

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

LLVM IR (-O2):
@stdout = global i32 0
define void @alchemy_stdout_callback(i8* %0, i64 %1, i8* nocapture readnone %2) {
%4 = icmp ne i8* %0, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* @stdout
%9 = tail call i32 @fwrite(i8* %0, i32 1, i64 %1, i32 %8)
br label %10
10: ; preds = %7, %3
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
void set_XMotionEvent_type(void *_p, int _v) {
  ((XMotionEvent *)_p)->type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XMotionEvent_type>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XMotionEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int pow(int, double);
double energy(double v, double mass) {
  return (mass * 8.9875518e+16 * (pow(1 - pow(v / 299792458, 2.0), -0.5) - 1));
}


x86 assembly (clang, -O0):
<energy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeee(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xecf(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xeb7(%rip),%xmm0
call   1030 <pow@plt>
mov    $0x1,%edi
sub    %eax,%edi
movsd  0xe9b(%rip),%xmm0
call   1030 <pow@plt>
movsd  -0x18(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<energy>:
push   %rax
mulsd  0xee7(%rip),%xmm1
movsd  %xmm1,(%rsp)
divsd  0xee2(%rip),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xede(%rip),%xmm0
call   1030 <pow@plt>
mov    $0x1,%edi
sub    %eax,%edi
movsd  0xed2(%rip),%xmm0
call   1030 <pow@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @energy(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fmul double %5, 0x4373F4D4EB464EC0
%7 = load double, double* %3
%8 = fdiv double %7, 0x41B1DE784A000000
%9 = fptosi double %8 to i32
%10 = call i32 @pow(i32 %9, double 2.000000e+00)
%11 = sub nsw i32 1, %10
%12 = call i32 @pow(i32 %11, double -5.000000e-01)
%13 = sub nsw i32 %12, 1
%14 = sitofp i32 %13 to double
%15 = fmul double %6, %14
ret double %15
}

LLVM IR (-O2):
define double @energy(double %0, double %1) {
%3 = fmul double %1, 0x4373F4D4EB464EC0
%4 = fdiv double %0, 0x41B1DE784A000000
%5 = fptosi double %4 to i32
%6 = tail call i32 @pow(i32 %5, double 2.000000e+00)
%7 = sub nsw i32 1, %6
%8 = tail call i32 @pow(i32 %7, double -5.000000e-01)
%9 = add nsw i32 %8, -1
%10 = sitofp i32 %9 to double
%11 = fmul double %3, %10
ret double %11
}
/* Variables and functions */
int strlen(char *);
int filterDomainLength(char domain[]) {
  if (strlen(domain) > 30) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<filterDomainLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1e,%eax
jle    113a <filterDomainLength+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <filterDomainLength+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filterDomainLength>:
push   %rax
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    $0x1f,%eax
setge  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @filterDomainLength(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* %4)
%6 = icmp sgt i32 %5, 30
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @filterDomainLength(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 30
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ draw_string(int, int, char *);
int /*<<< orphan*/ play_one_square();
int /*<<< orphan*/ play_ten_squares();
int /*<<< orphan*/ setup_screen();
int /*<<< orphan*/ show_screen();
int /*<<< orphan*/ walk_the_walk();
int main(void) {
  setup_screen();
  draw_string(10, 10, "Hello CAB202!!!");
  show_screen();
  while (1) {
    play_one_square();
    play_ten_squares();
    walk_the_walk();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <setup_screen@plt>
mov    $0xa,%esi
lea    0xe7e(%rip),%rdx
mov    %esi,%edi
call   1060 <draw_string@plt>
mov    $0x0,%al
call   1040 <show_screen@plt>
mov    $0x0,%al
call   1070 <play_one_square@plt>
mov    $0x0,%al
call   1080 <play_ten_squares@plt>
mov    $0x0,%al
call   1030 <walk_the_walk@plt>
jmp    1190 <main+0x30>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <setup_screen@plt>
lea    0xe91(%rip),%rdx
mov    $0xa,%edi
mov    $0xa,%esi
call   1060 <draw_string@plt>
xor    %eax,%eax
call   1040 <show_screen@plt>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1070 <play_one_square@plt>
xor    %eax,%eax
call   1080 <play_ten_squares@plt>
xor    %eax,%eax
call   1030 <walk_the_walk@plt>
jmp    1190 <main+0x30>

LLVM IR (-O0):
@.str = [16 x i8] c"Hello CAB202!!!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup_screen()
%3 = call i32 @draw_string(i32 10, i32 10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @show_screen()
br label %5
5: ; preds = %0, %5
%6 = call i32 (...) @play_one_square()
%7 = call i32 (...) @play_ten_squares()
%8 = call i32 (...) @walk_the_walk()
br label %5
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello CAB202!!!\00"
define i32 @main() {
%1 = tail call i32 (...) @setup_screen()
%2 = tail call i32 @draw_string(i32 10, i32 10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @show_screen()
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @play_one_square()
%6 = tail call i32 (...) @play_ten_squares()
%7 = tail call i32 (...) @walk_the_walk()
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo2() { printf("foo2 in inline1\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"foo2 in inline1\00"
define void @foo2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int O_ACCMODE;
int S_IRUSR;
int S_IWUSR;
int __gen_tempname(char *, int /*<<< orphan*/, int, int);
int mkostemp(char *template, int flags) {
  flags -= flags & O_ACCMODE;
  return __gen_tempname(template, 0, flags, S_IRUSR | S_IWUSR);
}


x86 assembly (clang, -O0):
<mkostemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2ec7(%rip),%rax
and    (%rax),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    0x2e8f(%rip),%rax
mov    (%rax),%ecx
mov    0x2e96(%rip),%rax
or     (%rax),%ecx
xor    %esi,%esi
call   1030 <__gen_tempname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkostemp>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edx
not    %edx
and    %esi,%edx
mov    0x2eac(%rip),%rax
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
xor    %esi,%esi
jmp    1030 <__gen_tempname@plt>

LLVM IR (-O0):
@O_ACCMODE = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define i32 @mkostemp(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* @O_ACCMODE
%7 = and i32 %5, %6
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, %7
store i32 %9, i32* %4
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = load i32, i32* @S_IRUSR
%13 = load i32, i32* @S_IWUSR
%14 = or i32 %12, %13
%15 = call i32 @__gen_tempname(i8* %10, i32 0, i32 %11, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
@O_ACCMODE = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define i32 @mkostemp(i8* %0, i32 %1) {
%3 = load i32, i32* @O_ACCMODE
%4 = xor i32 %3, -1
%5 = and i32 %4, %1
%6 = load i32, i32* @S_IRUSR
%7 = load i32, i32* @S_IWUSR
%8 = or i32 %7, %6
%9 = tail call i32 @__gen_tempname(i8* %0, i32 0, i32 %5, i32 %8)
ret i32 %9
}
void h2o_noop() { return; }


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

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

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

LLVM IR (-O2):
define void @h2o_noop() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int u_int32_t;

/* Variables and functions */
int h2_u32(int /*<<< orphan*/ const *const);
__attribute__((__pure__)) u_int32_t h2_u24(const uint8_t *const s) {
  return h2_u32(s) >> 8;
}


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

x86 assembly (clang, -O2):
<h2_u24>:
push   %rax
call   1030 <h2_u32@plt>
sar    $0x8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @h2_u24(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @h2_u32(i32* %3)
%5 = ashr i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @h2_u24(i32* %0) {
%2 = tail call i32 @h2_u32(i32* %0)
%3 = ashr i32 %2, 8
ret i32 %3
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ sp_client_greeter_start(int, char **);
int main(int argc, char **argv) {
  if (!sp_client_greeter_start(argc, argv))
    return EXIT_FAILURE;
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <sp_client_greeter_start@plt>
cmp    $0x0,%eax
jne    114c <main+0x3c>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <main+0x48>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <sp_client_greeter_start@plt>
test   %eax,%eax
jne    1123 <main+0x13>
mov    0x2ebf(%rip),%rax
jmp    112a <main+0x1a>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @sp_client_greeter_start(i32 %6, i8** %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %3
br label %14
12: ; preds = %2
%13 = load i32, i32* @EXIT_SUCCESS
store i32 %13, i32* %3
br label %14
14: ; preds = %12, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @sp_client_greeter_start(i32 %0, i8** %1)
%4 = icmp eq i32 %3, 0
%5 = load i32, i32* @EXIT_FAILURE
%6 = load i32, i32* @EXIT_SUCCESS
%7 = select i1 %4, i32 %5, i32 %6
ret i32 %7
}
void putc(int c) {
  asm("int	$3	\n\t"
      "cmpb	$0,%%al	\n\t"
      :
      : "a"(c));
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
int3
cmp    $0x0,%al
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
mov    %edi,%eax
int3
cmp    $0x0,%al
ret

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

LLVM IR (-O2):
define void @putc(i32 %0) {
tail call void asm sideeffect "int\09$$3\09\0A\09cmpb\09$$0,%al\09\0A\09", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret void
}
int test_imm_A6uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xA6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A6uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 166
%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_A6uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 10878976
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int hoho(int x, int (*(*f)(int))(int)) { return (f(x + 1))(x - 1); }


x86 assembly (clang, -O0):
<hoho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   *%rax
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hoho>:
push   %rbx
mov    %edi,%ebx
lea    0x1(%rbx),%edi
call   *%rsi
add    $0xffffffff,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    *%rax

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

LLVM IR (-O2):
define i32 @hoho(i32 %0, i32 (i32)* (i32)* nocapture %1) {
%3 = add nsw i32 %0, 1
%4 = tail call i32 (i32)* %1(i32 %3)
%5 = add nsw i32 %0, -1
%6 = tail call i32 %4(i32 %5)
ret i32 %6
}