xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, char *);
int main(int argc, char *argv[]) {
  for (register unsigned int cont = 0; cont < argc; cont++)
    printf("Parâmetro %d: %s\n", cont, argv[cont]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1161 <main+0x51>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    (%rax,%rcx,8),%rdx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"Par\C3\A2metro %d: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp ult i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %6
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [19 x i8] c"Par\C3\A2metro %d: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ write_bytes(unsigned short *, int, int /*<<< orphan*/ *,
                               int *);
void write_short(unsigned short s, FILE *file, int *count) {
  write_bytes(&s, sizeof(short), file, count);
}


x86 assembly (clang, -O0):
<write_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <write_bytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_short>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <write_bytes@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @write_short(i16 zeroext %0, i32* %1, i32* %2) {
%4 = alloca i16
%5 = alloca i32*
%6 = alloca i32*
store i16 %0, i16* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %5
%8 = load i32*, i32** %6
%9 = call i32 @write_bytes(i16* %4, i32 2, i32* %7, i32* %8)
ret void
}

LLVM IR (-O2):
define void @write_short(i16 zeroext %0, i32* %1, i32* %2) {
%4 = alloca i16
store i16 %0, i16* %4
%5 = call i32 @write_bytes(i16* %4, i32 2, i32* %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage: univ_rescore_dtw -matchlist <str> (REQUIRED)]\n\t[-file1 "
         "<str> (REQUIRED)]\n\t[-file2 <str> (REQUIRED)]\n\t[-D <n> (defaults "
         "to 39)]\n\t[-maxrun <n> (defaults to INT_MAX)]\n\t[-sakoe <n> "
         "(defaults to 0)]\n\t[-kldiv <n> (defaults to 0=cosine)]\n\t[-sym <n> "
         "(defaults to 0=not symmetrized)]\n\t[-wmvn <n> (defaults to 0=not "
         "word-level mvn)]\n");
}


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

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

LLVM IR (-O0):
@.str = [331 x i8] c"usage: univ_rescore_dtw -matchlist <str> (REQUIRED)]\0A\09[-file1 <str> (REQUIRED)]\0A\09[-file2 <str> (REQUIRED)]\0A\09[-D <n> (defaults to 39)]\0A\09[-maxrun <n> (defaults to INT_MAX)]\0A\09[-sakoe <n> (defaults to 0)]\0A\09[-kldiv <n> (defaults to 0=cosine)]\0A\09[-sym <n> (defaults to 0=not symmetrized)]\0A\09[-wmvn <n> (defaults to 0=not word-level mvn)]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([331 x i8], [331 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [330 x i8] c"usage: univ_rescore_dtw -matchlist <str> (REQUIRED)]\0A\09[-file1 <str> (REQUIRED)]\0A\09[-file2 <str> (REQUIRED)]\0A\09[-D <n> (defaults to 39)]\0A\09[-maxrun <n> (defaults to INT_MAX)]\0A\09[-sakoe <n> (defaults to 0)]\0A\09[-kldiv <n> (defaults to 0=cosine)]\0A\09[-sym <n> (defaults to 0=not symmetrized)]\0A\09[-wmvn <n> (defaults to 0=not word-level mvn)]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([330 x i8], [330 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int *vmaior(int *, int *);
int main() {
  int i1, i2;
  scanf("%d %d", &i1, &i2);
  int *maior = vmaior(&i1, &i2);
  printf("Endereço do maior: %p\nConteudo: %d\n", maior, *maior);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <vmaior@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <vmaior@plt>
mov    (%rax),%edx
lea    0xea4(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [37 x i8] c"Endere\C3\A7o do maior: %p\0AConteudo: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = call i32* @vmaior(i32* %2, i32* %3)
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32* %7, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [37 x i8] c"Endere\C3\A7o do maior: %p\0AConteudo: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = call i32* @vmaior(i32* %1, i32* %2)
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32 %7)
ret i32 0
}
__attribute__((always_)) int ffs(int x) {
  int r;
  __asm__("bsfl %1,%0\n\t"
          "jnz 1f\n\t"
          "movl $-1,%0\n"
          "1:"
          : "=r"(r)
          : "rm"(x));
  return r + 1;
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
bsf    -0xc(%rbp),%eax
jne    111c <ffs+0x1c>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
mov    %edi,-0x4(%rsp)
bsf    -0x4(%rsp),%eax
jne    1110 <ffs+0x10>
mov    $0xffffffff,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ffs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "bsfl $1,$0\0A\09jnz 1f\0A\09movl $$-1,$0\0A1:", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = tail call i32 asm "bsfl $1,$0\0A\09jnz 1f\0A\09movl $$-1,$0\0A1:", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int qran();
int qran_range(int min, int max) { return (qran() * (max - min) >> 15) + min; }


x86 assembly (clang, -O0):
<qran_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <qran@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
imul   %ecx,%eax
sar    $0xf,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qran_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <qran@plt>
sub    %ebp,%ebx
imul   %ebx,%eax
sar    $0xf,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @qran_range(i32 %0, i32 %1) {
%3 = tail call i32 (...) @qran()
%4 = sub nsw i32 %1, %0
%5 = mul nsw i32 %3, %4
%6 = ashr i32 %5, 15
%7 = add nsw i32 %6, %0
ret i32 %7
}
void __initialize_system(void) {}


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

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

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

LLVM IR (-O2):
define void @__initialize_system() {
ret void
}
double fftmod_phase(long length, int j) {
  long center1 = length / 2;
  double shift = (double)center1 / (double)length;
  return ((double)j - (double)center1 / 2.) * shift;
}


x86 assembly (clang, -O0):
<fftmod_phase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
cvtsi2sdq -0x18(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
cvtsi2sdq -0x18(%rbp),%xmm1
movsd  0xebb(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fftmod_phase>:
mov    %rdi,%rax
shr    $0x3f,%rax
add    %rdi,%rax
sar    %rax
cvtsi2sd %rax,%xmm0
cvtsi2sd %rdi,%xmm1
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
mulsd  0xed2(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @fftmod_phase(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
%6 = alloca double
store i64 %0, i64* %3
store i32 %1, i32* %4
%7 = load i64, i64* %3
%8 = sdiv i64 %7, 2
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = sitofp i64 %9 to double
%11 = load i64, i64* %3
%12 = sitofp i64 %11 to double
%13 = fdiv double %10, %12
store double %13, double* %6
%14 = load i32, i32* %4
%15 = sitofp i32 %14 to double
%16 = load i64, i64* %5
%17 = sitofp i64 %16 to double
%18 = fdiv double %17, 2.000000e+00
%19 = fsub double %15, %18
%20 = load double, double* %6
%21 = fmul double %19, %20
ret double %21
}

LLVM IR (-O2):
define double @fftmod_phase(i64 %0, i32 %1) {
%3 = sdiv i64 %0, 2
%4 = sitofp i64 %3 to double
%5 = sitofp i64 %0 to double
%6 = fdiv double %4, %5
%7 = sitofp i32 %1 to double
%8 = fmul double %4, 5.000000e-01
%9 = fsub double %7, %8
%10 = fmul double %6, %9
ret double %10
}
void init_sub_rel_pixel_pt_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_sub_rel_pixel_pt_funcs_c() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void funOpenOutputFile(void) { system("notepad d:\\Marks.txt"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"notepad d:\\Marks.txt\00"
define void @funOpenOutputFile() {
%1 = call i32 @system(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"notepad d:\\Marks.txt\00"
define void @funOpenOutputFile() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xb7() {
  Assert_real((isdigit(183) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isdigit.c",
              920, ("isdigit should be 0 for 0xb7"));
}


x86 assembly (clang, -O0):
<t_isdigit_0xb7>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb7,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x398,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isdigit_0xb7>:
push   %rax
mov    $0xb7,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x398,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xb7\00"
define void @t_isdigit_0xb7() {
%1 = call i64 @isdigit(i32 183)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 920, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xb7\00"
define void @t_isdigit_0xb7() {
%1 = tail call i64 @isdigit(i32 183)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 920, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char buffer[80];
  printf("\nSILLY hello out there");
  printf("\nEnter your name:");
  gets(buffer);
  printf("\n\nyou entered>>%s<<\n", buffer);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x60(%rbp),%rsi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0xed6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0ASILLY hello out there\00"
@.str.1 = [18 x i8] c"\0AEnter your name:\00"
@.str.2 = [21 x i8] c"\0A\0Ayou entered>>%s<<\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0ASILLY hello out there\00"
@.str.1 = [18 x i8] c"\0AEnter your name:\00"
@.str.2 = [21 x i8] c"\0A\0Ayou entered>>%s<<\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @gets(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int mpg123_tell(void *);
int get_stream_pos(void *mpg) { return mpg123_tell(mpg); }


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

x86 assembly (clang, -O2):
<get_stream_pos>:
jmp    1030 <mpg123_tell@plt>

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

LLVM IR (-O2):
define i32 @get_stream_pos(i8* %0) {
%2 = tail call i32 @mpg123_tell(i8* %0)
ret i32 %2
}
double GetD(unsigned long long int x) {
  double r;
  r = x;
  return r;
}


x86 assembly (clang, -O0):
<GetD>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movaps 0xef1(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xef0(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetD>:
movq   %rdi,%xmm1
punpckldq 0xef3(%rip),%xmm1
subpd  0xefb(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @GetD(i64 %0) {
%2 = alloca i64
%3 = alloca double
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = uitofp i64 %4 to double
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @GetD(i64 %0) {
%2 = uitofp i64 %0 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_ps_tail(void) {
  printf("showpage\n");
  printf("%%%%Trailer\n");
}


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

x86 assembly (clang, -O2):
<print_ps_tail>:
push   %rax
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"showpage\0A\00"
@.str.1 = [13 x i8] c"%%%%Trailer\0A\00"
define void @print_ps_tail() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"%%%%Trailer\0A\00"
@str = [9 x i8] c"showpage\00"
define void @print_ps_tail() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void InitializeUART0() {}


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

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

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

LLVM IR (-O2):
define void @InitializeUART0() {
ret void
}
/* Variables and functions */
double sqrt(double);
double shit(double x, double y) { return sqrt(x * x + y * y); }


x86 assembly (clang, -O0):
<shit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shit>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <shit+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @shit(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @shit(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
int cmp_ulong_des(const void *x, const void *y) {
  if (*(unsigned long *)x > *(unsigned long *)y) {
    return -1;
  } else if (*(unsigned long *)x < *(unsigned long *)y) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cmp_ulong_des>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jbe    112c <cmp_ulong_des+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1158 <cmp_ulong_des+0x58>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jae    114c <cmp_ulong_des+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1158 <cmp_ulong_des+0x58>
jmp    1151 <cmp_ulong_des+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_ulong_des>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setb   %cl
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_ulong_des(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp ugt i64 %4, %6
%8 = icmp ult i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print() { printf("Hello world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define void @print() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Init();
void _M2_macroObjects_init(__attribute__((unused)) int argc,
                           __attribute__((unused)) char *argv[]) {
  Init();
}


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

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

LLVM IR (-O0):
define void @_M2_macroObjects_init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @Init()
ret void
}

LLVM IR (-O2):
define void @_M2_macroObjects_init(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Init()
ret void
}
void SPI5_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @SPI5_IRQHandler() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct tcphdr {
  int /*<<< orphan*/ window;
};

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t tcphdr_window_ntohs(struct tcphdr *h) { return ntohs(h->window); }


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

x86 assembly (clang, -O2):
<tcphdr_window_ntohs>:
mov    (%rdi),%edi
jmp    1030 <ntohs@plt>

LLVM IR (-O0):
%struct.tcphdr = type { i32 }
define i32 @tcphdr_window_ntohs(%struct.tcphdr* %0) {
%2 = alloca %struct.tcphdr*
store %struct.tcphdr* %0, %struct.tcphdr** %2
%3 = load %struct.tcphdr*, %struct.tcphdr** %2
%4 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @ntohs(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.tcphdr = type { i32 }
define i32 @tcphdr_window_ntohs(%struct.tcphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @ntohs(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
scalar_t__ sw_sync_fence_is_valid(int);
void sw_sync_fence_destroy(int fd) {
  if (sw_sync_fence_is_valid(fd))
    close(fd);
}


x86 assembly (clang, -O0):
<sw_sync_fence_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sw_sync_fence_is_valid@plt>
cmp    $0x0,%rax
je     1145 <sw_sync_fence_destroy+0x25>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sw_sync_fence_destroy>:
push   %rbx
mov    %edi,%ebx
call   1030 <sw_sync_fence_is_valid@plt>
test   %rax,%rax
je     1135 <sw_sync_fence_destroy+0x15>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @sw_sync_fence_destroy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @sw_sync_fence_is_valid(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @close(i32 %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @sw_sync_fence_destroy(i32 %0) {
%2 = tail call i64 @sw_sync_fence_is_valid(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @close(i32 %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int strtol(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int __parse_immediate(char *imm) {
  int t = strtol(imm, 0, 0);
  return (t & 0xFFFF);
}


x86 assembly (clang, -O0):
<__parse_immediate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <strtol@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__parse_immediate>:
push   %rax
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtol@plt>
movzwl %ax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__parse_immediate(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strtol(i8* %4, i32 0, i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, 65535
ret i32 %7
}

LLVM IR (-O2):
define i32 @__parse_immediate(i8* %0) {
%2 = tail call i32 @strtol(i8* %0, i32 0, i32 0)
%3 = and i32 %2, 65535
ret i32 %3
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_del_entry(struct list_head *);
int /*<<< orphan*/ list_add(struct list_head *, struct list_head *);
__attribute__((always_)) void list_move(struct list_head *list,
                                        struct list_head *head) {
  __list_del_entry(list);
  list_add(list, head);
}


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

x86 assembly (clang, -O2):
<list_move>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <__list_del_entry@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <list_add@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_move(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @__list_del_entry(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @list_add(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_move(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @__list_del_entry(%struct.list_head* %0)
%4 = tail call i32 @list_add(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
long sgn_l(long n) {
  if (n > 0)
    return +1;
  else if (n < 0)
    return -1;
  else
    return +-0;
}


x86 assembly (clang, -O0):
<sgn_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1120 <sgn_l+0x20>
movq   $0x1,-0x8(%rbp)
jmp    1140 <sgn_l+0x40>
cmpq   $0x0,-0x10(%rbp)
jge    1138 <sgn_l+0x38>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1140 <sgn_l+0x40>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn_l>:
mov    %rdi,%rcx
sar    $0x3f,%rcx
test   %rdi,%rdi
mov    $0x1,%eax
cmovle %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @sgn_l(i64 %0) {
%2 = ashr i64 %0, 63
%3 = icmp slt i64 %0, 1
%4 = select i1 %3, i64 %2, i64 1
ret i64 %4
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, int);
void strncat_overflow_2(char *y) {
  char x[4] = "12";
  if (strlen(y) == 2)
    strncat(x, y, strlen(y));
}


x86 assembly (clang, -O0):
<strncat_overflow_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    116f <strncat_overflow_2+0x4f>
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <strncat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat_overflow_2>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x3231,0xc(%rsp)
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    1151 <strncat_overflow_2+0x31>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <strncat@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.strncat_overflow_2.x = [4 x i8] c"12\00\00"
define void @strncat_overflow_2(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = bitcast [4 x i8]* %3 to i8*
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%10 = load i8*, i8** %2
%11 = load i8*, i8** %2
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @strncat(i8* %9, i8* %10, i32 %12)
br label %14
14: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @strncat_overflow_2(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 12849, i32* %2
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @strlen(i8* %0)
%8 = call i32 @strncat(i8* %3, i8* %0, i32 %7)
br label %9
9: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _clear_error_stack();
int _ssl_initialize();
int ssl_initialize(void) {
  { _clear_error_stack(); };
  return (_ssl_initialize());
}


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

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

LLVM IR (-O0):
define i32 @ssl_initialize() {
%1 = call i32 (...) @_clear_error_stack()
%2 = call i32 (...) @_ssl_initialize()
ret i32 %2
}

LLVM IR (-O2):
define i32 @ssl_initialize() {
%1 = tail call i32 (...) @_clear_error_stack()
%2 = tail call i32 (...) @_ssl_initialize()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M72_f(char *s) {
  debug("M72_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

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

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

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

/* Variables and functions */
uint16_t i2xm_read_uint16(unsigned char *data, size_t pos, int le) {
  if (le) {
    return data[pos] | (data[pos + 1] << 8);
  } else {
    return (data[pos] << 8) | (data[pos + 1]);
  }
}


x86 assembly (clang, -O0):
<i2xm_read_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     113f <i2xm_read_uint16+0x3f>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movzbl 0x1(%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
jmp    1160 <i2xm_read_uint16+0x60>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movzbl 0x1(%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2xm_read_uint16>:
cmp    $0x1,%edx
adc    $0x0,%rsi
mov    (%rdi,%rsi,1),%al
ret

LLVM IR (-O0):
define zeroext i8 @i2xm_read_uint16(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %25
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = add i64 %17, 1
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = shl i32 %21, 8
%23 = or i32 %15, %22
%24 = trunc i32 %23 to i8
store i8 %24, i8* %4
br label %40
25: ; preds = %3
%26 = load i8*, i8** %5
%27 = load i64, i64* %6
%28 = getelementptr inbounds i8, i8* %26, i64 %27
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = shl i32 %30, 8
%32 = load i8*, i8** %5
%33 = load i64, i64* %6
%34 = add i64 %33, 1
%35 = getelementptr inbounds i8, i8* %32, i64 %34
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = or i32 %31, %37
%39 = trunc i32 %38 to i8
store i8 %39, i8* %4
br label %40
40: ; preds = %25, %10
%41 = load i8, i8* %4
ret i8 %41
}

LLVM IR (-O2):
define zeroext i8 @i2xm_read_uint16(i8* nocapture %0, i64 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = zext i1 %4 to i64
%6 = add i64 %5, %1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ printerror(char *);
void Usage() {
  printerror("argument syntax error\n	./hw5 tablecheck -t=tablefile\n	./hw5 "
             "encrypt -k=key -t=tablefile [file]\n	./hw5 decrypt -k=key "
             "-t=tablefile [file]\n	./hw5 encrypt3 -k=key3 -t=tablefile "
             "[file]\n	./hw5 decrypt3 -k=key3 -t=tablefile [file]\n");
}


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

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

LLVM IR (-O0):
@.str = [226 x i8] c"argument syntax error\0A\09./hw5 tablecheck -t=tablefile\0A\09./hw5 encrypt -k=key -t=tablefile [file]\0A\09./hw5 decrypt -k=key -t=tablefile [file]\0A\09./hw5 encrypt3 -k=key3 -t=tablefile [file]\0A\09./hw5 decrypt3 -k=key3 -t=tablefile [file]\0A\00"
define void @Usage() {
%1 = call i32 @printerror(i8* getelementptr inbounds ([226 x i8], [226 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [226 x i8] c"argument syntax error\0A\09./hw5 tablecheck -t=tablefile\0A\09./hw5 encrypt -k=key -t=tablefile [file]\0A\09./hw5 decrypt -k=key -t=tablefile [file]\0A\09./hw5 encrypt3 -k=key3 -t=tablefile [file]\0A\09./hw5 decrypt3 -k=key3 -t=tablefile [file]\0A\00"
define void @Usage() {
%1 = tail call i32 @printerror(i8* getelementptr inbounds ([226 x i8], [226 x i8]* @.str, i64 0, i64 0))
ret void
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local2;
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 4284877637U;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      local2 = 0UL;
      while (local2 < input[1UL]) {
        local2 += 2UL;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] - 2699719578U;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xff660b45,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x4(%rcx),%eax
jae    1166 <RandomFunc+0x66>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x4(%rcx),%eax
jae    1157 <RandomFunc+0x57>
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1138 <RandomFunc+0x38>
mov    -0x1c(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x1c(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%ecx
sub    $0xa0ea739a,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x5e7b97ab,%eax
add    (%rdi),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = add i32 %10, -10089659
%12 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %11, i32* %12
store i32 0, i32* %7
br label %13
13: ; preds = %31, %2
%14 = load i32, i32* %7
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
%18 = icmp ult i32 %14, %17
br i1 %18, label %19, label %36
19: ; preds = %13
store i32 0, i32* %6
br label %20
20: ; preds = %26, %19
%21 = load i32, i32* %6
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 1
%24 = load i32, i32* %23
%25 = icmp ult i32 %21, %24
br i1 %25, label %26, label %31
26: ; preds = %20
%27 = load i32, i32* %6
%28 = zext i32 %27 to i64
%29 = add i64 %28, 2
%30 = trunc i64 %29 to i32
store i32 %30, i32* %6
br label %20
31: ; preds = %20
%32 = load i32, i32* %7
%33 = zext i32 %32 to i64
%34 = add i64 %33, 2
%35 = trunc i64 %34 to i32
store i32 %35, i32* %7
br label %13
36: ; preds = %13
%37 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%38 = load i32, i32* %37
%39 = sub i32 %38, -1595247718
%40 = load i32*, i32** %4
%41 = getelementptr inbounds i32, i32* %40, i64 0
store i32 %39, i32* %41
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, 1585158059
store i32 %4, i32* %1
ret void
}
unsigned int hashPtrhash(void *x) {
  union {
    void *ptr;
    unsigned int ui;
  } v;
  v.ui = 0;
  v.ptr = x;
  return v.ui;
}


x86 assembly (clang, -O0):
<hashPtrhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i8* }
define i32 @hashPtrhash(i8* %0) {
%2 = alloca i8*
%3 = alloca %union.anon
store i8* %0, i8** %2
%4 = bitcast %union.anon* %3 to i32*
store i32 0, i32* %4
%5 = load i8*, i8** %2
%6 = bitcast %union.anon* %3 to i8**
store i8* %5, i8** %6
%7 = bitcast %union.anon* %3 to i32*
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @hashPtrhash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
void gdk_event_new() {}


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

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

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

LLVM IR (-O2):
define void @gdk_event_new() {
ret void
}
void CameraIntClear(unsigned long ulBase, unsigned long ulIntFlags) {
  if (ulIntFlags & 0x80000000) {
    (*((volatile unsigned long *)(0x44026000 + 0x0000009C))) = ((1 << 8));
  }
  (*((volatile unsigned long *)(ulBase + 0x00000018))) = ulIntFlags;
}


x86 assembly (clang, -O0):
<CameraIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0x80000000,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
je     1130 <CameraIntClear+0x30>
mov    $0x4402609c,%eax
movq   $0x100,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CameraIntClear>:
test   $0x80000000,%esi
je     1114 <CameraIntClear+0x14>
movq   $0x100,0x4402609c
mov    %rsi,0x18(%rdi)
ret

LLVM IR (-O0):
define void @CameraIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 2147483648
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store volatile i64 256, i64* inttoptr (i64 1141006492 to i64*)
br label %9
9: ; preds = %8, %2
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = add i64 %11, 24
%13 = inttoptr i64 %12 to i64*
store volatile i64 %10, i64* %13
ret void
}

LLVM IR (-O2):
define void @CameraIntClear(i64 %0, i64 %1) {
%3 = and i64 %1, 2147483648
%4 = icmp eq i64 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %2
store volatile i64 256, i64* inttoptr (i64 1141006492 to i64*)
br label %6
6: ; preds = %5, %2
%7 = add i64 %0, 24
%8 = inttoptr i64 %7 to i64*
store volatile i64 %1, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int /*<<< orphan*/ f(int);
void f2(int n) {
  if (n < 3)
    return;
  n--;
  f(n);
  __VERIFIER_error();
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    113a <f2+0x1a>
jmp    1152 <f2+0x32>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
cmp    $0x3,%edi
jge    1126 <f2+0x6>
ret
push   %rax
add    $0xffffffff,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <__VERIFIER_error@plt>

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

LLVM IR (-O2):
define void @f2(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @f(i32 %4)
%6 = tail call i32 (...) @__VERIFIER_error()
br label %7
7: ; preds = %1, %3
ret void
}