xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_daemon();
int /*<<< orphan*/ test_msg(char *);
int /*<<< orphan*/ test_waitsig();
int bare_run(void) {
  test_msg("Your cpu doesn't support ymm registers, skipping\n");
  test_daemon();
  test_waitsig();
  return 0;
}


x86 assembly (clang, -O0):
<bare_run>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <test_msg@plt>
mov    $0x0,%al
call   1030 <test_daemon@plt>
mov    $0x0,%al
call   1050 <test_waitsig@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bare_run>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <test_msg@plt>
xor    %eax,%eax
call   1030 <test_daemon@plt>
xor    %eax,%eax
call   1050 <test_waitsig@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [50 x i8] c"Your cpu doesn't support ymm registers, skipping\0A\00"
define i32 @bare_run() {
%1 = call i32 @test_msg(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @test_daemon()
%3 = call i32 (...) @test_waitsig()
ret i32 0
}

LLVM IR (-O2):
@.str = [50 x i8] c"Your cpu doesn't support ymm registers, skipping\0A\00"
define i32 @bare_run() {
%1 = tail call i32 @test_msg(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @test_daemon()
%3 = tail call i32 (...) @test_waitsig()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wmemcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, size_t);
void uninitvar_wmemcpy(void) {
  wchar_t *cs;
  wchar_t *c;
  size_t n;
  (void)wmemcpy(cs, c, n);
}


x86 assembly (clang, -O0):
<uninitvar_wmemcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <wmemcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_wmemcpy>:
jmp    1030 <wmemcpy@plt>

LLVM IR (-O0):
define void @uninitvar_wmemcpy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i64
%4 = load i32*, i32** %1
%5 = load i32*, i32** %2
%6 = load i64, i64* %3
%7 = call i32 @wmemcpy(i32* %4, i32* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wmemcpy() {
%1 = tail call i32 @wmemcpy(i32* undef, i32* undef, i64 undef)
ret void
}
void c_fill() { ; }


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

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

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

LLVM IR (-O2):
define void @c_fill() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_init() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_init"
         "\n");
}


x86 assembly (clang, -O0):
<pa_cvolume_init>:
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_cvolume_init>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_cvolume_init\00"
define i32 @pa_cvolume_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show_usage(int argc, char **argv) {
  printf("Usage : %s duration (s)", argv[0]);
  printf(" [-n] (disable writer delay)");
  printf("\n");
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
push   %rax
mov    (%rsi),%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Usage : %s duration (s)\00"
@.str.1 = [29 x i8] c" [-n] (disable writer delay)\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @show_usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%10 = 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 = [24 x i8] c"Usage : %s duration (s)\00"
@.str.1 = [29 x i8] c" [-n] (disable writer delay)\00"
define void @show_usage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @putchar(i32 10)
ret void
}
signed char getRange(char *buf, long unit) { return *(buf + 4 + unit) & 0x0F; }


x86 assembly (clang, -O0):
<getRange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl 0x4(%rax,%rcx,1),%eax
and    $0xf,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRange>:
mov    0x4(%rdi,%rsi,1),%al
and    $0xf,%al
ret

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

LLVM IR (-O2):
define signext i8 @getRange(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = getelementptr inbounds i8, i8* %3, i64 %1
%5 = load i8, i8* %4
%6 = and i8 %5, 15
ret i8 %6
}
int ascending_int(const void *a, const void *b) {
  return (*(int *)a) - (*(int *)b);
}


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

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

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

LLVM IR (-O2):
define i32 @ascending_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int test_imm_57int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x57 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_57int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x57,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_57int64_highword_mem>:
testb  $0x57,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_57int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 87
%7 = icmp ne i64 %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_57int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 373662154752
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main(void) {
  int i, j, m, n;
  i = 100;
  j = 0;
  m = i + j;
  n = 100 + 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double display_bcs_results(double bcs_score) {
  printf("Final Result - BCS Score = %lf\n\n", bcs_score);
  return 0;
}


x86 assembly (clang, -O0):
<display_bcs_results>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_bcs_results>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Final Result - BCS Score = %lf\0A\0A\00"
define double @display_bcs_results(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), double %3)
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [33 x i8] c"Final Result - BCS Score = %lf\0A\0A\00"
define double @display_bcs_results(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), double %0)
ret double 0.000000e+00
}
/* Variables and functions */
unsigned int csum_sub(unsigned int, unsigned int);
unsigned int csum_block_sub(unsigned int csum, unsigned int csum2, int offset) {
  if (offset & 1)
    csum2 = ((csum2 & 0xFF00FF) << 8) + ((csum2 >> 8) & 0xFF00FF);
  return csum_sub(csum, csum2);
}


x86 assembly (clang, -O0):
<csum_block_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114c <csum_block_sub+0x3c>
mov    -0x8(%rbp),%eax
and    $0xff00ff,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00ff,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <csum_sub@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csum_block_sub>:
test   $0x1,%dl
je     111a <csum_block_sub+0xa>
bswap  %esi
ror    $0x10,%esi
jmp    1030 <csum_sub@plt>

LLVM IR (-O0):
define i32 @csum_block_sub(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = load i32, i32* %5
%12 = and i32 %11, 16711935
%13 = shl i32 %12, 8
%14 = load i32, i32* %5
%15 = lshr i32 %14, 8
%16 = and i32 %15, 16711935
%17 = add i32 %13, %16
store i32 %17, i32* %5
br label %18
18: ; preds = %10, %3
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = call i32 @csum_sub(i32 %19, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @csum_block_sub(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = shl i32 %1, 8
%8 = and i32 %7, -16711936
%9 = lshr i32 %1, 8
%10 = and i32 %9, 16711935
%11 = or i32 %8, %10
br label %12
12: ; preds = %6, %3
%13 = phi i32 [ %11, %6 ], [ %1, %3 ]
%14 = tail call i32 @csum_sub(i32 %0, i32 %13)
ret i32 %14
}
void rop3_105_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_105_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_105_0_0>:
xor    %edx,%esi
xor    (%rdi),%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_105_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
store i8 %26, i8* %27
ret void
}

LLVM IR (-O2):
define void @rop3_105_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %1, %2
%6 = xor i8 %5, %4
%7 = xor i8 %6, -1
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int in4hex(char *ptr) {
  char str[5];
  int val;
  memcpy(str, ptr, 4);
  str[4] = '\0';
  sscanf(str, "%x", &val);
  return val;
}


x86 assembly (clang, -O0):
<in4hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xd(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movb   $0x0,-0x9(%rbp)
lea    -0xd(%rbp),%rdi
lea    0xeb3(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in4hex>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0xb(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
movb   $0x0,0xf(%rsp)
lea    0xeba(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rbx,%rdi
call   1040 <sscanf@plt>
mov    0x4(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
define i32 @in4hex(i8* %0) {
%2 = alloca i8*
%3 = alloca [5 x i8]
%4 = alloca i32
store i8* %0, i8** %2
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 4)
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 4
store i8 0, i8* %8
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%10 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define i32 @in4hex(i8* %0) {
%2 = alloca [5 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = bitcast i32* %3 to i8*
%6 = call i32 @memcpy(i8* %4, i8* %0, i32 4)
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 4
store i8 0, i8* %7
%8 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int read(int, char *, int);
void recv_message(int sockfd) {
  char message[6];
  message[5] = '\0';
  if (read(sockfd, message, 5) != 5) {
    perror("Couldn't read 5 chars");
  } else {
    printf("Message from server: %s\n	", message);
  }
}


x86 assembly (clang, -O0):
<recv_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xa(%rbp),%rsi
mov    $0x5,%edx
call   1040 <read@plt>
cmp    $0x5,%eax
je     116a <recv_message+0x3a>
lea    0xea0(%rip),%rdi
call   1050 <perror@plt>
jmp    117a <recv_message+0x4a>
lea    -0xa(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_message>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x2(%rsp),%rsi
mov    $0x5,%edx
call   1040 <read@plt>
cmp    $0x5,%eax
jne    115d <recv_message+0x2d>
lea    0xec5(%rip),%rdi
lea    0x2(%rsp),%rsi
call   1030 <printf@plt>
pop    %rax
ret
lea    0xe9c(%rip),%rdi
pop    %rax
jmp    1050 <perror@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Couldn't read 5 chars\00"
@.str.1 = [26 x i8] c"Message from server: %s\0A\09\00"
define void @recv_message(i32 %0) {
%2 = alloca i32
%3 = alloca [6 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 5
store i8 0, i8* %4
%5 = load i32, i32* %2
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%7 = call i32 @read(i32 %5, i8* %6, i32 5)
%8 = icmp ne i32 %7, 5
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %14
11: ; preds = %1
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Couldn't read 5 chars\00"
@.str.1 = [26 x i8] c"Message from server: %s\0A\09\00"
define void @recv_message(i32 %0) {
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 5
store i8 0, i8* %4
%5 = call i32 @read(i32 %0, i8* %3, i32 5)
%6 = icmp eq i32 %5, 5
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %11
11: ; preds = %9, %7
ret void
}
/* Variables and functions */
void *bar(void *);
int /*<<< orphan*/ foo();
void *thread_fourth(void *arg) {
  foo();
  return bar(arg);
}


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

x86 assembly (clang, -O2):
<thread_fourth>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <foo@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define i8* @thread_fourth(i8* %0) {
%2 = tail call i32 (...) @foo()
%3 = tail call i8* @bar(i8* %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printPrivate(char *);
void cannotBeLocked(void) { printPrivate("That cannot be locked.\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"That cannot be locked.\0A\00"
define void @cannotBeLocked() {
%1 = call i32 @printPrivate(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"That cannot be locked.\0A\00"
define void @cannotBeLocked() {
%1 = tail call i32 @printPrivate(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
void free_2d_array(int **arr, int rows) {
  int y;
  for (y = 0; y < rows; ++y) {
    free(arr[y]);
  }
  free(arr);
}


x86 assembly (clang, -O0):
<free_2d_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_2d_array+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_2d_array+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_2d_array>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_2d_array+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_2d_array+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_2d_array(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int norx_verify_tag(const unsigned char *tag1, const unsigned char *tag2) {
  size_t i;
  unsigned acc = 0;
  for (i = 0; i < ((((32 * 4)) + 7) / 8); ++i) {
    acc |= tag1[i] ^ tag2[i];
  }
  return (((acc - 1) >> 8) & 1) - 1;
}


x86 assembly (clang, -O0):
<norx_verify_tag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x10,-0x18(%rbp)
jae    1157 <norx_verify_tag+0x57>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
xor    %ecx,%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <norx_verify_tag+0x1b>
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
shr    $0x8,%eax
and    $0x1,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<norx_verify_tag>:
movdqu (%rdi),%xmm0
movdqu (%rsi),%xmm1
pxor   %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
por    %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
por    %xmm0,%xmm1
movdqa %xmm1,%xmm0
psrld  $0x10,%xmm0
por    %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x8,%xmm1
por    %xmm0,%xmm1
movd   %xmm1,%eax
movzbl %al,%eax
add    $0xffffffff,%eax
shr    $0x8,%eax
and    $0x1,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @norx_verify_tag(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %6
store i64 0, i64* %5
br label %7
7: ; preds = %24, %2
%8 = load i64, i64* %5
%9 = icmp ult i64 %8, 16
br i1 %9, label %10, label %27
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i8*, i8** %4
%17 = load i64, i64* %5
%18 = getelementptr inbounds i8, i8* %16, i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = xor i32 %15, %20
%22 = load i32, i32* %6
%23 = or i32 %22, %21
store i32 %23, i32* %6
br label %24
24: ; preds = %10
%25 = load i64, i64* %5
%26 = add i64 %25, 1
store i64 %26, i64* %5
br label %7
27: ; preds = %7
%28 = load i32, i32* %6
%29 = sub i32 %28, 1
%30 = lshr i32 %29, 8
%31 = and i32 %30, 1
%32 = sub i32 %31, 1
ret i32 %32
}

LLVM IR (-O2):
define i32 @norx_verify_tag(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to <16 x i8>*
%4 = load <16 x i8>, <16 x i8>* %3
%5 = bitcast i8* %1 to <16 x i8>*
%6 = load <16 x i8>, <16 x i8>* %5
%7 = xor <16 x i8> %6, %4
%8 = call i8 @llvm.vector.reduce.or.v16i8(<16 x i8> %7)
%9 = zext i8 %8 to i32
%10 = add nuw nsw i32 %9, 511
%11 = lshr i32 %10, 8
%12 = and i32 %11, 1
%13 = add nsw i32 %12, -1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exec_lua(char *);
int /*<<< orphan*/ get_string(char *, char *, int);
void do_cmd_lua_script() {
  char script[80] = "tome_dofile_anywhere(ANGBAND_DIR_CORE, 'gen_idx.lua')";
  if (!get_string("Script:", script, 80))
    return;
  exec_lua(script);
  return;
}


x86 assembly (clang, -O0):
<do_cmd_lua_script>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rsi
lea    0xef8(%rip),%rdi
mov    $0x50,%edx
call   1040 <get_string@plt>
cmp    $0x0,%eax
jne    1170 <do_cmd_lua_script+0x40>
jmp    1179 <do_cmd_lua_script+0x49>
lea    -0x50(%rbp),%rdi
call   1030 <exec_lua@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_lua_script>:
sub    $0x58,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeea(%rip),%rdi
mov    %rsp,%rsi
mov    $0x50,%edx
call   1040 <get_string@plt>
test   %eax,%eax
je     117f <do_cmd_lua_script+0x5f>
mov    %rsp,%rdi
call   1030 <exec_lua@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.do_cmd_lua_script.script = [80 x i8] c"tome_dofile_anywhere(ANGBAND_DIR_CORE, 'gen_idx.lua')\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [8 x i8] c"Script:\00"
define void @do_cmd_lua_script() {
%1 = alloca [80 x i8]
%2 = bitcast [80 x i8]* %1 to i8*
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = call i32 @get_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i32 80)
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %0
br label %10
7: ; preds = %0
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%9 = call i32 @exec_lua(i8* %8)
br label %10
10: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@__const.do_cmd_lua_script.script = [80 x i8] c"tome_dofile_anywhere(ANGBAND_DIR_CORE, 'gen_idx.lua')\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [8 x i8] c"Script:\00"
define void @do_cmd_lua_script() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2, i32 80)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @exec_lua(i8* %2)
br label %7
7: ; preds = %0, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compute(int);
int example_sub_var(int *array, int array_size) {
  compute(10);
  return 0;
}


x86 assembly (clang, -O0):
<example_sub_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xa,%edi
call   1030 <compute@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<example_sub_var>:
push   %rax
mov    $0xa,%edi
call   1030 <compute@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @example_sub_var(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = call i32 @compute(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @example_sub_var(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @compute(i32 10)
ret i32 0
}
double absf(double a) {
  double ret = 0.0;
  if (a < 0) {
    ret = -1 * a;
  } else {
    ret = a;
  }
  return ret;
}


x86 assembly (clang, -O0):
<absf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1136 <absf+0x36>
movsd  0xed9(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1140 <absf+0x40>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @absf(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
void fini_setproctitle(void) {}


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

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

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

LLVM IR (-O2):
define void @fini_setproctitle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void p0_rot2(void) { printf("p0_rot2()\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"p0_rot2()\00"
define void @p0_rot2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RST(int, int, int);
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_0xff(void) {
  RST(0x38, 5, 8);
  T_WAIT_UNTIL(11);
  return;
}


x86 assembly (clang, -O0):
<op_0xff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38,%edi
mov    $0x5,%esi
mov    $0x8,%edx
call   1030 <RST@plt>
mov    $0xb,%edi
call   1040 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_0xff>:
push   %rax
mov    $0x38,%edi
mov    $0x5,%esi
mov    $0x8,%edx
call   1030 <RST@plt>
mov    $0xb,%edi
pop    %rax
jmp    1040 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_0xff() {
%1 = call i32 @RST(i32 56, i32 5, i32 8)
%2 = call i32 @T_WAIT_UNTIL(i32 11)
ret void
}

LLVM IR (-O2):
define void @op_0xff() {
%1 = tail call i32 @RST(i32 56, i32 5, i32 8)
%2 = tail call i32 @T_WAIT_UNTIL(i32 11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blowfish_keygen();
scalar_t__ get_input();
scalar_t__ put_output();
int main(int argc, char *argv[]) {
  if (get_input())
    return -1;
  blowfish_keygen();
  if (put_output())
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <get_input@plt>
cmp    $0x0,%rax
je     1163 <main+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <main+0x5e>
mov    $0x0,%al
call   1040 <blowfish_keygen@plt>
mov    $0x0,%al
call   1030 <put_output@plt>
cmp    $0x0,%rax
je     1187 <main+0x57>
movl   $0xffffffff,-0x4(%rbp)
jmp    118e <main+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <get_input@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1147 <main+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <blowfish_keygen@plt>
xor    %eax,%eax
call   1030 <put_output@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @get_input()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 (...) @blowfish_keygen()
%7 = tail call i64 (...) @put_output()
%8 = icmp ne i64 %7, 0
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %5, %2
%11 = phi i32 [ -1, %2 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int strcasecmp(char *const, char *const);
int sl_strcasecmp(const void *p1, const void *p2) {
  return strcasecmp(*(char *const *)p1, *(char *const *)p2);
}


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

x86 assembly (clang, -O2):
<sl_strcasecmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @sl_strcasecmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcasecmp(i8* %4, i8* %6)
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t md5_F(uint32_t x, uint32_t y, uint32_t z) {
  return ((x & y) | ((~x) & z));
}


x86 assembly (clang, -O0):
<md5_F>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<md5_F>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @md5_F(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
int right_index(int x) { return (x << 1) + 2; }


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

x86 assembly (clang, -O2):
<right_index>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @right_index(i32 %0) {
%2 = shl i32 %0, 1
%3 = add nsw i32 %2, 2
ret i32 %3
}
const char *copy_key(const char *e) {
  return _mc_strdup(e, __FUNCTION__,
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/hdijkema/elementals/"
                    "refs/heads/master/src/hash.c",
                    31);
}


x86 assembly (clang, -O0):
<copy_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xedb(%rip),%rdx
mov    $0x1f,%ecx
mov    $0x0,%al
call   1030 <_mc_strdup@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_key>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xeea(%rip),%rdx
mov    $0x1f,%ecx
xor    %eax,%eax
call   1030 <_mc_strdup@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
@__FUNCTION__.copy_key = [9 x i8] c"copy_key\00"
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hdijkema/elementals/refs/heads/master/src/hash.c\00"
define i8* @copy_key(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @_mc_strdup to i32 (i8*, i8*, i8*, i32, ...)*)(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.copy_key, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 31)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
@__FUNCTION__.copy_key = [9 x i8] c"copy_key\00"
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hdijkema/elementals/refs/heads/master/src/hash.c\00"
define i8* @copy_key(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @_mc_strdup to i32 (i8*, i8*, i8*, i32, ...)*)(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.copy_key, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 31)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
char *int2str_base_0pad(unsigned int, int *, int, int /*<<< orphan*/);
char *int2str_base(unsigned int l, int *len, int base) {
  return int2str_base_0pad(l, len, base, 0);
}


x86 assembly (clang, -O0):
<int2str_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <int2str_base_0pad@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2str_base>:
xor    %ecx,%ecx
jmp    1030 <int2str_base_0pad@plt>

LLVM IR (-O0):
define i8* @int2str_base(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i8* @int2str_base_0pad(i32 %7, i32* %8, i32 %9, i32 0)
ret i8* %10
}

LLVM IR (-O2):
define i8* @int2str_base(i32 %0, i32* %1, i32 %2) {
%4 = tail call i8* @int2str_base_0pad(i32 %0, i32* %1, i32 %2, i32 0)
ret i8* %4
}
/* Variables and functions */
scalar_t__ roundf(float);
int to_fixed(const float f) { return (int)roundf(16.0f * f); }


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

x86 assembly (clang, -O2):
<to_fixed>:
mulss  0xee8(%rip),%xmm0
jmp    1030 <roundf@plt>

LLVM IR (-O0):
define i32 @to_fixed(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 1.600000e+01, %3
%5 = call i64 @roundf(float %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @to_fixed(float %0) {
%2 = fmul float %0, 1.600000e+01
%3 = tail call i64 @roundf(float %2)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  switch (8) {
  case 0:
  case 1:
  case 2:
  case 3:
  case 4:
  case 5:
  case 6:
  case 7:
    printf("ERRO");
    break;
  case 8:
    printf("OK");
    break;
  default:
    printf("ERRO");
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void cbt_insert(struct cbt_node *node, char median, struct cbt_node *left,
                struct cbt_node *right) {}


x86 assembly (clang, -O0):
<cbt_insert>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cbt_node = type opaque
define void @cbt_insert(%struct.cbt_node* %0, i8 signext %1, %struct.cbt_node* %2, %struct.cbt_node* %3) {
%5 = alloca %struct.cbt_node*
%6 = alloca i8
%7 = alloca %struct.cbt_node*
%8 = alloca %struct.cbt_node*
store %struct.cbt_node* %0, %struct.cbt_node** %5
store i8 %1, i8* %6
store %struct.cbt_node* %2, %struct.cbt_node** %7
store %struct.cbt_node* %3, %struct.cbt_node** %8
ret void
}

LLVM IR (-O2):
%struct.cbt_node = type opaque
define void @cbt_insert(%struct.cbt_node* nocapture %0, i8 signext %1, %struct.cbt_node* nocapture %2, %struct.cbt_node* nocapture %3) {
ret void
}
IR0AR1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (*p0) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<IR0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    0x10f444(%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0AR1>:
mov    0x10f444(%r9),%eax
mov    %eax,(%r8)
ret

LLVM IR (-O0):
define i32 @IR0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %13
%15 = getelementptr inbounds i32, i32* %14, i64 277777
%16 = load i32, i32* %15
%17 = load i32*, i32** %12
store i32 %16, i32* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @IR0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture %5) {
%7 = getelementptr inbounds i32, i32* %5, i64 277777
%8 = load i32, i32* %7
store i32 %8, i32* %4
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int link(const char *oldpath, const char *newpath) {
  printf("TODO: link() not yet implemented!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"TODO: link() not yet implemented!\0A\00"
define i32 @link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"TODO: link() not yet implemented!\00"
define i32 @link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int getCUDAdevices();
extern int GetCUDADevices() { return getCUDAdevices(); }


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

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

LLVM IR (-O0):
define i32 @GetCUDADevices() {
%1 = call i32 (...) @getCUDAdevices()
ret i32 %1
}

LLVM IR (-O2):
define i32 @GetCUDADevices() {
%1 = tail call i32 (...) @getCUDAdevices()
ret i32 %1
}
int isascii(int ch) { return (unsigned int)ch < 128u; }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 128
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}