xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void print_matrix_row(double *row, int num_cols) {
  for (int j = 0; j < num_cols; j++) {
    printf("%f ", row[j]);
  }
}


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

x86 assembly (clang, -O2):
<print_matrix_row>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <print_matrix_row+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_matrix_row+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f \00"
define void @print_matrix_row(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
void __arch_pause(void) { __asm__("  pause;" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @__arch_pause() {
tail call void asm sideeffect " pause;", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int execute_readlink() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_readlink() {
ret i32 0
}
double f4_cb_send_pre_int_int_int_int_double(double (*cb)(int, int, int, int,
                                                          double)) {
  double r = 66.0;
  return cb(8, 9, 10, 11, r) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_pre_int_int_int_int_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
call   *%rax
movsd  0xec0(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_pre_int_int_int_int_double>:
push   %rax
mov    %rdi,%rax
movsd  0xef4(%rip),%xmm0
mov    $0x8,%edi
mov    $0x9,%esi
mov    $0xa,%edx
mov    $0xb,%ecx
call   *%rax
addsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_pre_int_int_int_int_double(double (i32, i32, i32, i32, double)* %0) {
%2 = alloca double (i32, i32, i32, i32, double)*
%3 = alloca double
store double (i32, i32, i32, i32, double)* %0, double (i32, i32, i32, i32, double)** %2
store double 6.600000e+01, double* %3
%4 = load double (i32, i32, i32, i32, double)*, double (i32, i32, i32, i32, double)** %2
%5 = load double, double* %3
%6 = call double %4(i32 8, i32 9, i32 10, i32 11, double %5)
%7 = fadd double %6, 1.000000e+00
ret double %7
}

LLVM IR (-O2):
define double @f4_cb_send_pre_int_int_int_int_double(double (i32, i32, i32, i32, double)* nocapture %0) {
%2 = tail call double %0(i32 8, i32 9, i32 10, i32 11, double 6.600000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
int test_imm_DBuint32_reg(unsigned int val) {
  return ((val) & (0xDB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DBuint32_reg(i32 %0) {
%2 = and i32 %0, 219
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int print_message(const char *msg) {
  printf("A STRING : %s \n", msg);
  return 0;
}


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

x86 assembly (clang, -O2):
<print_message>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"A STRING : %s \0A\00"
define i32 @print_message(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M35_f(char *s) {
  debug("M35_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M35_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M35_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M35_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M35_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M35_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M35_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
size_t read(int, void *, size_t);
ssize_t safe_read(int desc, void *ptr, size_t len) {
  ssize_t n_chars;
  if (len <= 0)
    return len;
  n_chars = read(desc, ptr, len);
  return n_chars;
}


x86 assembly (clang, -O0):
<safe_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
ja     113b <safe_read+0x2b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <safe_read+0x47>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <read@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_read>:
test   %rdx,%rdx
je     111a <safe_read+0xa>
jmp    1030 <read@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @safe_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i64 @read(i32 %0, i8* %1, i64 %2)
br label %7
7: ; preds = %3, %5
%8 = phi i64 [ %6, %5 ], [ 0, %3 ]
ret i64 %8
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
long round(int);
long timespec_to_usec_long(struct timespec *ts) {
  return round((ts->tv_sec * 1E9 + ts->tv_nsec) / 1000.0);
}


x86 assembly (clang, -O0):
<timespec_to_usec_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x4(%rax),%xmm1
movsd  0xed3(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xebb(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <round@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_usec_long>:
cvtsi2sdl (%rdi),%xmm0
cvtsi2sdl 0x4(%rdi),%xmm1
mulsd  0xedf(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  0xedb(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <round@plt>

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i64 @timespec_to_usec_long(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = call double @llvm.fmuladd.f64(double %6, double 1.000000e+09, double %10)
%12 = fdiv double %11, 1.000000e+03
%13 = fptosi double %12 to i32
%14 = call i64 @round(i32 %13)
ret i64 %14
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i64 @timespec_to_usec_long(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %4, double 1.000000e+09, double %7)
%9 = fdiv double %8, 1.000000e+03
%10 = fptosi double %9 to i32
%11 = tail call i64 @round(i32 %10)
ret i64 %11
}
/* Variables and functions */
int O_APPEND;
int /*<<< orphan*/ O_CREAT;
int O_RDWR;
int /*<<< orphan*/ S_IWUSR;
int open(char *, int, ...);
int main(void) {
  int fd1;
  int fd2;
  fd1 = open("/tmp/foo1", O_RDWR | O_APPEND);
  fd2 = open("/tmp/foo2", O_CREAT, S_IWUSR);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    0x2e91(%rip),%rax
or     (%rax),%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <open@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    0x2e86(%rip),%rax
mov    (%rax),%edx
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <open@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <open@plt>
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <open@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/tmp/foo1\00"
@O_RDWR = global i32 0
@O_APPEND = global i32 0
@.str.1 = [10 x i8] c"/tmp/foo2\00"
@O_CREAT = global i32 0
@S_IWUSR = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @O_RDWR
%5 = load i32, i32* @O_APPEND
%6 = or i32 %4, %5
%7 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* @O_CREAT
%9 = load i32, i32* @S_IWUSR
%10 = call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
store i32 %10, i32* %3
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/tmp/foo1\00"
@O_RDWR = global i32 0
@O_APPEND = global i32 0
@.str.1 = [10 x i8] c"/tmp/foo2\00"
@O_CREAT = global i32 0
@S_IWUSR = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_APPEND
%3 = or i32 %2, %1
%4 = tail call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @O_CREAT
%6 = load i32, i32* @S_IWUSR
%7 = tail call i32 (i8*, i32, ...) @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void overflow() { err(2, "expression is too complex"); }


x86 assembly (clang, -O0):
<overflow>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xee0(%rip),%rsi
call   1030 <err@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<overflow>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
jmp    1030 <err@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"expression is too complex\00"
define void @overflow() {
%1 = call i32 @err(i32 2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"expression is too complex\00"
define void @overflow() {
%1 = tail call i32 @err(i32 2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int a[], int l, int u) {
  int j;
  if (l < u) {
    j = partition(a, l, u);
    quick_sort(a, l, j - 1);
    quick_sort(a, j + 1, u);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
unsigned int hashMap_hashCode(const void *toHash) {
  intptr_t address = (intptr_t)toHash;
  return address;
}


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

x86 assembly (clang, -O2):
<hashMap_hashCode>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i32 @hashMap_hashCode(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @hashMap_hashCode(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
int c(int n) { return sizeof(int[n]); }


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = mul nuw i64 4, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @c(i32 %0) {
%2 = shl i32 %0, 2
ret i32 %2
}
int f(long long x) {
  x >>= 8;
  return x & 0xff;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i32 @f(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 8
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = and i64 %5, 255
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = lshr i32 %2, 8
%4 = and i32 %3, 255
ret i32 %4
}
double MStoSecondDouble(int timeLimit) {
  return (double)(((double)timeLimit) / 1000.0);
}


x86 assembly (clang, -O0):
<MStoSecondDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MStoSecondDouble>:
cvtsi2sd %edi,%xmm0
divsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @MStoSecondDouble(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+03
ret double %5
}

LLVM IR (-O2):
define double @MStoSecondDouble(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fdiv double %2, 1.000000e+03
ret double %3
}
void SSIEnable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) |= 0x00000002;
}


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

x86 assembly (clang, -O2):
<SSIEnable>:
orq    $0x2,0x4(%rdi)
ret

LLVM IR (-O0):
define void @SSIEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 4
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 2
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @SSIEnable(i64 %0) {
%2 = add i64 %0, 4
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 2
store volatile i64 %5, i64* %3
ret void
}
/* Type definitions */
struct SLL {
  int dummy;
};
typedef int /*<<< orphan*/ A;

/* Variables and functions */
struct SLL *SLL_create(int const, int const *);
int /*<<< orphan*/ SLL_destroy(struct SLL *);
int main() {
  int const A[] = {1, 2, 3, 4, 5};
  int const n = sizeof(A) / sizeof(A[0]);
  struct SLL *sll = SLL_create(n, A);
  SLL_destroy(sll);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x5,-0x24(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x5,%edi
call   1040 <SLL_create@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <SLL_destroy@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
call   1040 <SLL_create@plt>
mov    %rax,%rdi
call   1030 <SLL_destroy@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.SLL = type { i32 }
@__const.main.A = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = alloca %struct.SLL*
store i32 0, i32* %1
%5 = bitcast [5 x i32]* %2 to i8*
store i32 5, i32* %3
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%7 = call %struct.SLL* @SLL_create(i32 5, i32* %6)
store %struct.SLL* %7, %struct.SLL** %4
%8 = load %struct.SLL*, %struct.SLL** %4
%9 = call i32 @SLL_destroy(%struct.SLL* %8)
ret i32 0
}

LLVM IR (-O2):
%struct.SLL = type { i32 }
@__const.main.A = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call %struct.SLL* @SLL_create(i32 5, i32* %3)
%5 = call i32 @SLL_destroy(%struct.SLL* %4)
ret i32 0
}
int vnc__exit(struct framebuffer *fb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.framebuffer = type opaque
define i32 @vnc__exit(%struct.framebuffer* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delay();
void onesec(void) {
  int i;
  for (i = 0; i < 1000000; ++i)
    delay();
}


x86 assembly (clang, -O0):
<onesec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jge    1141 <onesec+0x31>
mov    $0x0,%al
call   1030 <delay@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <onesec+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onesec>:
push   %rbx
mov    $0xf4240,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <delay@plt>
add    $0xffffffff,%ebx
jne    1120 <onesec+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @onesec() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 1000000
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 (...) @delay()
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @onesec() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @delay()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1000000
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mumps_io_get_file_name(int *, char *, int *, int *);
void mumps_ooc_get_file_name_c(int *type, int *indice, int *length, char *name,
                               int l1) {
  int type_loc, indice_loc, length_loc;
  type_loc = (int)*type;
  indice_loc = (int)*indice;
  mumps_io_get_file_name(&indice_loc, name, &length_loc, &type_loc);
  *length = (int)length_loc;
  return;
}


x86 assembly (clang, -O0):
<mumps_ooc_get_file_name_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rsi
lea    -0x2c(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1030 <mumps_io_get_file_name@plt>
mov    -0x30(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mumps_ooc_get_file_name_c>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    (%rdi),%eax
mov    %eax,0xc(%rsp)
mov    (%rsi),%eax
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rdx
lea    0xc(%rsp),%rax
mov    %rcx,%rsi
mov    %rax,%rcx
call   1030 <mumps_io_get_file_name@plt>
mov    0x4(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @mumps_ooc_get_file_name_c(i32* %0, i32* %1, i32* %2, i8* %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
store i32 %15, i32* %11
%16 = load i32*, i32** %7
%17 = load i32, i32* %16
store i32 %17, i32* %12
%18 = load i8*, i8** %9
%19 = call i32 @mumps_io_get_file_name(i32* %12, i8* %18, i32* %13, i32* %11)
%20 = load i32, i32* %13
%21 = load i32*, i32** %8
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
define void @mumps_ooc_get_file_name_c(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %6 to i8*
%10 = bitcast i32* %7 to i8*
%11 = bitcast i32* %8 to i8*
%12 = load i32, i32* %0
store i32 %12, i32* %6
%13 = load i32, i32* %1
store i32 %13, i32* %7
%14 = call i32 @mumps_io_get_file_name(i32* %7, i8* %3, i32* %8, i32* %6)
%15 = load i32, i32* %8
store i32 %15, i32* %2
ret void
}
int do_168() { return 168; }


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

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

LLVM IR (-O0):
define i32 @do_168() {
ret i32 168
}

LLVM IR (-O2):
define i32 @do_168() {
ret i32 168
}
char count_channels(char mask) {
  int i = 0;
  char count = 0;
  for (i = 0; i < 8; i++) {
    count = count + ((mask & (1 << i)) >> i);
  }
  return count;
}


x86 assembly (clang, -O0):
<count_channels>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1156 <count_channels+0x56>
movsbl -0x9(%rbp),%eax
movsbl -0x1(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    %esi,%ecx
and    %ecx,%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <count_channels+0x1c>
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_channels>:
mov    %edi,%eax
and    $0x1,%al
mov    %edi,%ecx
shr    %cl
and    $0x1,%cl
add    %al,%cl
mov    %edi,%eax
shr    $0x2,%al
and    $0x1,%al
add    %cl,%al
mov    %edi,%ecx
shr    $0x3,%cl
and    $0x1,%cl
add    %al,%cl
mov    %edi,%eax
shr    $0x4,%al
and    $0x1,%al
add    %cl,%al
mov    %edi,%ecx
shr    $0x5,%cl
and    $0x1,%cl
add    %al,%cl
mov    %edi,%eax
shr    $0x6,%al
and    $0x1,%al
add    %cl,%al
shr    $0x7,%dil
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @count_channels(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i8
store i8 %0, i8* %2
store i32 0, i32* %3
store i8 0, i8* %4
store i32 0, i32* %3
br label %5
5: ; preds = %20, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %23
8: ; preds = %5
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = load i32, i32* %3
%14 = shl i32 1, %13
%15 = and i32 %12, %14
%16 = load i32, i32* %3
%17 = ashr i32 %15, %16
%18 = add nsw i32 %10, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %4
br label %20
20: ; preds = %8
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %5
23: ; preds = %5
%24 = load i8, i8* %4
ret i8 %24
}

LLVM IR (-O2):
define signext i8 @count_channels(i8 signext %0) {
%2 = and i8 %0, 1
%3 = lshr i8 %0, 1
%4 = and i8 %3, 1
%5 = add nuw nsw i8 %2, %4
%6 = lshr i8 %0, 2
%7 = and i8 %6, 1
%8 = add nuw nsw i8 %5, %7
%9 = lshr i8 %0, 3
%10 = and i8 %9, 1
%11 = add nuw nsw i8 %8, %10
%12 = lshr i8 %0, 4
%13 = and i8 %12, 1
%14 = add nuw nsw i8 %11, %13
%15 = lshr i8 %0, 5
%16 = and i8 %15, 1
%17 = add nuw nsw i8 %14, %16
%18 = lshr i8 %0, 6
%19 = and i8 %18, 1
%20 = add nuw nsw i8 %17, %19
%21 = lshr i8 %0, 7
%22 = add nuw nsw i8 %20, %21
ret i8 %22
}
/* Variables and functions */
__attribute__((nonnull(1))) int func2(char *cp) { return (cp != NULL) ? 1 : 0; }


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @func2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @func2(i8* nocapture readnone %0) {
ret i32 1
}
void ice_dcbnl_setup(struct ice_vsi *vsi) {}


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

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

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

LLVM IR (-O2):
%struct.ice_vsi = type opaque
define void @ice_dcbnl_setup(%struct.ice_vsi* nocapture %0) {
ret void
}
void cacheflush(void *p) {}


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

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

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

LLVM IR (-O2):
define void @cacheflush(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mapif_sendall(unsigned char *, int);
int mapif_checklock_guild_storage(int guild_id) {
  unsigned char buf[6];
  (*(unsigned short *)(((unsigned char *)(buf)) + (0))) = 0x381c;
  (*(unsigned int *)(((unsigned char *)(buf)) + (2))) = guild_id;
  mapif_sendall(buf, 6);
  return 0;
}


x86 assembly (clang, -O0):
<mapif_checklock_guild_storage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movw   $0x381c,-0xa(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0xa(%rbp),%rdi
mov    $0x6,%esi
call   1030 <mapif_sendall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapif_checklock_guild_storage>:
push   %rax
movw   $0x381c,0x2(%rsp)
mov    %edi,0x4(%rsp)
lea    0x2(%rsp),%rdi
mov    $0x6,%esi
call   1030 <mapif_sendall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mapif_checklock_guild_storage(i32 %0) {
%2 = alloca i32
%3 = alloca [6 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = bitcast i8* %5 to i16*
store i16 14364, i16* %6
%7 = load i32, i32* %2
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds i8, i8* %8, i64 2
%10 = bitcast i8* %9 to i32*
store i32 %7, i32* %10
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%12 = call i32 @mapif_sendall(i8* %11, i32 6)
ret i32 0
}

LLVM IR (-O2):
define i32 @mapif_checklock_guild_storage(i32 %0) {
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%4 = bitcast [6 x i8]* %2 to i16*
store i16 14364, i16* %4
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 2
%6 = bitcast i8* %5 to i32*
store i32 %0, i32* %6
%7 = call i32 @mapif_sendall(i8* %3, i32 6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void fsubp() {
  db(0xDE);
  db(0xE9);
}


x86 assembly (clang, -O0):
<fsubp>:
push   %rbp
mov    %rsp,%rbp
mov    $0xde,%edi
call   1030 <db@plt>
mov    $0xe9,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsubp>:
push   %rax
mov    $0xde,%edi
call   1030 <db@plt>
mov    $0xe9,%edi
pop    %rax
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @fsubp() {
%1 = call i32 @db(i32 222)
%2 = call i32 @db(i32 233)
ret void
}

LLVM IR (-O2):
define void @fsubp() {
%1 = tail call i32 @db(i32 222)
%2 = tail call i32 @db(i32 233)
ret void
}
f(x) {
  int i;
  for (i = 0; i < 8 && (x & 1) == 0; x >>= 1, i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x8,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jge    112c <f+0x2c>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113c <f+0x3c>
jmp    1158 <f+0x58>
jmp    1141 <f+0x41>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <f+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
test   $0x1,%dil
jne    115b <f+0x5b>
mov    $0x1,%eax
test   $0x2,%dil
jne    115b <f+0x5b>
mov    $0x2,%eax
test   $0x4,%dil
jne    115b <f+0x5b>
mov    $0x3,%eax
test   $0x8,%dil
jne    115b <f+0x5b>
mov    $0x4,%eax
test   $0x10,%dil
jne    115b <f+0x5b>
mov    $0x5,%eax
test   $0x20,%dil
jne    115b <f+0x5b>
mov    $0x6,%eax
test   $0x40,%dil
jne    115b <f+0x5b>
and    $0x80,%edi
cmp    $0x1,%edi
mov    $0x7,%eax
adc    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %26
4: ; preds = %1
%5 = and i32 %0, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %26
7: ; preds = %4
%8 = and i32 %0, 4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = and i32 %0, 8
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %26
13: ; preds = %10
%14 = and i32 %0, 16
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = and i32 %0, 32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %16
%20 = and i32 %0, 64
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = and i32 %0, 128
%24 = icmp eq i32 %23, 0
%25 = select i1 %24, i32 8, i32 7
br label %26
26: ; preds = %22, %4, %7, %10, %13, %16, %19, %1
%27 = phi i32 [ 0, %1 ], [ 1, %4 ], [ 2, %7 ], [ 3, %10 ], [ 4, %13 ], [ 5, %16 ], [ 6, %19 ], [ %25, %22 ]
ret i32 %27
}
/* Variables and functions */
char *stringprep_convert(char const *, char *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ stringprep_locale_charset();
char *stringprep_locale_to_utf8(const char *str) {
  return stringprep_convert(str, "UTF-8", stringprep_locale_charset(), 0);
}


x86 assembly (clang, -O0):
<stringprep_locale_to_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <stringprep_locale_charset@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
lea    0xeb8(%rip),%rsi
xor    %ecx,%ecx
call   1040 <stringprep_convert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringprep_locale_to_utf8>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <stringprep_locale_charset@plt>
lea    0xece(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
xor    %ecx,%ecx
pop    %rbx
jmp    1040 <stringprep_convert@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"UTF-8\00"
define i8* @stringprep_locale_to_utf8(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @stringprep_locale_charset()
%5 = call i8* @stringprep_convert(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4, i32 0)
ret i8* %5
}

LLVM IR (-O2):
@.str = [6 x i8] c"UTF-8\00"
define i8* @stringprep_locale_to_utf8(i8* %0) {
%2 = tail call i32 (...) @stringprep_locale_charset()
%3 = tail call i8* @stringprep_convert(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2, i32 0)
ret i8* %3
}
swap(a, b) register int *a, *b;
{
  int c;
  c = *a;
  *a = *b;
  *b = c;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ toFlag(char const *, int *);
int toFlags(int flags, const char *modes) {
  int nflags = flags;
  toFlag(modes, &nflags);
  return nflags;
}


x86 assembly (clang, -O0):
<toFlags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <toFlag@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toFlags>:
push   %rax
mov    %rsi,%rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %rax,%rdi
call   1030 <toFlag@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @toFlags(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
store i32 %6, i32* %5
%7 = load i8*, i8** %4
%8 = call i32 @toFlag(i8* %7, i32* %5)
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @toFlags(i32 %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 %0, i32* %3
%5 = call i32 @toFlag(i8* %1, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}
void L_SaveConfig(void) {}


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

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

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

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

/* Variables and functions */
void cpy1(void *a, const void *b) { *(uint8_t *)a = *(uint8_t *)b; }


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

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

LLVM IR (-O0):
define void @cpy1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret void
}

LLVM IR (-O2):
define void @cpy1(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wiringXSPIDataRW(int /*<<< orphan*/, unsigned char *, int);
void clearDisplaySPI() {
  unsigned char spi_data[1] = {0x76};
  wiringXSPIDataRW(0, spi_data, 1);
}


x86 assembly (clang, -O0):
<clearDisplaySPI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <wiringXSPIDataRW@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearDisplaySPI>:
push   %rax
movb   $0x76,0x7(%rsp)
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <wiringXSPIDataRW@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.clearDisplaySPI.spi_data = [1 x i8] c"v"
define void @clearDisplaySPI() {
%1 = alloca [1 x i8]
%2 = bitcast [1 x i8]* %1 to i8*
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%4 = call i32 @wiringXSPIDataRW(i32 0, i8* %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @clearDisplaySPI() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 118, i8* %2
%3 = call i32 @wiringXSPIDataRW(i32 0, i8* %2, i32 1)
ret void
}
void free_array_of_pairs(int **array_of_pairs) {
  free(array_of_pairs[0]);
  free(array_of_pairs);
}


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

x86 assembly (clang, -O2):
<free_array_of_pairs>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_array_of_pairs(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = getelementptr inbounds i32*, i32** %3, i64 0
%5 = load i32*, i32** %4
%6 = bitcast i32* %5 to i8*
%7 = load i32**, i32*** %2
%8 = bitcast i32** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @free_array_of_pairs(i32** nocapture %0) {
%2 = bitcast i32** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast i32** %0 to i8*
tail call void @free(i8* %4)
ret void
}
void GFX_drawText(int x, int y, int len, short *text, int handle, int argb,
                  int clipX, int clipY, int clipW, int clipH) {}


x86 assembly (clang, -O0):
<GFX_drawText>:
push   %rbp
mov    %rsp,%rbp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @GFX_drawText(i32 %0, i32 %1, i32 %2, i16* %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i16*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 %0, i32* %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store i16* %3, i16** %14
store i32 %4, i32* %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
store i32 %9, i32* %20
ret void
}

LLVM IR (-O2):
define void @GFX_drawText(i32 %0, i32 %1, i32 %2, i16* nocapture %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
ret void
}
/* Variables and functions */
float __ocml_erfinv_f32(float);
float erfinvf(float x) { return __ocml_erfinv_f32(x); }


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

x86 assembly (clang, -O2):
<erfinvf>:
jmp    1030 <__ocml_erfinv_f32@plt>

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

LLVM IR (-O2):
define float @erfinvf(float %0) {
%2 = tail call float @__ocml_erfinv_f32(float %0)
ret float %2
}
void indicate_turn_dir() {}


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

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

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

LLVM IR (-O2):
define void @indicate_turn_dir() {
ret void
}
void manpage() { return; }


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

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

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

LLVM IR (-O2):
define void @manpage() {
ret void
}
/* Variables and functions */
int ENOSYS;
int /*<<< orphan*/ printf(char *, int);
int raise(int sig) {
  printf("Someone called raise! (signal: %d)\n", sig);
  return -ENOSYS;
}


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    0x2eb5(%rip),%rcx
sub    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ec2(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Someone called raise! (signal: %d)\0A\00"
@ENOSYS = global i32 0
define i32 @raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @ENOSYS
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@.str = [36 x i8] c"Someone called raise! (signal: %d)\0A\00"
@ENOSYS = global i32 0
define i32 @raise(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}