xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float ft;
  printf("size of float: %d\n", sizeof ft);
  ft = 22.0 / 7.0;
  printf("%f", ft);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
movss  0xed6(%rip),%xmm0
call   1030 <printf@plt>
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
movss  0xed0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"size of float: %d\0A\00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float 4.000000e+00)
store float 0x4009249240000000, float* %2
%4 = load float, float* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"size of float: %d\0A\00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float 4.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float 0x4009249240000000)
ret i32 0
}
int fibonacci(int n) {
  if (n == 0)
    return 0;
  if (n == 1)
    return 1;
  return fibonacci(n - 1) + fibonacci(n - 2);
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fibonacci+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fibonacci+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fibonacci+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fibonacci+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fibonacci+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fibonacci+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fibonacci(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
void pathconN_nm4_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathconN_nm4_incref() {
ret void
}
/* Variables and functions */
double SIN_180(double);
double SIN_POS(double x) {
  if (x > 180)
    return SIN_180(x - 360. * (int)((x + 180.) / 360.));
  else
    return SIN_180(x);
}


x86 assembly (clang, -O0):
<SIN_POS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1179 <SIN_POS+0x69>
movsd  -0x10(%rbp),%xmm1
movsd  0xebf(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xec2(%rip),%xmm2
divsd  %xmm2,%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
movsd  0xea6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <SIN_180@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1188 <SIN_POS+0x78>
movsd  -0x10(%rbp),%xmm0
call   1030 <SIN_180@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIN_POS>:
ucomisd 0xee8(%rip),%xmm0
jbe    1142 <SIN_POS+0x32>
movsd  0xede(%rip),%xmm1
addsd  %xmm0,%xmm1
divsd  0xeda(%rip),%xmm1
cvttpd2dq %xmm1,%xmm1
cvtdq2pd %xmm1,%xmm1
mulsd  0xed2(%rip),%xmm1
addsd  %xmm1,%xmm0
jmp    1030 <SIN_180@plt>

LLVM IR (-O0):
define double @SIN_POS(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 1.800000e+02
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load double, double* %3
%8 = load double, double* %3
%9 = fadd double %8, 1.800000e+02
%10 = fdiv double %9, 3.600000e+02
%11 = fptosi double %10 to i32
%12 = sitofp i32 %11 to double
%13 = call double @llvm.fmuladd.f64(double -3.600000e+02, double %12, double %7)
%14 = call double @SIN_180(double %13)
store double %14, double* %2
br label %18
15: ; preds = %1
%16 = load double, double* %3
%17 = call double @SIN_180(double %16)
store double %17, double* %2
br label %18
18: ; preds = %15, %6
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
define double @SIN_POS(double %0) {
%2 = fcmp ogt double %0, 1.800000e+02
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = fadd double %0, 1.800000e+02
%5 = fdiv double %4, 3.600000e+02
%6 = fptosi double %5 to i32
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %7, double -3.600000e+02, double %0)
br label %9
9: ; preds = %1, %3
%10 = phi double [ %8, %3 ], [ %0, %1 ]
%11 = tail call double @SIN_180(double %10)
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ __NR_lseek;
int /*<<< orphan*/ syscall_3(int /*<<< orphan*/, long, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void rewind(FILE *stream) {
  syscall_3(__NR_lseek, (long int)stream, 0, SEEK_SET);
}


x86 assembly (clang, -O0):
<rewind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    0x2eb0(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
call   1030 <syscall_3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewind>:
mov    %rdi,%rsi
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    0x2ebd(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
jmp    1030 <syscall_3@plt>

LLVM IR (-O0):
@__NR_lseek = global i32 0
@SEEK_SET = global i32 0
define void @rewind(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @__NR_lseek
%4 = load i32*, i32** %2
%5 = ptrtoint i32* %4 to i64
%6 = load i32, i32* @SEEK_SET
%7 = call i32 @syscall_3(i32 %3, i64 %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
@__NR_lseek = global i32 0
@SEEK_SET = global i32 0
define void @rewind(i32* %0) {
%2 = load i32, i32* @__NR_lseek
%3 = ptrtoint i32* %0 to i64
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @syscall_3(i32 %2, i64 %3, i32 0, i32 %4)
ret void
}
/* Variables and functions */
double *fss_NewDouble(int);
void allocating_memory_double1D(double **item, int columns) {
  double *it = fss_NewDouble(columns);
  *item = it;
}


x86 assembly (clang, -O0):
<allocating_memory_double1D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <fss_NewDouble@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocating_memory_double1D>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <fss_NewDouble@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @allocating_memory_double1D(double** %0, i32 %1) {
%3 = alloca double**
%4 = alloca i32
%5 = alloca double*
store double** %0, double*** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call double* @fss_NewDouble(i32 %6)
store double* %7, double** %5
%8 = load double*, double** %5
%9 = load double**, double*** %3
store double* %8, double** %9
ret void
}

LLVM IR (-O2):
define void @allocating_memory_double1D(double** nocapture writeonly %0, i32 %1) {
%3 = tail call double* @fss_NewDouble(i32 %1)
store double* %3, double** %0
ret void
}
/* Variables and functions */
__attribute__((visibility("default"))) void *sd_resolve_ref(void *resolve) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_resolve_ref(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ __u32;
typedef int /*<<< orphan*/ __le32;

/* Variables and functions */
int /*<<< orphan*/ __swab32p(int /*<<< orphan*/ *);
__u32 __le32_to_cpup(const __le32 *p) { return __swab32p((__u32 *)p); }


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

x86 assembly (clang, -O2):
<__le32_to_cpup>:
jmp    1030 <__swab32p@plt>

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

LLVM IR (-O2):
define i32 @__le32_to_cpup(i32* %0) {
%2 = tail call i32 @__swab32p(i32* %0)
ret i32 %2
}
void dcc_sigchld_handler(int UNUSED_sig __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @dcc_sigchld_handler(i32 %0) {
ret void
}
int trace_stack(a, b)
int a;
int b;
{ return 1; }


x86 assembly (clang, -O0):
<trace_stack>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @trace_stack(i32 %0, i32 %1) {
ret i32 1
}
int __neat_wow(struct neat *self, char a) {
  if (a == 'a') {
    return 3;
  } else {
    return 2;
  }
}


x86 assembly (clang, -O0):
<__neat_wow>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x61,%eax
jne    1127 <__neat_wow+0x27>
movl   $0x3,-0x4(%rbp)
jmp    112e <__neat_wow+0x2e>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__neat_wow>:
xor    %eax,%eax
cmp    $0x61,%sil
sete   %al
or     $0x2,%eax
ret

LLVM IR (-O0):
%struct.neat = type opaque
define i32 @__neat_wow(%struct.neat* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca %struct.neat*
%5 = alloca i8
store %struct.neat* %0, %struct.neat** %4
store i8 %1, i8* %5
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 97
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 3, i32* %3
br label %11
10: ; preds = %2
store i32 2, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
%struct.neat = type opaque
define i32 @__neat_wow(%struct.neat* nocapture readnone %0, i8 signext %1) {
%3 = icmp eq i8 %1, 97
%4 = select i1 %3, i32 3, i32 2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_INT2_OUTPUT() { set_io_bit(0x45, 2); }


x86 assembly (clang, -O0):
<TOSH_MAKE_INT2_OUTPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45,%edi
mov    $0x2,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_INT2_OUTPUT>:
mov    $0x45,%edi
mov    $0x2,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_INT2_OUTPUT() {
%1 = call i32 @set_io_bit(i32 69, i32 2)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_INT2_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 69, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__19__IO__selectModuleFunc();
void HplMsp430Usart0P__UCLK__selectModuleFunc(void) {
  HplMsp430GeneralIOP__19__IO__selectModuleFunc();
}


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

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

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

LLVM IR (-O2):
define void @HplMsp430Usart0P__UCLK__selectModuleFunc() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__19__IO__selectModuleFunc()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void checkFileOpening(const FILE *pointer) {
  if (!pointer) {
    perror("Error opening file");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkFileOpening>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1151 <checkFileOpening+0x31>
lea    0xec2(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkFileOpening>:
test   %rdi,%rdi
je     1126 <checkFileOpening+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <perror@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Error opening file\00"
@EXIT_FAILURE = global i32 0
define void @checkFileOpening(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Error opening file\00"
@EXIT_FAILURE = global i32 0
define void @checkFileOpening(i32* readnone %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret void
}
void canonicalize(char *buffer) {
  char *reader, *writer;
  reader = writer = buffer;
  while (*reader) {
    *writer = *reader;
    if (*reader != '\r')
      writer++;
    reader++;
  }
  *writer = *reader;
}


x86 assembly (clang, -O0):
<canonicalize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <canonicalize+0x5a>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     1149 <canonicalize+0x49>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <canonicalize+0x14>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<canonicalize>:
mov    (%rdi),%al
test   %al,%al
je     1129 <canonicalize+0x29>
lea    0x1(%rdi),%rcx
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
movzbl (%rcx),%eax
xor    %edx,%edx
cmpb   $0xd,-0x1(%rcx)
setne  %dl
add    %rdx,%rdi
add    $0x1,%rcx
test   %al,%al
jne    1110 <canonicalize+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @canonicalize(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
store i8 %5, i8* %6
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 13
%10 = zext i1 %9 to i64
%11 = getelementptr i8, i8* %6, i64 %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i8* [ %0, %1 ], [ %11, %4 ]
store i8 0, i8* %16
ret void
}
int omap_cfg_probe(unsigned long reg_cfg) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omap_cfg_probe(i64 %0) {
ret i32 0
}
void ALNTrace(const char *pszFmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @ALNTrace(i8* nocapture %0, ...) {
ret void
}
unsigned int fhtIntegerLog2(unsigned int v) {
  unsigned int i = 0;
  while (v > 1) {
    ++i;
    v >>= 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<fhtIntegerLog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jbe    112f <fhtIntegerLog2+0x2f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <fhtIntegerLog2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fhtIntegerLog2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <fhtIntegerLog2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <fhtIntegerLog2+0x10>
ret

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

LLVM IR (-O2):
define i32 @fhtIntegerLog2(i32 %0) {
%2 = icmp ugt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *xfopen(const char *pathname, const char *mode) {
  FILE *fp = fopen(pathname, mode);
  if (fp == NULL) {
    ;
  }
  return fp;
}


x86 assembly (clang, -O0):
<xfopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1141 <xfopen+0x31>
jmp    1141 <xfopen+0x31>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfopen>:
jmp    1030 <fopen@plt>

LLVM IR (-O0):
define i32* @xfopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %2
%13 = load i32*, i32** %5
ret i32* %13
}

LLVM IR (-O2):
define noalias i32* @xfopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XConfigureEvent;

/* Variables and functions */
int get_XConfigureEvent_x(void *_p) { return (int)((XConfigureEvent *)_p)->x; }


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

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

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

LLVM IR (-O2):
define i32 @get_XConfigureEvent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int say(int socket, char *s) {
  int res = send(socket, s, strlen(s), 0);
  if (res == -1)
    error("Error talking to the client");
  return res;
}


x86 assembly (clang, -O0):
<say>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    117f <say+0x4f>
lea    0xe86(%rip),%rdi
call   1050 <error@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<say>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1161 <say+0x31>
lea    0xea4(%rip),%rdi
call   1050 <error@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Error talking to the client\00"
define i32 @say(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @send(i32 %6, i8* %7, i32 %9, i32 0)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@.str = [28 x i8] c"Error talking to the client\00"
define i32 @say(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %3, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i32 %4
}
void ARGBToRGB565DitherRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRGB565DitherRow_NEON() {
ret void
}
void video_set_lut(unsigned int index, unsigned char r, unsigned char g,
                   unsigned char b) {}


x86 assembly (clang, -O0):
<video_set_lut>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %edi,-0x4(%rbp)
mov    %dl,-0x5(%rbp)
mov    %cl,-0x6(%rbp)
mov    %al,-0x7(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @video_set_lut(i32 %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i32 %0, i32* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
ret void
}

LLVM IR (-O2):
define void @video_set_lut(i32 %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
ret void
}
long write(long fd, const void *buffer, unsigned long size) {
  long ret = 0;
  asm("movq $4,%%rax  \n\t"
      "movq %1,%%rbx \n\t"
      "movq %2,%%rcx  \n\t"
      "movq %3,%%rdx \n\t"
      "int $0x80  \n\t"
      "movq %%rax,%0 \n\t"
      : "=m"(ret)
      : "m"(fd), "m"(buffer), "m"(size));
  return ret;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    $0x4,%rax
mov    -0x8(%rbp),%rbx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
int    $0x80
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    %rdx,-0x18(%rsp)
movq   $0x0,-0x20(%rsp)
mov    $0x4,%rax
mov    -0x8(%rsp),%rbx
mov    -0x10(%rsp),%rcx
mov    -0x18(%rsp),%rdx
int    $0x80
mov    %rax,-0x20(%rsp)
mov    -0x20(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @write(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i64 0, i64* %7
%8 = load i64, i64* %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @write(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = bitcast i64* %7 to i8*
store i64 0, i64* %7
%9 = load i64, i64* %7
ret i64 %9
}
unsigned int ppc64_decode_local_entry(unsigned int other) {
  return ((1 << other) >> 2) << 2;
}


x86 assembly (clang, -O0):
<ppc64_decode_local_entry>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sar    $0x2,%eax
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppc64_decode_local_entry>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @ppc64_decode_local_entry(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
%5 = ashr i32 %4, 2
%6 = shl i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @ppc64_decode_local_entry(i32 %0) {
%2 = shl nuw i32 1, %0
%3 = and i32 %2, -4
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ h2o_strcopytolower(char *, char *, size_t);
void h2o_strtolower(char *s, size_t len) { h2o_strcopytolower(s, s, len); }


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

x86 assembly (clang, -O2):
<h2o_strtolower>:
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <h2o_strcopytolower@plt>

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

LLVM IR (-O2):
define void @h2o_strtolower(i8* %0, i64 %1) {
%3 = tail call i32 @h2o_strcopytolower(i8* %0, i8* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __buf_size_arg_constraint(char *, int);
int /*<<< orphan*/ clang_analyzer_eval(int);
void test_buf_size_symbolic_and_offset(int s) {
  char buf[3];
  __buf_size_arg_constraint(buf + 1, s);
  clang_analyzer_eval(s <= 2);
}


x86 assembly (clang, -O0):
<test_buf_size_symbolic_and_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x7(%rbp),%rdi
add    $0x1,%rdi
mov    -0x4(%rbp),%esi
call   1030 <__buf_size_arg_constraint@plt>
cmpl   $0x2,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_buf_size_symbolic_and_offset>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xe(%rsp),%rdi
mov    %ebx,%esi
call   1030 <__buf_size_arg_constraint@plt>
xor    %edi,%edi
cmp    $0x3,%ebx
setl   %dil
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test_buf_size_symbolic_and_offset(i32 %0) {
%2 = alloca i32
%3 = alloca [3 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i32, i32* %2
%7 = call i32 @__buf_size_arg_constraint(i8* %5, i32 %6)
%8 = load i32, i32* %2
%9 = icmp sle i32 %8, 2
%10 = zext i1 %9 to i32
%11 = call i32 @clang_analyzer_eval(i32 %10)
ret void
}

LLVM IR (-O2):
define void @test_buf_size_symbolic_and_offset(i32 %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%5 = call i32 @__buf_size_arg_constraint(i8* %4, i32 %0)
%6 = icmp slt i32 %0, 3
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}
int test_imm_78uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x78 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_78uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7864320
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
long revbin_0(unsigned long);
unsigned long revbin(unsigned long x, unsigned long ldn) {
  return revbin_0(x) >> (8L * sizeof(unsigned long) - ldn);
}


x86 assembly (clang, -O0):
<revbin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <revbin_0@plt>
mov    $0x40,%ecx
sub    -0x10(%rbp),%rcx
sar    %cl,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<revbin>:
push   %rbx
mov    %rsi,%rbx
call   1030 <revbin_0@plt>
neg    %bl
mov    %ebx,%ecx
sar    %cl,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @revbin(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i64 @revbin_0(i64 %5)
%7 = load i64, i64* %4
%8 = sub i64 64, %7
%9 = ashr i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @revbin(i64 %0, i64 %1) {
%3 = tail call i64 @revbin_0(i64 %0)
%4 = sub i64 64, %1
%5 = ashr i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f(void) { printf("N is undefined\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"N is undefined\00"
define void @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
int fftw_ct_uglyp(int min_n, int n, int r) {
  return (n <= min_n) ||
         ((((n) > 0) && (((n) & ((n)-1)) == 0)) && (n / r) <= 4);
}


x86 assembly (clang, -O0):
<fftw_ct_uglyp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0xd(%rbp)
jle    115c <fftw_ct_uglyp+0x5c>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xe(%rbp)
jle    1156 <fftw_ct_uglyp+0x56>
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
and    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xe(%rbp)
jne    1156 <fftw_ct_uglyp+0x56>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x4,%eax
setle  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fftw_ct_uglyp>:
mov    $0x1,%eax
cmp    %edi,%esi
jle    115c <fftw_ct_uglyp+0x5c>
xor    %eax,%eax
test   %esi,%esi
jle    115c <fftw_ct_uglyp+0x5c>
mov    %edx,%ecx
mov    %esi,%edx
shr    %edx
and    $0x55555555,%edx
mov    %esi,%edi
sub    %edx,%edi
mov    %edi,%edx
and    $0x33333333,%edx
shr    $0x2,%edi
and    $0x33333333,%edi
add    %edx,%edi
mov    %edi,%edx
shr    $0x4,%edx
add    %edi,%edx
and    $0xf0f0f0f,%edx
imul   $0x1010101,%edx,%edx
shr    $0x18,%edx
cmp    $0x1,%edx
ja     115c <fftw_ct_uglyp+0x5c>
mov    %esi,%eax
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x5,%ecx
setl   %al
ret

LLVM IR (-O0):
define i32 @fftw_ct_uglyp(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %26, label %10
10: ; preds = %3
%11 = load i32, i32* %5
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %24
13: ; preds = %10
%14 = load i32, i32* %5
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 1
%17 = and i32 %14, %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %13
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = sdiv i32 %20, %21
%23 = icmp sle i32 %22, 4
br label %24
24: ; preds = %19, %13, %10
%25 = phi i1 [ false, %13 ], [ false, %10 ], [ %23, %19 ]
br label %26
26: ; preds = %24, %3
%27 = phi i1 [ true, %3 ], [ %25, %24 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @fftw_ct_uglyp(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = icmp sgt i32 %1, 0
%7 = tail call i32 @llvm.ctpop.i32(i32 %1)
%8 = icmp ult i32 %7, 2
%9 = and i1 %6, %8
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = sdiv i32 %1, %2
%12 = icmp slt i32 %11, 5
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %5, %10, %3
%15 = phi i32 [ 1, %3 ], [ 0, %5 ], [ %13, %10 ]
ret i32 %15
}
/* Variables and functions */
void glmDegrees3f(float out[3], const float radians[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = (180.0f / 3.14159265358979323846) * radians[i];
}


x86 assembly (clang, -O0):
<glmDegrees3f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    115e <glmDegrees3f+0x5e>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec8(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <glmDegrees3f+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmDegrees3f>:
movss  (%rsi),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xef0(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @glmDegrees3f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i64
store float* %0, float** %3
store float* %1, float** %4
store i64 0, i64* %5
br label %6
6: ; preds = %20, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 3
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load float*, float** %4
%11 = load i64, i64* %5
%12 = getelementptr inbounds float, float* %10, i64 %11
%13 = load float, float* %12
%14 = fpext float %13 to double
%15 = fmul double 0x404CA5DC1A63C1F8, %14
%16 = fptrunc double %15 to float
%17 = load float*, float** %3
%18 = load i64, i64* %5
%19 = getelementptr inbounds float, float* %17, i64 %18
store float %16, float* %19
br label %20
20: ; preds = %9
%21 = load i64, i64* %5
%22 = add i64 %21, 1
store i64 %22, i64* %5
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @glmDegrees3f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = fpext float %3 to double
%5 = fmul double %4, 0x404CA5DC1A63C1F8
%6 = fptrunc double %5 to float
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = fmul double %9, 0x404CA5DC1A63C1F8
%11 = fptrunc double %10 to float
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = fpext float %14 to double
%16 = fmul double %15, 0x404CA5DC1A63C1F8
%17 = fptrunc double %16 to float
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
void msm_pm_set_l2_flush_flag(unsigned int flag) {}


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

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

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

LLVM IR (-O2):
define void @msm_pm_set_l2_flush_flag(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn1();
int /*<<< orphan*/ fn2();
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  while (1) {
    fn1();
    sleep(2);
    fn2();
    sleep(2);
  }
  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    $0x0,%al
call   1030 <fn1@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1040 <fn2@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <fn1@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1040 <fn2@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
jmp    1140 <main+0x10>

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
br label %6
6: ; preds = %2, %6
%7 = call i32 (...) @fn1()
%8 = call i32 @sleep(i32 2)
%9 = call i32 (...) @fn2()
%10 = call i32 @sleep(i32 2)
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 (...) @fn1()
%5 = tail call i32 @sleep(i32 2)
%6 = tail call i32 (...) @fn2()
%7 = tail call i32 @sleep(i32 2)
br label %3
}
void basic_timer_release(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void pigsty_ini(FILE *pigsty) { fprintf(pigsty, "["); }


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

x86 assembly (clang, -O2):
<pigsty_ini>:
mov    %rdi,%rsi
mov    $0x5b,%edi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"[\00"
define void @pigsty_ini(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @pigsty_ini(i32* nocapture %0) {
%2 = tail call i32 @fputc(i32 91, i32* %0)
ret void
}
int fireMissile(int (*board)[][10], int row, int col) {
  if ((*board)[row][col] != 0) {
    (*board)[row][col] = 9;
    return 1;
  } else {
    (*board)[row][col] = 8;
    return 0;
  }
}


x86 assembly (clang, -O0):
<fireMissile>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1151 <fireMissile+0x51>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movl   $0x9,(%rax,%rcx,4)
movl   $0x1,-0x4(%rbp)
jmp    1172 <fireMissile+0x72>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movl   $0x8,(%rax,%rcx,4)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fireMissile>:
movslq %esi,%rax
movslq %edx,%rcx
lea    (%rax,%rax,4),%rax
lea    (%rdi,%rax,8),%rdx
xor    %eax,%eax
xor    %esi,%esi
cmpl   $0x0,(%rdx,%rcx,4)
setne  %al
sete   %sil
xor    $0x9,%esi
mov    %esi,(%rdx,%rcx,4)
ret

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

LLVM IR (-O2):
define i32 @fireMissile([0 x [10 x i32]]* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [0 x [10 x i32]], [0 x [10 x i32]]* %0, i64 0, i64 %4, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 8, i32 9
%10 = xor i1 %8, true
%11 = zext i1 %10 to i32
store i32 %9, i32* %6
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, size_t);
size_t string_length(char *);
int main(void) {
  char *name = "Martin";
  size_t length = string_length(name);
  printf("The name:%s has Length: %ld\n", name, length);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <string_length@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Martin\00"
@.str.1 = [29 x i8] c"The name:%s has Length: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @string_length(i8* %4)
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %6, i64 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Martin\00"
@.str.1 = [29 x i8] c"The name:%s has Length: %ld\0A\00"
define i32 @main() {
%1 = tail call i64 @string_length(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello, world.\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello, world.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}