xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ resampler_write_sample_float(void *, float);
void resampler_write_sample(void *_r, short s) {
  float s32 = s;
  s32 *= 256.0;
  resampler_write_sample_float(_r, s32);
}


x86 assembly (clang, -O0):
<resampler_write_sample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebf(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0x10(%rbp),%xmm0
call   1030 <resampler_write_sample_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resampler_write_sample>:
cvtsi2sd %esi,%xmm0
mulsd  0xee4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    1030 <resampler_write_sample_float@plt>

LLVM IR (-O0):
define void @resampler_write_sample(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca float
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = load i16, i16* %4
%7 = sitofp i16 %6 to float
store float %7, float* %5
%8 = load float, float* %5
%9 = fpext float %8 to double
%10 = fmul double %9, 2.560000e+02
%11 = fptrunc double %10 to float
store float %11, float* %5
%12 = load i8*, i8** %3
%13 = load float, float* %5
%14 = call i32 @resampler_write_sample_float(i8* %12, float %13)
ret void
}

LLVM IR (-O2):
define void @resampler_write_sample(i8* %0, i16 signext %1) {
%3 = sitofp i16 %1 to double
%4 = fmul double %3, 2.560000e+02
%5 = fptrunc double %4 to float
%6 = tail call i32 @resampler_write_sample_float(i8* %0, float %5)
ret void
}
int callatz(int n) {
  if (n == 1)
    return 0;
  n % 2 == 0 ? (n /= 2) : (n = (3 * n + 1) / 2);
  return 1 + callatz(n);
}


x86 assembly (clang, -O0):
<callatz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <callatz+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1178 <callatz+0x68>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1158 <callatz+0x48>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    116a <callatz+0x5a>
imul   $0x3,-0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <callatz@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callatz>:
xor    %eax,%eax
cmp    $0x1,%edi
je     112f <callatz+0x2f>
xor    %eax,%eax
nopl   0x0(%rax)
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%ecx
cmove  %edi,%ecx
mov    %ecx,%edi
shr    $0x1f,%edi
add    %ecx,%edi
sar    %edi
add    $0x1,%eax
and    $0xfffffffe,%ecx
cmp    $0x2,%ecx
jne    1110 <callatz+0x10>
ret

LLVM IR (-O0):
define i32 @callatz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %24
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 2
store i32 %13, i32* %3
br label %19
14: ; preds = %7
%15 = load i32, i32* %3
%16 = mul nsw i32 3, %15
%17 = add nsw i32 %16, 1
%18 = sdiv i32 %17, 2
store i32 %18, i32* %3
br label %19
19: ; preds = %14, %11
%20 = phi i32 [ %13, %11 ], [ %18, %14 ]
%21 = load i32, i32* %3
%22 = call i32 @callatz(i32 %21)
%23 = add nsw i32 1, %22
store i32 %23, i32* %2
br label %24
24: ; preds = %19, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @callatz(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %15, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %11, %3 ], [ %0, %1 ]
%5 = phi i32 [ %12, %3 ], [ 0, %1 ]
%6 = and i32 %4, 1
%7 = icmp eq i32 %6, 0
%8 = mul nsw i32 %4, 3
%9 = add nsw i32 %8, 1
%10 = select i1 %7, i32 %4, i32 %9
%11 = sdiv i32 %10, 2
%12 = add nuw nsw i32 %5, 1
%13 = and i32 %10, -2
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %3
15: ; preds = %3, %1
%16 = phi i32 [ 0, %1 ], [ %12, %3 ]
ret i32 %16
}
int test_imm_97uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x97 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_97uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 9895936
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x25() {
  Assert_real((isgraph(37)),
              "/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_isgraph.c",
              190, ("isgraph should be 1 for %"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x25>:
push   %rbp
mov    %rsp,%rbp
mov    $0x25,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xbe,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x25>:
push   %rax
mov    $0x25,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xbe,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for %\00"
define void @t_isgraph_0x25() {
%1 = call i32 @isgraph(i32 37)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 190, i8* getelementptr inbounds ([26 x i8], [26 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for %\00"
define void @t_isgraph_0x25() {
%1 = tail call i32 @isgraph(i32 37)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 190, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void msm_jtag_save_state(void) {}


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

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

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

LLVM IR (-O2):
define void @msm_jtag_save_state() {
ret void
}
void X509_dup(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_dup() {
ret void
}
long long foo_long_long(_Complex long long x) { return __real__ x; }


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

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

LLVM IR (-O0):
define i64 @foo_long_long(i64 %0, i64 %1) {
%3 = alloca { i64, i64 }
%4 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %3, i32 0, i32 0
store i64 %0, i64* %4
%5 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %3, i32 0, i32 1
store i64 %1, i64* %5
%6 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %3, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @foo_long_long(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void getFormatedTime(char *buffer) {
  time_t rawtime;
  struct tm *timeinfo;
  time(&rawtime);
  timeinfo = localtime(&rawtime);
  strftime(buffer, 80, "%d/%b/%Y:%H:%M:%S %z", timeinfo);
}


x86 assembly (clang, -O0):
<getFormatedTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x50,%esi
lea    0xe9a(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFormatedTime>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xead(%rip),%rdx
mov    %rbx,%rdi
mov    $0x50,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [21 x i8] c"%d/%b/%Y:%H:%M:%S %z\00"
define void @getFormatedTime(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = call i32 @time(i32* %3)
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %2
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @strftime(i8* %7, i32 80, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [21 x i8] c"%d/%b/%Y:%H:%M:%S %z\00"
define void @getFormatedTime(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 80, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, char *);
char *strerror(int /*<<< orphan*/);
void printAndFail(char *line) {
  printf("%s: %s\n", line, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<printAndFail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<printAndFail>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @printAndFail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i8* @strerror(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @printAndFail(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ hexprint(unsigned char *, int);
int /*<<< orphan*/ printf(char *);
void modpprint(unsigned char *bytes) {
  printf("Mod(hex(\"");
  hexprint(bytes, 32);
  printf("\"),p)");
}


x86 assembly (clang, -O0):
<modpprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1040 <hexprint@plt>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modpprint>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1040 <hexprint@plt>
lea    0xec6(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Mod(hex(\22\00"
@.str.1 = [6 x i8] c"\22),p)\00"
define void @modpprint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @hexprint(i8* %4, i32 32)
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Mod(hex(\22\00"
@.str.1 = [6 x i8] c"\22),p)\00"
define void @modpprint(i8* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @hexprint(i8* %0, i32 32)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ generatePossibleNextMoves(char *, int *);
int main() {
  int num_moves;
  generatePossibleNextMoves("++++", &num_moves);
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"++++\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @generatePossibleNextMoves(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cPrintf(char *);
void help15(void) { cPrintf("  i                 initialize hardware\n"); }


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

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

LLVM IR (-O0):
@.str = [41 x i8] c" i initialize hardware\0A\00"
define void @help15() {
%1 = call i32 @cPrintf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c" i initialize hardware\0A\00"
define void @help15() {
%1 = tail call i32 @cPrintf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double exp(double);
double sqrt(double);
TU(double TU) {
  double q7;
  if (TU > 100) {
    return 5;
  }
  q7 = 97.34 * exp(-0.01139 * TU + -0.04917 * sqrt(TU));
  return q7;
}


x86 assembly (clang, -O0):
<TU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1150 <TU+0x30>
movl   $0x5,-0x4(%rbp)
jmp    11a9 <TU+0x89>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  0xea4(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe90(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe70(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TU>:
push   %rax
mov    $0x5,%eax
ucomisd 0xed2(%rip),%xmm0
ja     1183 <TU+0x63>
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     1147 <TU+0x27>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    115a <TU+0x3a>
movapd %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm1
mulsd  0xea6(%rip),%xmm0
mulsd  0xea6(%rip),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0xe99(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @TU(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = fcmp ogt double %5, 1.000000e+02
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 5, i32* %2
br label %18
8: ; preds = %1
%9 = load double, double* %3
%10 = load double, double* %3
%11 = call double @sqrt(double %10)
%12 = fmul double -4.917000e-02, %11
%13 = call double @llvm.fmuladd.f64(double -1.139000e-02, double %9, double %12)
%14 = call double @exp(double %13)
%15 = fmul double 9.734000e+01, %14
store double %15, double* %4
%16 = load double, double* %4
%17 = fptosi double %16 to i32
store i32 %17, i32* %2
br label %18
18: ; preds = %8, %7
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @TU(double %0) {
%2 = fcmp ogt double %0, 1.000000e+02
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call double @sqrt(double %0)
%5 = fmul double %4, -4.917000e-02
%6 = tail call double @llvm.fmuladd.f64(double %0, double -1.139000e-02, double %5)
%7 = tail call double @exp(double %6)
%8 = fmul double %7, 9.734000e+01
%9 = fptosi double %8 to i32
br label %10
10: ; preds = %1, %3
%11 = phi i32 [ %9, %3 ], [ 5, %1 ]
ret i32 %11
}
void op0xEC(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ct2db_cmdline_parser_release(struct ct2db_args_info *);
void ct2db_cmdline_parser_free(struct ct2db_args_info *args_info) {
  ct2db_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<ct2db_cmdline_parser_free>:
jmp    1030 <ct2db_cmdline_parser_release@plt>

LLVM IR (-O0):
%struct.ct2db_args_info = type { i32 }
define void @ct2db_cmdline_parser_free(%struct.ct2db_args_info* %0) {
%2 = alloca %struct.ct2db_args_info*
store %struct.ct2db_args_info* %0, %struct.ct2db_args_info** %2
%3 = load %struct.ct2db_args_info*, %struct.ct2db_args_info** %2
%4 = call i32 @ct2db_cmdline_parser_release(%struct.ct2db_args_info* %3)
ret void
}

LLVM IR (-O2):
%struct.ct2db_args_info = type { i32 }
define void @ct2db_cmdline_parser_free(%struct.ct2db_args_info* %0) {
%2 = tail call i32 @ct2db_cmdline_parser_release(%struct.ct2db_args_info* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ getegid();
int /*<<< orphan*/ setresgid(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ what_did_you_say();
int main(int argc, char *argv[]) {
  gid_t gid = getegid();
  setresgid(gid, gid, gid);
  what_did_you_say();
  return 0;
}


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)
mov    $0x0,%al
call   1050 <getegid@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <setresgid@plt>
mov    $0x0,%al
call   1030 <what_did_you_say@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <getegid@plt>
mov    %eax,%edi
mov    %eax,%esi
mov    %eax,%edx
call   1040 <setresgid@plt>
xor    %eax,%eax
call   1030 <what_did_you_say@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @getegid()
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @setresgid(i32 %8, i32 %9, i32 %10)
%12 = call i32 (...) @what_did_you_say()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getegid()
%4 = tail call i32 @setresgid(i32 %3, i32 %3, i32 %3)
%5 = tail call i32 (...) @what_did_you_say()
ret i32 0
}
/* Variables and functions */
int Reply(int /*<<< orphan*/, void *, int /*<<< orphan*/);
int /*<<< orphan*/ _assert(int, char *, int, char *);
void test_rply_notrplyblk(void) {
  int rc;
  rc = Reply(0, ((void *)0), 0);
  _assert((rc == -3),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/mthiffau/HeatheRTOS/refs/heads/master/"
          "test/test_ipc.c",
          139, "rc == -3");
}


x86 assembly (clang, -O0):
<test_rply_notrplyblk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%esi
mov    %edx,%edi
call   1030 <Reply@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xfffffffd,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xeb5(%rip),%rsi
mov    $0x8b,%edx
lea    0xf39(%rip),%rcx
call   1040 <_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rply_notrplyblk>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <Reply@plt>
xor    %edi,%edi
cmp    $0xfffffffd,%eax
sete   %dil
lea    0xec4(%rip),%rsi
lea    0xf4d(%rip),%rcx
mov    $0x8b,%edx
pop    %rax
jmp    1040 <_assert@plt>

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/mthiffau/HeatheRTOS/refs/heads/master/test/test_ipc.c\00"
@.str.1 = [9 x i8] c"rc == -3\00"
define void @test_rply_notrplyblk() {
%1 = alloca i32
%2 = call i32 @Reply(i32 0, i8* null, i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -3
%5 = zext i1 %4 to i32
%6 = call i32 @_assert(i32 %5, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 139, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/mthiffau/HeatheRTOS/refs/heads/master/test/test_ipc.c\00"
@.str.1 = [9 x i8] c"rc == -3\00"
define void @test_rply_notrplyblk() {
%1 = tail call i32 @Reply(i32 0, i8* null, i32 0)
%2 = icmp eq i32 %1, -3
%3 = zext i1 %2 to i32
%4 = tail call i32 @_assert(i32 %3, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 139, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printscore(int, int, int, int, int);
int main(void) {
  int game, multi, totalscore, hints, deduct, minus;
  game = 2000;
  multi = 1;
  totalscore = game * multi;
  hints = 2;
  deduct = 100;
  if (110 <= 180) {
    multi++;
  }
  if (2 > 0) {
    minus = hints * deduct;
    totalscore = totalscore - minus;
  }
  printscore(game, multi, totalscore, hints, minus);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7d0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x64,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
call   1030 <printscore@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7d0,%edi
mov    $0x2,%esi
mov    $0x708,%edx
mov    $0x2,%ecx
mov    $0xc8,%r8d
call   1030 <printscore@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 2000, i32* %2
store i32 1, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %4
store i32 2, i32* %5
store i32 100, i32* %6
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = mul nsw i32 %13, %14
store i32 %15, i32* %7
%16 = load i32, i32* %4
%17 = load i32, i32* %7
%18 = sub nsw i32 %16, %17
store i32 %18, i32* %4
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = call i32 @printscore(i32 %19, i32 %20, i32 %21, i32 %22, i32 %23)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printscore(i32 2000, i32 2, i32 1800, i32 2, i32 200)
ret i32 0
}
/* Variables and functions */
scalar_t__ getbit();
void skiptoeol() {
  int n;
  for (n = 0; n < 11;)
    if (getbit() == 0)
      n++;
  while (getbit() == 0)
    ;
}


x86 assembly (clang, -O0):
<skiptoeol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xb,-0x4(%rbp)
jge    1148 <skiptoeol+0x38>
mov    $0x0,%al
call   1030 <getbit@plt>
cmp    $0x0,%rax
jne    1143 <skiptoeol+0x33>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <skiptoeol+0xf>
jmp    114d <skiptoeol+0x3d>
mov    $0x0,%al
call   1030 <getbit@plt>
cmp    $0x0,%rax
jne    1163 <skiptoeol+0x53>
jmp    114d <skiptoeol+0x3d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skiptoeol>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <getbit@plt>
cmp    $0x1,%rax
adc    $0x0,%ebx
cmp    $0xb,%ebx
jb     1120 <skiptoeol+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <getbit@plt>
test   %rax,%rax
je     1140 <skiptoeol+0x30>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @skiptoeol() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 (...) @getbit()
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = add nuw nsw i32 %2, %5
%7 = icmp ult i32 %6, 11
br i1 %7, label %1, label %8
8: ; preds = %1, %8
%9 = tail call i64 (...) @getbit()
%10 = icmp eq i64 %9, 0
br i1 %10, label %8, label %11
11: ; preds = %8
ret void
}
/* Variables and functions */
char *form_getvar(char const *);
char *strdup(char const *);
int form_gets(const char *name, char **var) {
  const char *str = form_getvar(name);
  if (!str)
    return -1;
  *var = strdup(str);
  return (str[0] ? 1 : 0);
}


x86 assembly (clang, -O0):
<form_gets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <form_getvar@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1154 <form_gets+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <form_gets+0x5e>
mov    -0x20(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<form_gets>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <form_getvar@plt>
test   %rax,%rax
je     1149 <form_gets+0x29>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strdup@plt>
mov    %rax,(%r14)
xor    %eax,%eax
cmpb   $0x0,(%rbx)
setne  %al
jmp    114e <form_gets+0x2e>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @form_gets(i8* %0, i8** nocapture writeonly %1) {
%3 = tail call i8* @form_getvar(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i8* @strdup(i8* %3)
store i8* %6, i8** %1
%7 = load i8, i8* %3
%8 = icmp ne i8 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ %9, %5 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char volatile);
void enable_irq_sff() {
  volatile unsigned char r_val;
  r_val = *((volatile unsigned char *)(0xfff20000 + 0x0000)) | 0x1E;
  *((volatile unsigned char *)(0xfff20000 + 0x0000)) = r_val;
  printf("control_register 0x%X \n\n",
         *((volatile unsigned char *)(0xfff20000 + 0x0000)));
}


x86 assembly (clang, -O0):
<enable_irq_sff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xfff20000,%eax
mov    (%rax),%al
movzbl %al,%eax
or     $0x1e,%eax
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%cl
mov    $0xfff20000,%eax
mov    %cl,(%rax)
mov    $0xfff20000,%eax
mov    (%rax),%al
lea    0xec0(%rip),%rdi
movzbl %al,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_irq_sff>:
mov    $0xfff20000,%eax
mov    (%rax),%cl
or     $0x1e,%cl
mov    %cl,-0x1(%rsp)
mov    -0x1(%rsp),%cl
mov    %cl,(%rax)
movzbl (%rax),%esi
lea    0xed2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"control_register 0x%X \0A\0A\00"
define void @enable_irq_sff() {
%1 = alloca i8
%2 = load volatile i8, i8* inttoptr (i64 4294049792 to i8*)
%3 = zext i8 %2 to i32
%4 = or i32 %3, 30
%5 = trunc i32 %4 to i8
store volatile i8 %5, i8* %1
%6 = load volatile i8, i8* %1
store volatile i8 %6, i8* inttoptr (i64 4294049792 to i8*)
%7 = load volatile i8, i8* inttoptr (i64 4294049792 to i8*)
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 zeroext %7)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"control_register 0x%X \0A\0A\00"
define void @enable_irq_sff() {
%1 = alloca i8
%2 = load volatile i8, i8* inttoptr (i64 4294049792 to i8*)
%3 = or i8 %2, 30
store volatile i8 %3, i8* %1
%4 = load volatile i8, i8* %1
store volatile i8 %4, i8* inttoptr (i64 4294049792 to i8*)
%5 = load volatile i8, i8* inttoptr (i64 4294049792 to i8*)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8 zeroext %5)
ret void
}
void efi_bgrt_init(void) {}


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

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

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

LLVM IR (-O2):
define void @efi_bgrt_init() {
ret void
}
int test_imm_8Buint16_mem(unsigned short *val) {
  return ((*val) & (-0x8B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Buint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff75,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Buint16_mem>:
movzwl (%rdi),%eax
test   $0xff75,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Buint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -139
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_get_base() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_get_base"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_memblockq_get_base\0A\00"
define i32 @pa_memblockq_get_base() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_memblockq_get_base\00"
define i32 @pa_memblockq_get_base() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
unsigned exception_vector(void) {
  unsigned char vector;
  asm("movb %%gs:4, %0" : "=q"(vector));
  return vector;
}


x86 assembly (clang, -O0):
<exception_vector>:
push   %rbp
mov    %rsp,%rbp
mov    %gs:0x4,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exception_vector>:
mov    %gs:0x4,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @exception_vector() {
%1 = alloca i8
%2 = call i8 asm "movb %gs:4, $0", "=q,~{dirflag},~{fpsr},~{flags}"()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @exception_vector() {
%1 = tail call i8 asm "movb %gs:4, $0", "=q,~{dirflag},~{fpsr},~{flags}"()
%2 = zext i8 %1 to i32
ret i32 %2
}
unsigned long wkup_m3_copy_aux_data(void *data, int sz) { return -1; }


x86 assembly (clang, -O0):
<wkup_m3_copy_aux_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wkup_m3_copy_aux_data>:
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @wkup_m3_copy_aux_data(i8* nocapture readnone %0, i32 %1) {
ret i64 -1
}
/* Variables and functions */
int SNDCTL_DSP_SETFRAGMENT;
int main(int argc, char **argv) { return SNDCTL_DSP_SETFRAGMENT; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@SNDCTL_DSP_SETFRAGMENT = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @SNDCTL_DSP_SETFRAGMENT
ret i32 %3
}
OP(dd, f3) { op_f3(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_f3@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_f3()
ret i32 undef
}
void mystrcpy(char *s, char *t) {
  while (*s++ = *t++)
    ;
}


x86 assembly (clang, -O0):
<mystrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <mystrcpy+0x3b>
jmp    110c <mystrcpy+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <mystrcpy+0x10>
ret

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

LLVM IR (-O2):
define void @mystrcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Type definitions */
struct _Locale_time {
  int dummy;
};

/* Variables and functions */
const char *_Locale_am_str(struct _Locale_time *ltime) { return "AM"; }


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

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

LLVM IR (-O0):
%struct._Locale_time = type { i32 }
@.str = [3 x i8] c"AM\00"
define i8* @_Locale_am_str(%struct._Locale_time* %0) {
%2 = alloca %struct._Locale_time*
store %struct._Locale_time* %0, %struct._Locale_time** %2
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct._Locale_time = type { i32 }
@.str = [3 x i8] c"AM\00"
define i8* @_Locale_am_str(%struct._Locale_time* nocapture readnone %0) {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
count_5(void) {}


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

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

LLVM IR (-O0):
define i32 @count_5() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @count_5() {
ret i32 undef
}
/* Variables and functions */
int interactive_loop();
int /*<<< orphan*/ welcome_message();
int interactive_calculator(void) {
  welcome_message();
  return interactive_loop();
}


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

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

LLVM IR (-O0):
define i32 @interactive_calculator() {
%1 = call i32 (...) @welcome_message()
%2 = call i32 (...) @interactive_loop()
ret i32 %2
}

LLVM IR (-O2):
define i32 @interactive_calculator() {
%1 = tail call i32 (...) @welcome_message()
%2 = tail call i32 (...) @interactive_loop()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void searchResult(int d, int pos) {
  if (pos == -1) {
    printf("Element %d is not in list\n", d);
  } else {
    printf("Element %d is found at index %d\n", d, pos);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<searchResult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    113e <searchResult+0x2e>
mov    -0x4(%rbp),%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1152 <searchResult+0x42>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<searchResult>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
cmp    $0xffffffff,%edx
je     113a <searchResult+0x1a>
lea    0xeea(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1148 <searchResult+0x28>
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Element %d is not in list\0A\00"
@.str.1 = [33 x i8] c"Element %d is found at index %d\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @searchResult(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 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %14
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
br label %14
14: ; preds = %10, %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Element %d is not in list\0A\00"
@.str.1 = [33 x i8] c"Element %d is found at index %d\0A\00"
define void @searchResult(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, -1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @putchar(i32 10)
ret void
}
int compare(const void *a, const void *b) {
  char ia = *(char *)a;
  char ib = *(char *)b;
  return ia - ib;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movsbl -0x11(%rbp),%eax
movsbl -0x12(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = sext i8 %3 to i32
%6 = sext i8 %4 to i32
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ system(char *);
void interReplay(char *bssid, char *mon) {
  char cmd[256];
  sprintf(
      cmd,
      "xterm 2> /dev/null -T InteractivePacketReplay -e \"aireplay-ng -2 -b %s "
      "-t 1 -c FF:FF:FF:FF:FF:FF -p 0841 %s --ignore-negative-one\" &",
      bssid, mon);
  system(cmd);
}


x86 assembly (clang, -O0):
<interReplay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interReplay>:
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xecb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [133 x i8] c"xterm 2> /dev/null -T InteractivePacketReplay -e \22aireplay-ng -2 -b %s -t 1 -c FF:FF:FF:FF:FF:FF -p 0841 %s --ignore-negative-one\22 &\00"
define void @interReplay(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [256 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [133 x i8] c"xterm 2> /dev/null -T InteractivePacketReplay -e \22aireplay-ng -2 -b %s -t 1 -c FF:FF:FF:FF:FF:FF -p 0841 %s --ignore-negative-one\22 &\00"
define void @interReplay(i8* %0, i8* %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @system(i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int ReadPriHdr(FILE *f, unsigned char *buf) {
  if (fread(buf, 6, 1, f) != 1)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<ReadPriHdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x6,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     114c <ReadPriHdr+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <ReadPriHdr+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadPriHdr>:
push   %rax
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x6,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ReadPriHdr(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @fread(i8* %1, i32 6, i32 1, i32* %0)
%4 = icmp ne i32 %3, 1
%5 = sext i1 %4 to i32
ret i32 %5
}