xunge/DecIR huggingface dataset:
/* Variables and functions */
double mod360_positive(double);
double mod360(double vin) { return mod360_positive(vin + 180) - 180; }


x86 assembly (clang, -O0):
<mod360>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <mod360_positive@plt>
movsd  0xec9(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod360>:
push   %rax
addsd  0xee7(%rip),%xmm0
call   1030 <mod360_positive@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mod360(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.800000e+02
%5 = call double @mod360_positive(double %4)
%6 = fsub double %5, 1.800000e+02
ret double %6
}

LLVM IR (-O2):
define double @mod360(double %0) {
%2 = fadd double %0, 1.800000e+02
%3 = tail call double @mod360_positive(double %2)
%4 = fadd double %3, -1.800000e+02
ret double %4
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ printf(char *, size_t, void *);
void *parrt_malloc(size_t n) {
  void *p = malloc(n);
  printf("malloc %zu -> %p\n", n, p);
  return p;
}


x86 assembly (clang, -O0):
<parrt_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parrt_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xeca(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"malloc %zu -> %p\0A\00"
define i8* @parrt_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i64, i64* %2
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %6, i8* %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [18 x i8] c"malloc %zu -> %p\0A\00"
define i8* @parrt_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %0, i8* %2)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ gmx_lie(int, char **);
int main(int argc, char *argv[]) {
  gmx_lie(argc, argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_lie@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <gmx_lie@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_lie(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *myThreadFun(void *vargp) {
  sleep(15);
  printf("Printing GeeksQuiz from Thread \n");
  while (1 == 1) {
    printf("still waiting\n");
    sleep(5);
  }
}


x86 assembly (clang, -O0):
<myThreadFun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xf,%edi
call   1040 <sleep@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
jmp    1142 <myThreadFun+0x22>

x86 assembly (clang, -O2):
<myThreadFun>:
push   %rbx
mov    $0xf,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
jmp    1140 <myThreadFun+0x20>

LLVM IR (-O0):
@.str = [33 x i8] c"Printing GeeksQuiz from Thread \0A\00"
@.str.1 = [15 x i8] c"still waiting\0A\00"
define i8* @myThreadFun(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sleep(i32 15)
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @sleep(i32 5)
br label %5
}

LLVM IR (-O2):
@str = [32 x i8] c"Printing GeeksQuiz from Thread \00"
@str.2 = [14 x i8] c"still waiting\00"
define noalias i8* @myThreadFun(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 15)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 5)
br label %4
}
void eglGetProcAddress(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglGetProcAddress() {
ret void
}
int test_imm_93uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x93 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_93uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 9633792
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void ar_close(int fd) {
  assert(fd >= 0);
  if (close(fd) == -1) {
    fprintf(stderr, "File could not be closed\n");
  }
}


x86 assembly (clang, -O0):
<ar_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1172 <ar_close+0x42>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ar_close>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1040 <assert@plt>
mov    %ebx,%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     114b <ar_close+0x1b>
pop    %rbx
ret
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
pop    %rbx
jmp    1050 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"File could not be closed\0A\00"
define void @ar_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @close(i32 %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"File could not be closed\0A\00"
define void @ar_close(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @close(i32 %0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %1
ret void
}
/* Variables and functions */
void Reserved_Handler11(void) {
  while (1)
    ;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_h48_12_sse4() {
ret void
}
/* Type definitions */
struct file_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ get_char(struct file_state *, char const *);
char *next_char(struct file_state *, char const *, int);
scalar_t__ octdigitp(int /*<<< orphan*/);
const char *after_octdigits(struct file_state *file, const char *ptr) {
  while (octdigitp(get_char(file, ptr))) {
    ptr = next_char(file, ptr, 1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<after_octdigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <get_char@plt>
mov    %eax,%edi
call   1040 <octdigitp@plt>
cmp    $0x0,%rax
je     1179 <after_octdigits+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <next_char@plt>
mov    %rax,-0x10(%rbp)
jmp    1140 <after_octdigits+0x10>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<after_octdigits>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
call   1050 <get_char@plt>
mov    %eax,%edi
call   1040 <octdigitp@plt>
test   %rax,%rax
je     116c <after_octdigits+0x3c>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <next_char@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
jmp    1140 <after_octdigits+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.file_state = type { i32 }
define i8* @after_octdigits(%struct.file_state* %0, i8* %1) {
%3 = alloca %struct.file_state*
%4 = alloca i8*
store %struct.file_state* %0, %struct.file_state** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %11, %2
%6 = load %struct.file_state*, %struct.file_state** %3
%7 = load i8*, i8** %4
%8 = call i32 @get_char(%struct.file_state* %6, i8* %7)
%9 = call i64 @octdigitp(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %5
%12 = load %struct.file_state*, %struct.file_state** %3
%13 = load i8*, i8** %4
%14 = call i8* @next_char(%struct.file_state* %12, i8* %13, i32 1)
store i8* %14, i8** %4
br label %5
15: ; preds = %5
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
%struct.file_state = type { i32 }
define i8* @after_octdigits(%struct.file_state* %0, i8* %1) {
%3 = tail call i32 @get_char(%struct.file_state* %0, i8* %1)
%4 = tail call i64 @octdigitp(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %8, %6 ], [ %1, %2 ]
%8 = tail call i8* @next_char(%struct.file_state* %0, i8* %7, i32 1)
%9 = tail call i32 @get_char(%struct.file_state* %0, i8* %8)
%10 = tail call i64 @octdigitp(i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = phi i8* [ %1, %2 ], [ %8, %6 ]
ret i8* %13
}
double sign_wrapper(double *arg_list) { return -arg_list[0]; }


x86 assembly (clang, -O0):
<sign_wrapper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_wrapper>:
movsd  (%rdi),%xmm0
xorps  0xef5(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sign_wrapper(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fneg double %5
ret double %6
}

LLVM IR (-O2):
define double @sign_wrapper(double* nocapture %0) {
%2 = load double, double* %0
%3 = fneg double %2
ret double %3
}
int GetFZ(int my, int y, int nh) {
  float yp = (float)y * (float)my / (float)nh;
  return (int)yp;
}


x86 assembly (clang, -O0):
<GetFZ>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
cvttss2si -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFZ>:
cvtsi2ss %esi,%xmm0
cvtsi2ss %edi,%xmm1
cvtsi2ss %edx,%xmm2
mulss  %xmm0,%xmm1
divss  %xmm2,%xmm1
cvttss2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @GetFZ(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = sitofp i32 %8 to float
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to float
%12 = fmul float %9, %11
%13 = load i32, i32* %6
%14 = sitofp i32 %13 to float
%15 = fdiv float %12, %14
store float %15, float* %7
%16 = load float, float* %7
%17 = fptosi float %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @GetFZ(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %1 to float
%5 = sitofp i32 %0 to float
%6 = fmul float %5, %4
%7 = sitofp i32 %2 to float
%8 = fdiv float %6, %7
%9 = fptosi float %8 to i32
ret i32 %9
}
void doTimeLimit() {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @doTimeLimit() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
struct fsm {
  int dummy;
};

/* Variables and functions */
struct fsm *fsm_empty_set();
struct fsm *fsm_empty_string();
struct fsm *fsm_boolean(int value) {
  if (value == 0)
    return (fsm_empty_set());
  else
    return (fsm_empty_string());
}


x86 assembly (clang, -O0):
<fsm_boolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1145 <fsm_boolean+0x25>
mov    $0x0,%al
call   1030 <fsm_empty_set@plt>
mov    %rax,-0x8(%rbp)
jmp    1150 <fsm_boolean+0x30>
mov    $0x0,%al
call   1040 <fsm_empty_string@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsm_boolean>:
xor    %eax,%eax
test   %edi,%edi
je     112b <fsm_boolean+0xb>
jmp    1040 <fsm_empty_string@plt>
jmp    1030 <fsm_empty_set@plt>

LLVM IR (-O0):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_boolean(i32 %0) {
%2 = alloca %struct.fsm*
%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 %8
6: ; preds = %1
%7 = call %struct.fsm* (...) @fsm_empty_set()
store %struct.fsm* %7, %struct.fsm** %2
br label %10
8: ; preds = %1
%9 = call %struct.fsm* (...) @fsm_empty_string()
store %struct.fsm* %9, %struct.fsm** %2
br label %10
10: ; preds = %8, %6
%11 = load %struct.fsm*, %struct.fsm** %2
ret %struct.fsm* %11
}

LLVM IR (-O2):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_boolean(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call %struct.fsm* (...) @fsm_empty_set()
br label %7
5: ; preds = %1
%6 = tail call %struct.fsm* (...) @fsm_empty_string()
br label %7
7: ; preds = %5, %3
%8 = phi %struct.fsm* [ %4, %3 ], [ %6, %5 ]
ret %struct.fsm* %8
}
const char *sudirript_mark_str(void) {
  static const char sm[] = {'\3', '\0'};
  return sm;
}


x86 assembly (clang, -O0):
<sudirript_mark_str>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sudirript_mark_str>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@sudirript_mark_str.sm = internal constant [2 x i8] c"\03\00"
define i8* @sudirript_mark_str() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @sudirript_mark_str.sm, i64 0, i64 0)
}

LLVM IR (-O2):
@sudirript_mark_str.sm = internal constant [2 x i8] c"\03\00"
define i8* @sudirript_mark_str() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @sudirript_mark_str.sm, i64 0, i64 0)
}
int val_from_tt(int val, int ply) {
  if (val >= ((29000) - (127)))
    val -= ply;
  else if (val <= -((29000) - (127)))
    val += ply;
  return val;
}


x86 assembly (clang, -O0):
<val_from_tt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x70c9,-0x4(%rbp)
jl     1127 <val_from_tt+0x27>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <val_from_tt+0x42>
cmpl   $0xffff8f37,-0x4(%rbp)
jg     113d <val_from_tt+0x3d>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <val_from_tt+0x42>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_from_tt>:
xor    %eax,%eax
cmp    $0xffff8f38,%edi
cmovl  %esi,%eax
neg    %esi
cmp    $0x70c9,%edi
cmovge %esi,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @val_from_tt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 28872
%4 = icmp slt i32 %0, -28872
%5 = select i1 %4, i32 %1, i32 0
%6 = sub i32 0, %1
%7 = select i1 %3, i32 %6, i32 %5
%8 = add i32 %7, %0
ret i32 %8
}
int syslinux_adv_write(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @syslinux_adv_write() {
ret i32 0
}
void gtk_icon_view_select_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_select_path() {
ret void
}
void mbr_print_file(const char *level, const int debug_mask, const char *fmt,
                    ...) {}


x86 assembly (clang, -O0):
<mbr_print_file>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mbr_print_file(i8* %0, i32 %1, i8* %2, ...) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @mbr_print_file(i8* nocapture %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ loadpal(char const *);
int /*<<< orphan*/ make_hash();
void palette_init(const char *filename) {
  loadpal(filename);
  make_hash();
}


x86 assembly (clang, -O0):
<palette_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <loadpal@plt>
mov    $0x0,%al
call   1040 <make_hash@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<palette_init>:
push   %rax
call   1030 <loadpal@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <make_hash@plt>

LLVM IR (-O0):
define void @palette_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @loadpal(i8* %3)
%5 = call i32 (...) @make_hash()
ret void
}

LLVM IR (-O2):
define void @palette_init(i8* %0) {
%2 = tail call i32 @loadpal(i8* %0)
%3 = tail call i32 (...) @make_hash()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_js_utf8_enabled() { exit(1); }


x86 assembly (clang, -O0):
<caml_js_utf8_enabled>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_js_utf8_enabled>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_js_utf8_enabled() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_js_utf8_enabled() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
int mistery4(int *arg0) {
  if (arg0 == 0) {
    return 0;
  }
  return *(arg0 - 0x8);
}


x86 assembly (clang, -O0):
<mistery4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <mistery4+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1129 <mistery4+0x29>
mov    -0x10(%rbp),%rax
mov    -0x20(%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mistery4>:
test   %rdi,%rdi
je     1109 <mistery4+0x9>
mov    -0x20(%rdi),%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mistery4(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = getelementptr inbounds i32, i32* %0, i64 -8
%5 = load i32, i32* %4
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void failed(const char *s) {
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<failed>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @failed(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @failed(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ main(int);
void start() { main(5); }


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <main@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
mov    $0x5,%edi
jmp    1030 <main@plt>

LLVM IR (-O0):
define void @start() {
%1 = call i32 @main(i32 5)
ret void
}

LLVM IR (-O2):
define void @start() {
%1 = tail call i32 @main(i32 5)
ret void
}
int test_imm_1Cuint16_reg(unsigned short val) {
  return ((val) & (-0x1C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Cuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffe4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_1Cuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -28
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
adrx0indreg1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((((double *)10000000)[x0]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0indreg1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movslq -0x1c(%rbp),%rcx
mov    $0x989680,%eax
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1148 <adrx0indreg1+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <adrx0indreg1+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0indreg1>:
movslq %edi,%rdx
movsd  (%rcx),%xmm0
xor    %eax,%eax
ucomisd 0x989680(,%rdx,8),%xmm0
setae  %al
ret

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

LLVM IR (-O2):
define i32 @adrx0indreg1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %7
%9 = load double, double* %8
%10 = load double, double* %5
%11 = fcmp ole double %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ I2C_writeCmd(int, unsigned char, unsigned char);
void VCNL4000_writeCmd(unsigned char reg, unsigned char cmd) {
  I2C_writeCmd(0x13, reg, cmd);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    $0x13,%edi
movzbl %al,%esi
movzbl -0x2(%rbp),%edx
call   1030 <I2C_writeCmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %esi,%edx
mov    %edi,%esi
mov    $0x13,%edi
jmp    1030 <I2C_writeCmd@plt>

LLVM IR (-O0):
define void @VCNL4000_writeCmd(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call i32 @I2C_writeCmd(i32 19, i8 zeroext %5, i8 zeroext %6)
ret void
}

LLVM IR (-O2):
define void @VCNL4000_writeCmd(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @I2C_writeCmd(i32 19, i8 zeroext %0, i8 zeroext %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void update_compression(uint64_t symbol) {}


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

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

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

LLVM IR (-O2):
define void @update_compression(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ getloadavg(double *, int);
char *smprintf(char *, ...);
char *loadavg(void) {
  double avgs[1];
  if (getloadavg(avgs, 1) < 0)
    return smprintf("");
  return smprintf("%.2f", avgs[0]);
}


x86 assembly (clang, -O0):
<loadavg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <getloadavg@plt>
cmp    $0x0,%rax
jge    1157 <loadavg+0x37>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <smprintf@plt>
mov    %rax,-0x8(%rbp)
jmp    116e <loadavg+0x4e>
movsd  -0x10(%rbp),%xmm0
lea    0xe9d(%rip),%rdi
mov    $0x1,%al
call   1030 <smprintf@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadavg>:
push   %rax
mov    %rsp,%rdi
mov    $0x1,%esi
call   1040 <getloadavg@plt>
test   %rax,%rax
js     1148 <loadavg+0x28>
movsd  (%rsp),%xmm0
lea    0xec1(%rip),%rdi
mov    $0x1,%al
call   1030 <smprintf@plt>
pop    %rcx
ret
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1030 <smprintf@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"%.2f\00"
define i8* @loadavg() {
%1 = alloca i8*
%2 = alloca [1 x double]
%3 = getelementptr inbounds [1 x double], [1 x double]* %2, i64 0, i64 0
%4 = call i64 @getloadavg(double* %3, i32 1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i8* (i8*, ...) @smprintf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %1
br label %12
8: ; preds = %0
%9 = getelementptr inbounds [1 x double], [1 x double]* %2, i64 0, i64 0
%10 = load double, double* %9
%11 = call i8* (i8*, ...) @smprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %10)
store i8* %11, i8** %1
br label %12
12: ; preds = %8, %6
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"%.2f\00"
define i8* @loadavg() {
%1 = alloca [1 x double]
%2 = bitcast [1 x double]* %1 to i8*
%3 = getelementptr inbounds [1 x double], [1 x double]* %1, i64 0, i64 0
%4 = call i64 @getloadavg(double* %3, i32 1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i8* (i8*, ...) @smprintf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %0
%9 = load double, double* %3
%10 = call i8* (i8*, ...) @smprintf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double %9)
br label %11
11: ; preds = %8, %6
%12 = phi i8* [ %7, %6 ], [ %10, %8 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ fct2(int, long long, long long, long long, long long, long long,
                long long, long long, long long);
int __attribute__((sysv_abi)) main() {
  if (fct2(-1, 1ll, 2ll, 3ll, 4ll, 5ll, 6ll, 7ll, 0ll) != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
xor    %eax,%eax
movq   $0x6,(%rsp)
movq   $0x7,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1040 <fct2@plt>
cmp    $0x0,%rax
je     1181 <main+0x61>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
mov    $0xffffffff,%edi
push   $0x0
push   $0x7
push   $0x6
call   1040 <fct2@plt>
add    $0x20,%rsp
test   %rax,%rax
jne    115d <main+0x3d>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @fct2(i32 -1, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 0)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @fct2(i32 -1, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void scc_socket_change_params(int port) {}


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

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

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

LLVM IR (-O2):
define void @scc_socket_change_params(i32 %0) {
ret void
}
/* Variables and functions */
int setevent(char *, char *);
int event_enable_all(void) { return setevent("events/enable", "1"); }


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

x86 assembly (clang, -O2):
<event_enable_all>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
jmp    1030 <setevent@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"events/enable\00"
@.str.1 = [2 x i8] c"1\00"
define i32 @event_enable_all() {
%1 = call i32 @setevent(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"events/enable\00"
@.str.1 = [2 x i8] c"1\00"
define i32 @event_enable_all() {
%1 = tail call i32 @setevent(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int extractKeyFromGet(char *);
int extractKeyFromPut(char *);
int getOrPut(char *);
int forYou(int num, char request[]) {
  int k;
  if (getOrPut(request) == 1)
    k = extractKeyFromGet(request);
  else
    k = extractKeyFromPut(request);
  if ((k % 2) == num)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<forYou>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <getOrPut@plt>
cmp    $0x1,%eax
jne    1162 <forYou+0x32>
mov    -0x10(%rbp),%rdi
call   1050 <extractKeyFromGet@plt>
mov    %eax,-0x14(%rbp)
jmp    116e <forYou+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <extractKeyFromPut@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    -0x8(%rbp),%edx
jne    118e <forYou+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1195 <forYou+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forYou>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <getOrPut@plt>
mov    %rbx,%rdi
cmp    $0x1,%eax
jne    114f <forYou+0x1f>
call   1050 <extractKeyFromGet@plt>
jmp    1154 <forYou+0x24>
call   1030 <extractKeyFromPut@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
xor    %ecx,%ecx
cmp    %ebp,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @forYou(i32 %0, i8* %1) {
%3 = tail call i32 @getOrPut(i8* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @extractKeyFromGet(i8* %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @extractKeyFromPut(i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = srem i32 %10, 2
%12 = icmp eq i32 %11, %0
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned hweight32(uint32_t x) {
  uint32_t w = x - ((x >> 1) & 0x55555555);
  w = (w & 0x33333333) + ((w >> 2) & 0x33333333);
  w = (w + (w >> 4)) & 0x0F0F0F0F;
  w = w + (w >> 8);
  return (w + (w >> 16)) & 0x000000FF;
}


x86 assembly (clang, -O0):
<hweight32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55555555,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x33333333,%eax
mov    -0x8(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x10,%ecx
add    %ecx,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight32>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
add    %ecx,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @hweight32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = and i32 %6, 1431655765
%8 = sub nsw i32 %4, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = and i32 %9, 858993459
%11 = load i32, i32* %3
%12 = ashr i32 %11, 2
%13 = and i32 %12, 858993459
%14 = add nsw i32 %10, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %3
%17 = ashr i32 %16, 4
%18 = add nsw i32 %15, %17
%19 = and i32 %18, 252645135
store i32 %19, i32* %3
%20 = load i32, i32* %3
%21 = load i32, i32* %3
%22 = ashr i32 %21, 8
%23 = add nsw i32 %20, %22
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = load i32, i32* %3
%26 = ashr i32 %25, 16
%27 = add nsw i32 %24, %26
%28 = and i32 %27, 255
ret i32 %28
}

LLVM IR (-O2):
define i32 @hweight32(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub nsw i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = lshr i32 %11, 8
%13 = add nuw nsw i32 %12, %11
%14 = lshr i32 %13, 16
%15 = add nuw nsw i32 %14, %13
%16 = and i32 %15, 63
ret i32 %16
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ ece391_strlen(int /*<<< orphan*/ const *);
int /*<<< orphan*/ ece391_write(int /*<<< orphan*/, int /*<<< orphan*/ const *,
                                int /*<<< orphan*/);
void ece391_fdputs(int32_t fd, const uint8_t *s) {
  (void)ece391_write(fd, s, ece391_strlen(s));
}


x86 assembly (clang, -O0):
<ece391_fdputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ece391_strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <ece391_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ece391_fdputs>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <ece391_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ece391_write@plt>

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

LLVM IR (-O2):
define void @ece391_fdputs(i32 %0, i32* %1) {
%3 = tail call i32 @ece391_strlen(i32* %1)
%4 = tail call i32 @ece391_write(i32 %0, i32* %1, i32 %3)
ret void
}
char *hash_plugin_summary(void) {
  return ("md5unix \tMD5(Unix) plugin (shadow files)");
}


x86 assembly (clang, -O0):
<hash_plugin_summary>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_summary>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [41 x i8] c"md5unix \09MD5(Unix) plugin (shadow files)\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [41 x i8] c"md5unix \09MD5(Unix) plugin (shadow files)\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0)
}
int f(int a) { return a + 1; }


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

x86 assembly (clang, -O2):
<f>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int getnum();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  while (1) {
    int leitura = getnum();
    printf("Você pressionou '%d'!\n", leitura);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getnum@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getnum@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [24 x i8] c"Voc\C3\AA pressionou '%d'!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @getnum()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %3
}

LLVM IR (-O2):
@.str = [24 x i8] c"Voc\C3\AA pressionou '%d'!\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @getnum()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ uart_write(int /*<<< orphan*/);
void uart_print(char *msg) {
  while (*msg != 0)
    uart_write(*msg++);
}


x86 assembly (clang, -O0):
<uart_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <uart_print+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <uart_write@plt>
jmp    111c <uart_print+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_print>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart_print+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uart_write@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart_print+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart_print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @uart_write(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int getCellIdRight(int cellId) {
  if ((cellId + 1) % 8 == 0)
    return -1;
  return cellId + 1;
}


x86 assembly (clang, -O0):
<getCellIdRight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112a <getCellIdRight+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1133 <getCellIdRight+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCellIdRight>:
lea    0x1(%rdi),%ecx
mov    %ecx,%eax
and    $0x7,%eax
cmp    $0x1,%eax
sbb    %eax,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getCellIdRight(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = and i32 %2, 7
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -1, i32 %2
ret i32 %5
}
unsigned long long f2ulz(float a) { return (unsigned long long)a; }


x86 assembly (clang, -O0):
<f2ulz>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm2
movaps %xmm0,%xmm1
subss  %xmm2,%xmm1
cvttss2si %xmm1,%rcx
cvttss2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2ulz>:
cvttss2si %xmm0,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subss  0xeec(%rip),%xmm0
cvttss2si %xmm0,%rax
and    %rdx,%rax
or     %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @f2ulz(float %0) {
%2 = fptoui float %0 to i64
ret i64 %2
}