xunge/DecIR huggingface dataset:
long _power(long EV_base, long EV_exponent) {
  long EV_product;
  EV_product = 1;
  while ((EV_exponent > 0)) {
    EV_product = (EV_product * EV_base);
    EV_exponent = (EV_exponent - 1);
  }
  return EV_product;
}


x86 assembly (clang, -O0):
<_power>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    113d <_power+0x3d>
mov    -0x18(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <_power+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_power>:
test   %rsi,%rsi
jle    111b <_power+0x1b>
lea    -0x1(%rsi),%rax
mov    %esi,%ecx
and    $0x7,%ecx
cmp    $0x7,%rax
jae    1121 <_power+0x21>
mov    $0x1,%eax
jmp    1156 <_power+0x56>
mov    $0x1,%eax
ret
and    $0xfffffffffffffff8,%rsi
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
imul   %rdi,%rax
add    $0xfffffffffffffff8,%rsi
jne    1130 <_power+0x30>
test   %rcx,%rcx
je     116a <_power+0x6a>
nopl   0x0(%rax,%rax,1)
imul   %rdi,%rax
add    $0xffffffffffffffff,%rcx
jne    1160 <_power+0x60>
ret

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

LLVM IR (-O2):
define i64 @_power(i64 %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %33
4: ; preds = %2
%5 = add i64 %1, -1
%6 = and i64 %1, 7
%7 = icmp ult i64 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i64 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi i64 [ 1, %8 ], [ %20, %10 ]
%12 = phi i64 [ 0, %8 ], [ %21, %10 ]
%13 = mul nsw i64 %11, %0
%14 = mul nsw i64 %13, %0
%15 = mul nsw i64 %14, %0
%16 = mul nsw i64 %15, %0
%17 = mul nsw i64 %16, %0
%18 = mul nsw i64 %17, %0
%19 = mul nsw i64 %18, %0
%20 = mul nsw i64 %19, %0
%21 = add i64 %12, 8
%22 = icmp eq i64 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi i64 [ undef, %4 ], [ %20, %10 ]
%25 = phi i64 [ 1, %4 ], [ %20, %10 ]
%26 = icmp eq i64 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi i64 [ %30, %27 ], [ %25, %23 ]
%29 = phi i64 [ %31, %27 ], [ 0, %23 ]
%30 = mul nsw i64 %28, %0
%31 = add i64 %29, 1
%32 = icmp eq i64 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi i64 [ 1, %2 ], [ %24, %23 ], [ %30, %27 ]
ret i64 %34
}
/* Variables and functions */
void *mmap(void *, size_t, int, int, int, long);
__attribute__((weak)) void *__real_mmap(void *addr, size_t len, int prot,
                                        int flags, int fd, long off) {
  return mmap(addr, len, prot, flags, fd, off);
}


x86 assembly (clang, -O0):
<__real_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9
call   1030 <mmap@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__real_mmap>:
jmp    1030 <mmap@plt>

LLVM IR (-O0):
define weak i8* @__real_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i64 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i64
store i8* %0, i8** %7
store i64 %1, i64* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i64 %5, i64* %12
%13 = load i8*, i8** %7
%14 = load i64, i64* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i64, i64* %12
%19 = call i8* @mmap(i8* %13, i64 %14, i32 %15, i32 %16, i32 %17, i64 %18)
ret i8* %19
}

LLVM IR (-O2):
define weak i8* @__real_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i64 %5) {
%7 = tail call i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i64 %5)
ret i8* %7
}
double swt_abs(double sigIn) {
  if (sigIn >= 0)
    return sigIn;
  else
    return (-1 * sigIn);
}


x86 assembly (clang, -O0):
<swt_abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112a <swt_abs+0x2a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113c <swt_abs+0x3c>
movsd  0xece(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<swt_abs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
cmpnlesd %xmm0,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @swt_abs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %3
store double %7, double* %2
br label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = fmul double -1.000000e+00, %9
store double %10, double* %2
br label %11
11: ; preds = %8, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @swt_abs(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ OLED_write_char(char const);
void OLED_write_string(const char *string) {
  while (*string != 0) {
    OLED_write_char(*string);
    ++string;
  }
}


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

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

LLVM IR (-O0):
define void @OLED_write_string(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 = load i8, i8* %9
%11 = call i32 @OLED_write_char(i8 signext %10)
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @OLED_write_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @OLED_write_char(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_LAZY;
int /*<<< orphan*/ dlclose(void *);
void *dlopen(char *, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int foo(int i) {
  void *h = dlopen("unload6mod2.so", RTLD_LAZY);
  if (h == NULL) {
    puts("dlopen unload6mod2.so failed");
    return 1;
  }
  dlclose(h);
  return i + 8;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
call   1040 <dlopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1177 <foo+0x47>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1189 <foo+0x59>
mov    -0x10(%rbp),%rdi
call   1050 <dlclose@plt>
mov    -0x8(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
lea    0xebd(%rip),%rdi
call   1040 <dlopen@plt>
test   %rax,%rax
je     115a <foo+0x2a>
mov    %rax,%rdi
call   1050 <dlclose@plt>
add    $0x8,%ebx
jmp    116b <foo+0x3b>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"unload6mod2.so\00"
@RTLD_LAZY = global i32 0
@.str.1 = [29 x i8] c"dlopen unload6mod2.so failed\00"
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = load i32, i32* @RTLD_LAZY
%6 = call i8* @dlopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %16
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = call i32 @dlclose(i8* %12)
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 8
store i32 %15, i32* %2
br label %16
16: ; preds = %11, %9
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [15 x i8] c"unload6mod2.so\00"
@RTLD_LAZY = global i32 0
@.str.1 = [29 x i8] c"dlopen unload6mod2.so failed\00"
define i32 @foo(i32 %0) {
%2 = load i32, i32* @RTLD_LAZY
%3 = tail call i8* @dlopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = tail call i32 @dlclose(i8* %3)
%9 = add nsw i32 %0, 8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ 1, %5 ], [ %9, %7 ]
ret i32 %11
}
int system(s)
char *s;
{
  fatal("system() not supported on this system");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"system() not supported on this system\00"
define i32 @system(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"system() not supported on this system\00"
define i32 @system(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void urg_delay(int msec) { usleep(1000 * msec); }


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

x86 assembly (clang, -O2):
<urg_delay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @urg_delay(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
double SIM_power_draincap(int, int, int);
double SIM_power_gatecap(int, int /*<<< orphan*/);
double c_NOT(void) {
  return (SIM_power_draincap((2 * ((0.8 * 0.0875) * 0.5)), 0, 1) +
          SIM_power_draincap((1 * ((0.8 * 0.0875) * 0.5)), 1, 1) +
          SIM_power_gatecap(
              (2 * ((0.8 * 0.0875) * 0.5)) + (1 * ((0.8 * 0.0875) * 0.5)), 0));
}


x86 assembly (clang, -O0):
<c_NOT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %esi,%esi
mov    $0x1,%edx
mov    %esi,%edi
call   1030 <SIM_power_draincap@plt>
movsd  %xmm0,-0x10(%rbp)
xor    %edi,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <SIM_power_draincap@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <SIM_power_gatecap@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_NOT>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <SIM_power_draincap@plt>
movsd  %xmm0,(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <SIM_power_draincap@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
call   1040 <SIM_power_gatecap@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @c_NOT() {
%1 = call double @SIM_power_draincap(i32 0, i32 0, i32 1)
%2 = call double @SIM_power_draincap(i32 0, i32 1, i32 1)
%3 = fadd double %1, %2
%4 = call double @SIM_power_gatecap(i32 0, i32 0)
%5 = fadd double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @c_NOT() {
%1 = tail call double @SIM_power_draincap(i32 0, i32 0, i32 1)
%2 = tail call double @SIM_power_draincap(i32 0, i32 1, i32 1)
%3 = fadd double %1, %2
%4 = tail call double @SIM_power_gatecap(i32 0, i32 0)
%5 = fadd double %3, %4
ret double %5
}
void restore_ri_cb(struct runtime_instr_cb *cb_next,
                   struct runtime_instr_cb *cb_prev) {}


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

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

LLVM IR (-O0):
%struct.runtime_instr_cb = type opaque
define void @restore_ri_cb(%struct.runtime_instr_cb* %0, %struct.runtime_instr_cb* %1) {
%3 = alloca %struct.runtime_instr_cb*
%4 = alloca %struct.runtime_instr_cb*
store %struct.runtime_instr_cb* %0, %struct.runtime_instr_cb** %3
store %struct.runtime_instr_cb* %1, %struct.runtime_instr_cb** %4
ret void
}

LLVM IR (-O2):
%struct.runtime_instr_cb = type opaque
define void @restore_ri_cb(%struct.runtime_instr_cb* nocapture %0, %struct.runtime_instr_cb* nocapture %1) {
ret void
}
int dummy01(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @dummy01(i32 returned %0) {
ret i32 %0
}
long reverseBits_fun_long(long x) {
  long r = x;
  int i = 39;
  for (x = x >> 1 & 0x7fffffffffl; x; x >>= 1) {
    r = (r << 1) | (x & 1);
    --i;
  }
  return r << i;
}


x86 assembly (clang, -O0):
<reverseBits_fun_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x27,-0x14(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
movabs $0x7fffffffff,%rcx
and    %rcx,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116c <reverseBits_fun_long+0x6c>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    -0x8(%rbp),%rcx
and    $0x1,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1130 <reverseBits_fun_long+0x30>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseBits_fun_long>:
mov    %rdi,%rax
mov    %rdi,%rdx
shr    %rdx
movabs $0x7fffffffff,%rcx
and    %rdx,%rcx
je     113e <reverseBits_fun_long+0x3e>
mov    $0x27,%edx
mov    %rcx,%rsi
mov    %ecx,%edi
and    $0x1,%edi
lea    (%rdi,%rax,2),%rax
add    $0xffffffff,%edx
shr    %rsi
cmp    $0x1,%rcx
mov    %rsi,%rcx
ja     1120 <reverseBits_fun_long+0x20>
mov    %edx,%ecx
shl    %cl,%rax
ret
mov    $0x27,%ecx
shl    %cl,%rax
ret

LLVM IR (-O0):
define i64 @reverseBits_fun_long(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %2
%5 = load i64, i64* %2
store i64 %5, i64* %3
store i32 39, i32* %4
%6 = load i64, i64* %2
%7 = ashr i64 %6, 1
%8 = and i64 %7, 549755813887
store i64 %8, i64* %2
br label %9
9: ; preds = %20, %1
%10 = load i64, i64* %2
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %23
12: ; preds = %9
%13 = load i64, i64* %3
%14 = shl i64 %13, 1
%15 = load i64, i64* %2
%16 = and i64 %15, 1
%17 = or i64 %14, %16
store i64 %17, i64* %3
%18 = load i32, i32* %4
%19 = add nsw i32 %18, -1
store i32 %19, i32* %4
br label %20
20: ; preds = %12
%21 = load i64, i64* %2
%22 = ashr i64 %21, 1
store i64 %22, i64* %2
br label %9
23: ; preds = %9
%24 = load i64, i64* %3
%25 = load i32, i32* %4
%26 = zext i32 %25 to i64
%27 = shl i64 %24, %26
ret i64 %27
}

LLVM IR (-O2):
define i64 @reverseBits_fun_long(i64 %0) {
%2 = lshr i64 %0, 1
%3 = and i64 %2, 549755813887
%4 = icmp eq i64 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %12, %5 ], [ 39, %1 ]
%7 = phi i64 [ %11, %5 ], [ %0, %1 ]
%8 = phi i64 [ %13, %5 ], [ %3, %1 ]
%9 = shl i64 %7, 1
%10 = and i64 %8, 1
%11 = or i64 %9, %10
%12 = add nsw i32 %6, -1
%13 = lshr i64 %8, 1
%14 = icmp ult i64 %8, 2
br i1 %14, label %15, label %5
15: ; preds = %5
%16 = zext i32 %12 to i64
br label %17
17: ; preds = %15, %1
%18 = phi i64 [ %0, %1 ], [ %11, %15 ]
%19 = phi i64 [ 39, %1 ], [ %16, %15 ]
%20 = shl i64 %18, %19
ret i64 %20
}
/* Variables and functions */
int usleep(unsigned int);
int plt_usleep(unsigned usec) { return usleep(usec); }


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

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

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

LLVM IR (-O2):
define i32 @plt_usleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
void svgstart(float width, float height) {
  printf("<svg width=\"%f\" height=\"%f\" >", width, height);
}


x86 assembly (clang, -O0):
<svgstart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [30 x i8] c"<svg width=\22%f\22 height=\22%f\22 >\00"
define void @svgstart(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), float %5, float %6)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"<svg width=\22%f\22 height=\22%f\22 >\00"
define void @svgstart(float %0, float %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), float %0, float %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello, world");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, world\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello, world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
size_t strlen(char *);
char toupper(char);
void ffupch(char *string) {
  size_t len, ii;
  len = strlen(string);
  for (ii = 0; ii < len; ii++)
    string[ii] = toupper(string[ii]);
  return;
}


x86 assembly (clang, -O0):
<ffupch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    117e <ffupch+0x5e>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <ffupch+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffupch>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %rax,%rax
je     1157 <ffupch+0x37>
mov    %rax,%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <ffupch+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ffupch(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
store i64 0, i64* %4
br label %7
7: ; preds = %20, %1
%8 = load i64, i64* %4
%9 = load i64, i64* %3
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = load i64, i64* %4
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = call signext i8 @toupper(i8 signext %15)
%17 = load i8*, i8** %2
%18 = load i64, i64* %4
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8 %16, i8* %19
br label %20
20: ; preds = %11
%21 = load i64, i64* %4
%22 = add i64 %21, 1
store i64 %22, i64* %4
br label %7
23: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @ffupch(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %2
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void vga_enable_set_reset(int mask) {
  outb(0x01, 0x3ce);
  outb(mask, 0x3cf);
}


x86 assembly (clang, -O0):
<vga_enable_set_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x3ce,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%edi
mov    $0x3cf,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vga_enable_set_reset>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
mov    $0x3ce,%esi
call   1030 <outb@plt>
mov    %ebx,%edi
mov    $0x3cf,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @vga_enable_set_reset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @outb(i32 1, i32 974)
%4 = load i32, i32* %2
%5 = call i32 @outb(i32 %4, i32 975)
ret void
}

LLVM IR (-O2):
define void @vga_enable_set_reset(i32 %0) {
%2 = tail call i32 @outb(i32 1, i32 974)
%3 = tail call i32 @outb(i32 %0, i32 975)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ send_gpio(int, int /*<<< orphan*/);
void lcd_on(void) {
  uint16_t val = 0b0000001100;
  send_gpio(val, 0);
  val = 0b0000000110;
  send_gpio(val, 0);
}


x86 assembly (clang, -O0):
<lcd_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <send_gpio@plt>
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <send_gpio@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_on>:
push   %rax
mov    $0xc,%edi
xor    %esi,%esi
call   1030 <send_gpio@plt>
mov    $0x6,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <send_gpio@plt>

LLVM IR (-O0):
define void @lcd_on() {
%1 = alloca i32
store i32 12, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @send_gpio(i32 %2, i32 0)
store i32 6, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @send_gpio(i32 %4, i32 0)
ret void
}

LLVM IR (-O2):
define void @lcd_on() {
%1 = tail call i32 @send_gpio(i32 12, i32 0)
%2 = tail call i32 @send_gpio(i32 6, i32 0)
ret void
}
void enable_reset() {
  *(volatile unsigned long *)((void *)0xfffffd00 + 0x08) =
      (0xa5000000 | (0x01));
}


x86 assembly (clang, -O0):
<enable_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffd00,%eax
mov    $0xa5000001,%ecx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_reset>:
mov    $0xa5000001,%eax
mov    %rax,0x5afffd07(%rax)
ret

LLVM IR (-O0):
define void @enable_reset() {
store volatile i64 2768240641, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294966528 to i8*), i64 8) to i64*)
ret void
}

LLVM IR (-O2):
define void @enable_reset() {
store volatile i64 2768240641, i64* inttoptr (i64 4294966536 to i64*)
ret void
}
/* Variables and functions */
double log(int);
double atanh(double x) { return (1.0 / 2.0) * log((1 + x) / (1 - x)); }


x86 assembly (clang, -O0):
<atanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanh>:
push   %rax
movsd  0xee7(%rip),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%edi
call   1030 <log@plt>
mulsd  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @atanh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = load double, double* %2
%6 = fsub double 1.000000e+00, %5
%7 = fdiv double %4, %6
%8 = fptosi double %7 to i32
%9 = call double @log(i32 %8)
%10 = fmul double 5.000000e-01, %9
ret double %10
}

LLVM IR (-O2):
define double @atanh(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fsub double 1.000000e+00, %0
%4 = fdiv double %2, %3
%5 = fptosi double %4 to i32
%6 = tail call double @log(i32 %5)
%7 = fmul double %6, 5.000000e-01
ret double %7
}
int mlt_count(char *buffer, char ch) {
  int result = 0;
  while (*buffer != '\0') {
    if (*buffer == ch)
      result++;
    buffer++;
  }
  return result;
}


x86 assembly (clang, -O0):
<mlt_count>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1152 <mlt_count+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1141 <mlt_count+0x41>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <mlt_count+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlt_count>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <mlt_count+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <mlt_count+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mlt_count(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printarray(char s[], int n) {
  int g;
  for (g = 0; g < n; g++)
    printf("%c\n", s[g]);
}


x86 assembly (clang, -O0):
<printarray>:
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    1158 <printarray+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printarray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
define void @printarray(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %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 i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %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"%c\0A\00"
define void @printarray(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void menuOpcoes() {
  printf("\t\t\t_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-\n");
  printf("\t\t\t1) Criptografar mensagem do arquivo entrada.txt\n");
  printf("\t\t\t2) Sair do programa\n");
  printf("\t\t\t_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-\n");
}


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

x86 assembly (clang, -O2):
<menuOpcoes>:
push   %rbx
lea    0xf32(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"\09\09\09_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-\0A\00"
@.str.1 = [52 x i8] c"\09\09\091) Criptografar mensagem do arquivo entrada.txt\0A\00"
@.str.2 = [24 x i8] c"\09\09\092) Sair do programa\0A\00"
define void @menuOpcoes() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str.3 = [51 x i8] c"\09\09\091) Criptografar mensagem do arquivo entrada.txt\00"
@str.4 = [23 x i8] c"\09\09\092) Sair do programa\00"
@str.5 = [40 x i8] c"\09\09\09_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-\00"
define void @menuOpcoes() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.5, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.5, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *xgzopen(char const *, char *);
void *input_gzfile_open(const char *path) { return xgzopen(path, "rb"); }


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

x86 assembly (clang, -O2):
<input_gzfile_open>:
lea    0xee9(%rip),%rsi
jmp    1030 <xgzopen@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i8* @input_gzfile_open(i8* %0) {
%2 = tail call i8* @xgzopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void code() {
  for (long i = 0; i < 1000; i++) {
    for (long j = 0; j < 1000; j++) {
      printf(".");
    }
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
cmpq   $0x3e8,-0x8(%rbp)
jge    1177 <code+0x67>
movq   $0x0,-0x10(%rbp)
cmpq   $0x3e8,-0x10(%rbp)
jge    1161 <code+0x51>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1136 <code+0x26>
jmp    1166 <code+0x56>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <code+0x10>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2e,%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <code+0x20>
add    $0x1,%r14
cmp    $0x3e8,%r14
jne    1120 <code+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @code() {
br label %1
1: ; preds = %0, %5
%2 = phi i64 [ 0, %0 ], [ %6, %5 ]
br label %8
3: ; preds = %5
%4 = tail call i32 @putchar(i32 10)
ret void
5: ; preds = %8
%6 = add nuw nsw i64 %2, 1
%7 = icmp eq i64 %6, 1000
br i1 %7, label %3, label %1
8: ; preds = %1, %8
%9 = phi i64 [ 0, %1 ], [ %11, %8 ]
%10 = tail call i32 @putchar(i32 46)
%11 = add nuw nsw i64 %9, 1
%12 = icmp eq i64 %11, 1000
br i1 %12, label %5, label %8
}
int fun633() { return 633; }


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

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

LLVM IR (-O0):
define i32 @fun633() {
ret i32 633
}

LLVM IR (-O2):
define i32 @fun633() {
ret i32 633
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf31(int f, int n) { return (cbuf(f, n, 31)); }


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

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

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

LLVM IR (-O2):
define i32 @cbuf31(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 31)
ret i32 %3
}
int shortRunValueAtfrom(int i, int runArray) {
  return ((((int *)runArray))[i]) & 65535;
}


x86 assembly (clang, -O0):
<shortRunValueAtfrom>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortRunValueAtfrom>:
movslq %esi,%rax
movslq %edi,%rcx
movzwl (%rax,%rcx,4),%eax
ret

LLVM IR (-O0):
define i32 @shortRunValueAtfrom(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = and i32 %11, 65535
ret i32 %12
}

LLVM IR (-O2):
define i32 @shortRunValueAtfrom(i32 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = inttoptr i64 %3 to i32*
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i32, i32* %4, i64 %5
%7 = load i32, i32* %6
%8 = and i32 %7, 65535
ret i32 %8
}
/* Variables and functions */
unsigned long ilog2(unsigned int);
scalar_t__ soc_is_s3c24xx();
unsigned long pwm_tdiv_div_bits(unsigned int div) {
  if (soc_is_s3c24xx())
    return ilog2(div) - 1;
  else
    return ilog2(div);
}


x86 assembly (clang, -O0):
<pwm_tdiv_div_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <soc_is_s3c24xx@plt>
cmp    $0x0,%rax
je     1151 <pwm_tdiv_div_bits+0x31>
mov    -0xc(%rbp),%edi
call   1030 <ilog2@plt>
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    115d <pwm_tdiv_div_bits+0x3d>
mov    -0xc(%rbp),%edi
call   1030 <ilog2@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwm_tdiv_div_bits>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <soc_is_s3c24xx@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <ilog2@plt>
cmp    $0x1,%rbx
adc    $0xffffffffffffffff,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @pwm_tdiv_div_bits(i32 %0) {
%2 = tail call i64 (...) @soc_is_s3c24xx()
%3 = icmp ne i64 %2, 0
%4 = tail call i64 @ilog2(i32 %0)
%5 = sext i1 %3 to i64
%6 = add i64 %4, %5
ret i64 %6
}
/* Variables and functions */
int rand();
int rand_a_b(int a, int b) { return rand() % (b - a) + a; }


x86 assembly (clang, -O0):
<rand_a_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_a_b>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @rand_a_b(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printSeznam(unsigned int *tab, int n) {
  for (int i = 0; i < n; ++i) {
    printf("%u ", tab[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printSeznam>:
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 <printSeznam+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printSeznam+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSeznam>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printSeznam+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printSeznam+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%u \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printSeznam(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %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 i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %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
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u \00"
define void @printSeznam(i32* 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 %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ CreateSingleHull(int);
int /*<<< orphan*/ ReadClipHull(int);
int /*<<< orphan*/ printf(char *);
void CreateHulls(void) {
  printf("building hulls...\n");
  CreateSingleHull(1);
  CreateSingleHull(2);
  CreateSingleHull(0);
  ReadClipHull(1);
  ReadClipHull(2);
}


x86 assembly (clang, -O0):
<CreateHulls>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <CreateSingleHull@plt>
mov    $0x2,%edi
call   1050 <CreateSingleHull@plt>
xor    %edi,%edi
call   1050 <CreateSingleHull@plt>
mov    $0x1,%edi
call   1030 <ReadClipHull@plt>
mov    $0x2,%edi
call   1030 <ReadClipHull@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateHulls>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <CreateSingleHull@plt>
mov    $0x2,%edi
call   1050 <CreateSingleHull@plt>
xor    %edi,%edi
call   1050 <CreateSingleHull@plt>
mov    $0x1,%edi
call   1040 <ReadClipHull@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <ReadClipHull@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"building hulls...\0A\00"
define void @CreateHulls() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @CreateSingleHull(i32 1)
%3 = call i32 @CreateSingleHull(i32 2)
%4 = call i32 @CreateSingleHull(i32 0)
%5 = call i32 @ReadClipHull(i32 1)
%6 = call i32 @ReadClipHull(i32 2)
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"building hulls...\00"
define void @CreateHulls() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @CreateSingleHull(i32 1)
%3 = tail call i32 @CreateSingleHull(i32 2)
%4 = tail call i32 @CreateSingleHull(i32 0)
%5 = tail call i32 @ReadClipHull(i32 1)
%6 = tail call i32 @ReadClipHull(i32 2)
ret void
}