xunge/DecIR huggingface dataset:
unsigned int leveldb_decode_fixed_32(const char *ptr) {
  return (((unsigned int)((unsigned char)(ptr[0]))) |
          ((unsigned int)((unsigned char)(ptr[1])) << 8) |
          ((unsigned int)((unsigned char)(ptr[2])) << 16) |
          ((unsigned int)((unsigned char)(ptr[3])) << 24));
}


x86 assembly (clang, -O0):
<leveldb_decode_fixed_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leveldb_decode_fixed_32>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @leveldb_decode_fixed_32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @leveldb_decode_fixed_32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) { printf("%d>%s<\n", argc, argv[argc - 1]); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movslq %edi,%rax
mov    -0x8(%rsi,%rax,8),%rdx
lea    0xee0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d>%s<\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8*, i8** %6, i64 %9
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d>%s<\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add nsw i32 %0, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8*, i8** %1, i64 %4
%6 = load i8*, i8** %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %6)
ret i32 0
}
void av_expr_count_func() {}


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

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

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

LLVM IR (-O2):
define void @av_expr_count_func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void put_temp_file(char *file) { free(file); }


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

x86 assembly (clang, -O2):
<put_temp_file>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @put_temp_file(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
double pow(double, double);
double convert_it_2(double x) { return pow(x, 2.5); }


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

x86 assembly (clang, -O2):
<convert_it_2>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @convert_it_2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 2.500000e+00)
ret double %4
}

LLVM IR (-O2):
define double @convert_it_2(double %0) {
%2 = tail call double @pow(double %0, double 2.500000e+00)
ret double %2
}
__attribute__((weak)) void HDMA_IrqHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define weak void @HDMA_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void ttm_page_alloc_fini(void) {}


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

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

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

LLVM IR (-O2):
define void @ttm_page_alloc_fini() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g1(int, int);
int /*<<< orphan*/ g2(int, int);
int /*<<< orphan*/ use_pointer(int *);
void f(int a, int z) {
  if (z > 1)
    g1(a, z);
  else
    g2(a + 4, z);
  use_pointer(&a);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1158 <f+0x28>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <g1@plt>
jmp    1166 <f+0x36>
mov    -0x4(%rbp),%edi
add    $0x4,%edi
mov    -0x8(%rbp),%esi
call   1050 <g2@plt>
lea    -0x4(%rbp),%rdi
call   1040 <use_pointer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    %edi,0x4(%rsp)
cmp    $0x2,%esi
jl     1141 <f+0x11>
call   1030 <g1@plt>
jmp    1149 <f+0x19>
add    $0x4,%edi
call   1050 <g2@plt>
lea    0x4(%rsp),%rdi
call   1040 <use_pointer@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @g1(i32 %8, i32 %9)
br label %16
11: ; preds = %2
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 4
%14 = load i32, i32* %4
%15 = call i32 @g2(i32 %13, i32 %14)
br label %16
16: ; preds = %11, %7
%17 = call i32 @use_pointer(i32* %3)
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @g1(i32 %0, i32 %1)
br label %10
7: ; preds = %2
%8 = add nsw i32 %0, 4
%9 = tail call i32 @g2(i32 %8, i32 %1)
br label %10
10: ; preds = %7, %5
%11 = call i32 @use_pointer(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
neg() { callrts("ccneg"); }


x86 assembly (clang, -O0):
<neg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <callrts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"ccneg\00"
define i32 @neg() {
%1 = alloca i32
%2 = call i32 @callrts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccneg\00"
define i32 @neg() {
%1 = tail call i32 @callrts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
float sin(float);
float SIN(float x) { return sin(x); }


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

x86 assembly (clang, -O2):
<SIN>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define float @SIN(float %0) {
%2 = tail call float @sin(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, double *);
int main(int argc, const char *argv[]) {
  double f;
  scanf("%lf", &f);
  printf("c=%.2lf\n", 5 * (f - 32) / 9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xedb(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xebd(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe95(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
addsd  0xec3(%rip),%xmm0
mulsd  0xec3(%rip),%xmm0
divsd  0xec3(%rip),%xmm0
cvttsd2si %xmm0,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"c=%.2lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
%8 = load double, double* %6
%9 = fsub double %8, 3.200000e+01
%10 = fmul double 5.000000e+00, %9
%11 = fdiv double %10, 9.000000e+00
%12 = fptosi double %11 to i32
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"c=%.2lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%6 = load double, double* %3
%7 = fadd double %6, -3.200000e+01
%8 = fmul double %7, 5.000000e+00
%9 = fdiv double %8, 9.000000e+00
%10 = fptosi double %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
scalar_t__ calloc(size_t, int);
char *alloc_memory(size_t size) { return (char *)calloc(size, sizeof(char)); }


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

x86 assembly (clang, -O2):
<alloc_memory>:
mov    $0x1,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @alloc_memory(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @calloc(i64 %3, i32 1)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @alloc_memory(i64 %0) {
%2 = tail call i64 @calloc(i64 %0, i32 1)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
char *get_line_start(char *string, char *pos) {
  if (pos <= string) {
    return string;
  }
  while (pos > string) {
    pos--;
    if (*pos == '\n') {
      return ++pos;
    }
  }
  return string;
}


x86 assembly (clang, -O0):
<get_line_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     1127 <get_line_start+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <get_line_start+0x78>
jmp    112c <get_line_start+0x2c>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1170 <get_line_start+0x70>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    116b <get_line_start+0x6b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x8(%rbp)
jmp    1178 <get_line_start+0x78>
jmp    112c <get_line_start+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_line_start>:
mov    %rdi,%rax
cmp    %rdi,%rsi
jbe    1129 <get_line_start+0x29>
nopl   0x0(%rax,%rax,1)
cmp    %rax,%rsi
jbe    1129 <get_line_start+0x29>
lea    -0x1(%rsi),%rcx
cmpb   $0xa,-0x1(%rsi)
mov    %rcx,%rsi
jne    1110 <get_line_start+0x10>
add    $0x1,%rcx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @get_line_start(i8* readnone %0, i8* %1) {
%3 = icmp ugt i8* %1, %0
br i1 %3, label %4, label %11
4: ; preds = %2, %7
%5 = phi i8* [ %8, %7 ], [ %1, %2 ]
%6 = icmp ugt i8* %5, %0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 -1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 10
br i1 %10, label %11, label %4
11: ; preds = %4, %7, %2
%12 = phi i8* [ %0, %2 ], [ %0, %4 ], [ %5, %7 ]
ret i8* %12
}
int globus_hashtable_ulong_hash(void *integer, int limit) {
  return (unsigned long)integer % limit;
}


x86 assembly (clang, -O0):
<globus_hashtable_ulong_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<globus_hashtable_ulong_hash>:
mov    %rdi,%rax
movslq %esi,%rcx
mov    %rdi,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     111b <globus_hashtable_ulong_hash+0x1b>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @globus_hashtable_ulong_hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = urem i64 %6, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @globus_hashtable_ulong_hash(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = sext i32 %1 to i64
%5 = urem i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
long kmax(long a, long b) {
  if ((signed long)a < (signed long)b)
    return b;
  return a;
}


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

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

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

LLVM IR (-O2):
define i64 @kmax(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ IntEnable(int);
int /*<<< orphan*/ IntRegister(int, void (*)());
void PWMFaultIntRegister(unsigned long ulBase, void (*pfnIntHandler)(void)) {
  ;
  IntRegister(25, pfnIntHandler);
  IntEnable(25);
}


x86 assembly (clang, -O0):
<PWMFaultIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x19,%edi
call   1040 <IntRegister@plt>
mov    $0x19,%edi
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMFaultIntRegister>:
push   %rax
mov    $0x19,%edi
call   1040 <IntRegister@plt>
mov    $0x19,%edi
pop    %rax
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @PWMFaultIntRegister(i64 %0, void ()* %1) {
%3 = alloca i64
%4 = alloca void ()*
store i64 %0, i64* %3
store void ()* %1, void ()** %4
%5 = load void ()*, void ()** %4
%6 = bitcast void ()* %5 to void (...)*
%7 = call i32 @IntRegister(i32 25, void (...)* %6)
%8 = call i32 @IntEnable(i32 25)
ret void
}

LLVM IR (-O2):
define void @PWMFaultIntRegister(i64 %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @IntRegister(i32 25, void (...)* %3)
%5 = tail call i32 @IntEnable(i32 25)
ret void
}
int test_imm_FFuint16_mem(unsigned short *val) {
  return ((*val) & (0xFF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FFuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xff,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FFuint16_mem>:
cmpb   $0x0,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FFuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 255
%7 = icmp ne i32 %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_FFuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 255
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *s) {
  fprintf(stderr, "?GREP-E-%s\n", s);
  fprintf(stderr, "Usage: grep [-cfnv] pattern [file ...].  grep ? for help\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"?GREP-E-%s\0A\00"
@.str.1 = [58 x i8] c"Usage: grep [-cfnv] pattern [file ...]. grep ? for help\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"?GREP-E-%s\0A\00"
@.str.1 = [58 x i8] c"Usage: grep [-cfnv] pattern [file ...]. grep ? for help\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
float __ocml_ldexp_f32(float, int);
float ldexpf(float x, int e) { return __ocml_ldexp_f32(x, e); }


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

x86 assembly (clang, -O2):
<ldexpf>:
jmp    1030 <__ocml_ldexp_f32@plt>

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

LLVM IR (-O2):
define float @ldexpf(float %0, i32 %1) {
%3 = tail call float @__ocml_ldexp_f32(float %0, i32 %1)
ret float %3
}
int slen(char str[]) {
  int i = 0;
  while (str[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<slen>:
push   %rbp
mov    %rsp,%rbp
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     1132 <slen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <slen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <slen+0x10>
ret

LLVM IR (-O0):
define i32 @slen(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 %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @slen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int execute_sendfile() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_sendfile() {
ret i32 0
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ compare(int /*<<< orphan*/, char *);
int /*<<< orphan*/ failure(char *, char *);
int /*<<< orphan*/ list_back(struct list *);
void test_tail_data(struct list *list, char *data) {
  if (!compare(list_back(list), data))
    failure("tail should have been '%s'", data);
}


x86 assembly (clang, -O0):
<test_tail_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <list_back@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1050 <compare@plt>
cmp    $0x0,%eax
jne    116d <test_tail_data+0x3d>
mov    -0x10(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1040 <failure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tail_data>:
push   %rbx
mov    %rsi,%rbx
call   1030 <list_back@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <compare@plt>
test   %eax,%eax
je     1149 <test_tail_data+0x19>
pop    %rbx
ret
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <failure@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
@.str = [27 x i8] c"tail should have been '%s'\00"
define void @test_tail_data(%struct.list* %0, i8* %1) {
%3 = alloca %struct.list*
%4 = alloca i8*
store %struct.list* %0, %struct.list** %3
store i8* %1, i8** %4
%5 = load %struct.list*, %struct.list** %3
%6 = call i32 @list_back(%struct.list* %5)
%7 = load i8*, i8** %4
%8 = call i32 @compare(i32 %6, i8* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @failure(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
@.str = [27 x i8] c"tail should have been '%s'\00"
define void @test_tail_data(%struct.list* %0, i8* %1) {
%3 = tail call i32 @list_back(%struct.list* %0)
%4 = tail call i32 @compare(i32 %3, i8* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @failure(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int send(int, char *, int, int);
int internal__hydra_send(int socket, char *buf, int size, int options) {
  return send(socket, buf, size, options);
}


x86 assembly (clang, -O0):
<internal__hydra_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal__hydra_send>:
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define i32 @internal__hydra_send(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @send(i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
void camera_align() {}


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

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

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

LLVM IR (-O2):
define void @camera_align() {
ret void
}
int max(const int left, const int right) {
  return (left > right) ? left : right;
}


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

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

LLVM IR (-O0):
define i32 @max(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 sgt 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 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int errno;
int pthread_mutex_lock(int /*<<< orphan*/ *);
int tosMutex_lock(pthread_mutex_t *mx) {
  int res = 0;
  res = pthread_mutex_lock(mx);
  if (res) {
    errno = res;
    res = -1;
  }
  return res;
}


x86 assembly (clang, -O0):
<tosMutex_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_lock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114c <tosMutex_lock+0x3c>
mov    -0xc(%rbp),%ecx
mov    0x2e9d(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosMutex_lock>:
push   %rax
call   1030 <pthread_mutex_lock@plt>
test   %eax,%eax
je     112a <tosMutex_lock+0x1a>
mov    0x2ebf(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @tosMutex_lock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_lock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
store i32 %9, i32* @errno
store i32 -1, i32* %3
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @tosMutex_lock(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
store i32 %2, i32* @errno
br label %5
5: ; preds = %4, %1
%6 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
unsigned int crc32(unsigned int, unsigned char const *, unsigned int);
unsigned int f_crc32_(unsigned int *crc, const unsigned char *buf,
                      unsigned int *len) {
  return crc32(*crc, buf, *len);
}


x86 assembly (clang, -O0):
<f_crc32_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <crc32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_crc32_>:
mov    (%rdi),%edi
mov    (%rdx),%edx
jmp    1030 <crc32@plt>

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

LLVM IR (-O2):
define i32 @f_crc32_(i32* nocapture %0, i8* %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %2
%6 = tail call i32 @crc32(i32 %4, i8* %1, i32 %5)
ret i32 %6
}
int hex2dec(int c) {
  if (c >= 'A')
    return c - 'A' + 10;
  else
    return c - '0';
}


x86 assembly (clang, -O0):
<hex2dec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1122 <hex2dec+0x22>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    112b <hex2dec+0x2b>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2dec>:
lea    -0x30(%rdi),%ecx
lea    -0x37(%rdi),%eax
cmp    $0x41,%edi
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hex2dec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 65
%9 = add nsw i32 %8, 10
store i32 %9, i32* %2
br label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 48
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @hex2dec(i32 %0) {
%2 = icmp sgt i32 %0, 64
%3 = select i1 %2, i32 -55, i32 -48
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Type definitions */
struct utimbuf {
  int /*<<< orphan*/ modtime;
  int /*<<< orphan*/ actime;
};
struct stat {
  int /*<<< orphan*/ st_mtime;
  int /*<<< orphan*/ st_atime;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
struct utimbuf getBackupTimes(char *sourceFile, struct stat statbuf) {
  struct utimbuf backupTimes;
  stat(sourceFile, &statbuf);
  backupTimes.actime = statbuf.st_atime;
  backupTimes.modtime = statbuf.st_mtime;
  return backupTimes;
}


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

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

LLVM IR (-O0):
%struct.utimbuf = type { i32, i32 }
%struct.stat = type { i32, i32 }
define i64 @getBackupTimes(i8* %0, i64 %1) {
%3 = alloca %struct.utimbuf
%4 = alloca %struct.stat
%5 = alloca i8*
%6 = bitcast %struct.stat* %4 to i64*
store i64 %1, i64* %6
store i8* %0, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @stat(i8* %7, %struct.stat* %4)
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %3, i32 0, i32 1
store i32 %10, i32* %11
%12 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.utimbuf, %struct.utimbuf* %3, i32 0, i32 0
store i32 %13, i32* %14
%15 = bitcast %struct.utimbuf* %3 to i64*
%16 = load i64, i64* %15
ret i64 %16
}

LLVM IR (-O2):
%struct.stat = type { i32, i32 }
define i64 @getBackupTimes(i8* nocapture %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to %struct.stat*
store i64 %1, i64* %3
%5 = call i32 @stat(i8* %0, %struct.stat* %4)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %4, i64 0, i32 1
%7 = load i32, i32* %6
%8 = bitcast i64* %3 to i32*
%9 = load i32, i32* %8
%10 = zext i32 %7 to i64
%11 = shl nuw i64 %10, 32
%12 = zext i32 %9 to i64
%13 = or i64 %11, %12
ret i64 %13
}
float fabsf_neon_hfp(float x) {}


x86 assembly (clang, -O0):
<fabsf_neon_hfp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @fabsf_neon_hfp(float %0) {
ret float undef
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf40(int f, int n) { return (cbuf(f, n, 40)); }


x86 assembly (clang, -O0):
<cbuf40>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x28,%edx
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf40>:
mov    $0x28,%edx
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf40(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 40)
ret i32 %3
}
char *freeipmi_strchrnul(const char *s, int c) {
  const char *p = s;
  while (*p && (*p != c))
    p++;
  return (char *)p;
}


x86 assembly (clang, -O0):
<freeipmi_strchrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1138 <freeipmi_strchrnul+0x38>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1148 <freeipmi_strchrnul+0x48>
jmp    1159 <freeipmi_strchrnul+0x59>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <freeipmi_strchrnul+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeipmi_strchrnul>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1120 <freeipmi_strchrnul+0x20>
cmp    %esi,%ecx
jne    1110 <freeipmi_strchrnul+0x10>
ret

LLVM IR (-O0):
define i8* @freeipmi_strchrnul(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
store i8* %6, i8** %5
br label %7
7: ; preds = %20, %2
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i32, i32* %4
%17 = icmp ne i32 %15, %16
br label %18
18: ; preds = %12, %7
%19 = phi i1 [ false, %7 ], [ %17, %12 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %5
br label %7
23: ; preds = %18
%24 = load i8*, i8** %5
ret i8* %24
}

LLVM IR (-O2):
define i8* @freeipmi_strchrnul(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = sext i8 %5 to i32
%8 = icmp eq i32 %7, %1
%9 = or i1 %6, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_credits() {
  printf("Freecity CityMaker v.%s\n", "0.1");
  printf("Copyright (C) 2015 Paolo Niccolo Giubelli\n");
  printf("This software is distributed under the GNU Public License v.2\n");
}


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

x86 assembly (clang, -O2):
<print_credits>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeea(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Freecity CityMaker v.%s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
@.str.2 = [43 x i8] c"Copyright (C) 2015 Paolo Niccolo Giubelli\0A\00"
@.str.3 = [63 x i8] c"This software is distributed under the GNU Public License v.2\0A\00"
define void @print_credits() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Freecity CityMaker v.%s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
@str = [42 x i8] c"Copyright (C) 2015 Paolo Niccolo Giubelli\00"
@str.4 = [62 x i8] c"This software is distributed under the GNU Public License v.2\00"
define void @print_credits() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printSpeedometerNeedle(int);
int /*<<< orphan*/ printf(char *, int);
void redisplaySpeedometerNeedle(int speed) {
  printf("\x1b[%d;1H", 11);
  printSpeedometerNeedle(speed);
  printf("\x1b[%d;1H", 14);
  return;
}


x86 assembly (clang, -O0):
<redisplaySpeedometerNeedle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0xb,%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <printSpeedometerNeedle@plt>
lea    0xeb5(%rip),%rdi
mov    $0xe,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redisplaySpeedometerNeedle>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
mov    $0xb,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <printSpeedometerNeedle@plt>
mov    %r14,%rdi
mov    $0xe,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[%d;1H\00"
define void @redisplaySpeedometerNeedle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 11)
%4 = load i32, i32* %2
%5 = call i32 @printSpeedometerNeedle(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 14)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[%d;1H\00"
define void @redisplaySpeedometerNeedle(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 11)
%3 = tail call i32 @printSpeedometerNeedle(i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 14)
ret void
}
/* Type definitions */
struct stream {
  int dummy;
};

/* Variables and functions */
int decode_short_address(unsigned char const *, struct stream *);
int decode_short_address_is1(const unsigned char *pkt, struct stream *stream) {
  return decode_short_address(pkt, stream);
}


x86 assembly (clang, -O0):
<decode_short_address_is1>:
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 <decode_short_address@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_short_address_is1>:
jmp    1030 <decode_short_address@plt>

LLVM IR (-O0):
%struct.stream = type { i32 }
define i32 @decode_short_address_is1(i8* %0, %struct.stream* %1) {
%3 = alloca i8*
%4 = alloca %struct.stream*
store i8* %0, i8** %3
store %struct.stream* %1, %struct.stream** %4
%5 = load i8*, i8** %3
%6 = load %struct.stream*, %struct.stream** %4
%7 = call i32 @decode_short_address(i8* %5, %struct.stream* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stream = type { i32 }
define i32 @decode_short_address_is1(i8* %0, %struct.stream* %1) {
%3 = tail call i32 @decode_short_address(i8* %0, %struct.stream* %1)
ret i32 %3
}
/* Variables and functions */
int utf8_validate_cz(char const *);
int utf8_validate(const char *s) {
  int len;
  for (; *s != 0; s += len) {
    len = utf8_validate_cz(s);
    if (len == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<utf8_validate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1169 <utf8_validate+0x59>
mov    -0x10(%rbp),%rdi
call   1030 <utf8_validate_cz@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114e <utf8_validate+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1170 <utf8_validate+0x60>
jmp    1153 <utf8_validate+0x43>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <utf8_validate+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_validate>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmpb   $0x0,(%rdi)
je     113c <utf8_validate+0x2c>
mov    %rdi,%rbx
mov    %rbx,%rdi
call   1030 <utf8_validate_cz@plt>
test   %eax,%eax
je     113a <utf8_validate+0x2a>
cltq
cmpb   $0x0,(%rbx,%rax,1)
lea    (%rbx,%rax,1),%rbx
jne    1120 <utf8_validate+0x10>
jmp    113c <utf8_validate+0x2c>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @utf8_validate(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %8
%5 = phi i8* [ %10, %8 ], [ %0, %1 ]
%6 = tail call i32 @utf8_validate_cz(i8* %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = sext i32 %6 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %8, %1
%14 = phi i32 [ 1, %1 ], [ 1, %8 ], [ 0, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void key(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(0);
    break;
  }
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    113b <key+0x2b>
jmp    1134 <key+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
cmp    $0x1b,%dil
je     1117 <key+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}