xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(unsigned char *, int, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ panic(char *);
void read_data(FILE *f, unsigned char *buf, size_t len) {
  if (fread(buf, sizeof(unsigned char), len, f) != len)
    panic("error reading file\n");
}


x86 assembly (clang, -O0):
<read_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
cmp    -0x18(%rbp),%rax
je     1160 <read_data+0x40>
lea    0xea5(%rip),%rdi
call   1040 <panic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
call   1030 <fread@plt>
cmp    %rbx,%rax
jne    113b <read_data+0x1b>
pop    %rbx
ret
lea    0xebe(%rip),%rdi
pop    %rbx
jmp    1040 <panic@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"error reading file\0A\00"
define void @read_data(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = load i32*, i32** %4
%10 = call i64 @fread(i8* %7, i32 1, i64 %8, i32* %9)
%11 = load i64, i64* %6
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @panic(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"error reading file\0A\00"
define void @read_data(i32* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @fread(i8* %1, i32 1, i64 %2, i32* %0)
%5 = icmp eq i64 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @panic(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
int legal_char(char c) {
  if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') ||
      (c >= '0' && c <= '9') || c == '-' || c == '/' || c == '_')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<legal_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1124 <legal_char+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    117f <legal_char+0x7f>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     113e <legal_char+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    117f <legal_char+0x7f>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1158 <legal_char+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    117f <legal_char+0x7f>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     117f <legal_char+0x7f>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     117f <legal_char+0x7f>
movsbl -0x5(%rbp),%eax
cmp    $0x5f,%eax
jne    118b <legal_char+0x8b>
movl   $0x1,-0x4(%rbp)
jmp    1192 <legal_char+0x92>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<legal_char>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
lea    -0x2f(%rdi),%ecx
cmp    $0xb,%cl
setb   %cl
or     %al,%cl
cmp    $0x5f,%dil
sete   %al
cmp    $0x2d,%dil
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @legal_char(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %39, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %39, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 48
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 57
br i1 %26, label %39, label %27
27: ; preds = %23, %19
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 45
br i1 %30, label %39, label %31
31: ; preds = %27
%32 = load i8, i8* %3
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 47
br i1 %34, label %39, label %35
35: ; preds = %31
%36 = load i8, i8* %3
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 95
br i1 %38, label %39, label %40
39: ; preds = %35, %31, %27, %23, %15, %7
store i32 1, i32* %2
br label %41
40: ; preds = %35
store i32 0, i32* %2
br label %41
41: ; preds = %40, %39
%42 = load i32, i32* %2
ret i32 %42
}

LLVM IR (-O2):
define i32 @legal_char(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -47
%6 = icmp ult i8 %5, 11
%7 = or i1 %6, %4
%8 = icmp eq i8 %0, 95
%9 = icmp eq i8 %0, 45
%10 = or i1 %8, %9
%11 = or i1 %10, %7
%12 = zext i1 %11 to i32
ret i32 %12
}
unsigned bitCount_fun_ullong(unsigned long long x) {
  unsigned r = x & 1;
  while (x >>= 1)
    r += x & 1;
  return r;
}


x86 assembly (clang, -O0):
<bitCount_fun_ullong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     113f <bitCount_fun_ullong+0x3f>
mov    -0x8(%rbp),%rcx
and    $0x1,%rcx
mov    -0xc(%rbp),%eax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
jmp    1113 <bitCount_fun_ullong+0x13>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitCount_fun_ullong>:
mov    %edi,%eax
and    $0x1,%eax
cmp    $0x2,%rdi
jb     1123 <bitCount_fun_ullong+0x23>
mov    %rdi,%rcx
xchg   %ax,%ax
shr    %rcx
mov    %ecx,%edx
and    $0x1,%edx
add    %edx,%eax
cmp    $0x3,%rdi
mov    %rcx,%rdi
ja     1110 <bitCount_fun_ullong+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitCount_fun_ullong(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = and i32 %2, 1
%4 = icmp ult i64 %0, 2
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i64 [ %8, %5 ], [ %0, %1 ]
%7 = phi i32 [ %11, %5 ], [ %3, %1 ]
%8 = lshr i64 %6, 1
%9 = trunc i64 %8 to i32
%10 = and i32 %9, 1
%11 = add i32 %10, %7
%12 = icmp ult i64 %6, 4
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ %3, %1 ], [ %11, %5 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char **file_to_string(int /*<<< orphan*/ *);
int /*<<< orphan*/ *open_file(char const *);
int main(int argc, char const *argv[]) {
  FILE *arquivo = open_file(argv[1]);
  if (arquivo == NULL) {
    return 1;
  }
  char **str = file_to_string(arquivo);
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <open_file@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <main+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1172 <main+0x52>
mov    -0x18(%rbp),%rdi
call   1040 <file_to_string@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <open_file@plt>
test   %rax,%rax
je     113b <main+0x1b>
mov    %rax,%rdi
call   1040 <file_to_string@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%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*
%7 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32* @open_file(i8* %10)
store i32* %11, i32** %6
%12 = load i32*, i32** %6
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 1, i32* %3
br label %18
15: ; preds = %2
%16 = load i32*, i32** %6
%17 = call i8** @file_to_string(i32* %16)
store i8** %17, i8*** %7
store i32 0, i32* %3
br label %18
18: ; preds = %15, %14
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32* @open_file(i8* %4)
%6 = icmp eq i32* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i8** @file_to_string(i32* %5)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ iscntrl(int);
void t_iscntrl_0x0f() {
  Assert_real((iscntrl(15)),
              "/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_iscntrl.c",
              80, ("iscntrl should be 1 for 0x0f"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x0f>:
push   %rax
mov    $0xf,%edi
call   1030 <iscntrl@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x50,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x0f\00"
define void @t_iscntrl_0x0f() {
%1 = call i32 @iscntrl(i32 15)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 80, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 1 for 0x0f\00"
define void @t_iscntrl_0x0f() {
%1 = tail call i32 @iscntrl(i32 15)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 80, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CalcMinimumDepth(int);
int CalcTreeSize2(int, int /*<<< orphan*/);
int CalcTreeSize(int numItems) {
  return CalcTreeSize2(numItems, CalcMinimumDepth(numItems));
}


x86 assembly (clang, -O0):
<CalcTreeSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <CalcMinimumDepth@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <CalcTreeSize2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcTreeSize>:
push   %rbx
mov    %edi,%ebx
call   1040 <CalcMinimumDepth@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <CalcTreeSize2@plt>

LLVM IR (-O0):
define i32 @CalcTreeSize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @CalcMinimumDepth(i32 %4)
%6 = call i32 @CalcTreeSize2(i32 %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @CalcTreeSize(i32 %0) {
%2 = tail call i32 @CalcMinimumDepth(i32 %0)
%3 = tail call i32 @CalcTreeSize2(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
char const *strong_n2();
const char *__attribute__((section(".test.b"))) call_strong_n2(void) {
  return strong_n2() + 1;
}


x86 assembly (clang, -O0):
<call_strong_n2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <strong_n2@plt>
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_strong_n2>:
push   %rax
xor    %eax,%eax
call   1030 <strong_n2@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @call_strong_n2() section ".test.b" {
%1 = call i8* (...) @strong_n2()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}

LLVM IR (-O2):
define i8* @call_strong_n2() section ".test.b" {
%1 = tail call i8* (...) @strong_n2()
%2 = getelementptr inbounds i8, i8* %1, i64 1
ret i8* %2
}
float fmodf(float x, float y) { return 0.0; }


x86 assembly (clang, -O0):
<fmodf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodf>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fmodf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @fmodf(float %0, float %1) {
ret float 0.000000e+00
}
/* Variables and functions */
int foo(int);
int /*<<< orphan*/ printf(char *, int, int (*)(int));
int main() {
  int x = foo(10);
  printf("x is %d, foo is at 0x%p\n", x, foo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeca(%rip),%rdi
mov    0x2eab(%rip),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <foo@plt>
mov    0x2ec6(%rip),%rdx
lea    0xed7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"x is %d, foo is at 0x%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @foo(i32 10)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4, i32 (i32)* @foo)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"x is %d, foo is at 0x%p\0A\00"
define i32 @main() {
%1 = tail call i32 @foo(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1, i32 (i32)* @foo)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ v14_encode(unsigned char *, unsigned char *, int, int,
                              int *);
void v32int_put_bits(unsigned short *in, unsigned short *out, short words,
                     short rate) {
  int txstate = 0;
  v14_encode((unsigned char *)in, (unsigned char *)out, 16 * words, 24 * rate,
             &txstate);
}


x86 assembly (clang, -O0):
<v32int_put_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cx,-0x12(%rbp)
mov    %ax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movswl -0x12(%rbp),%edx
shl    $0x4,%edx
movswl -0x14(%rbp),%eax
imul   $0x18,%eax,%ecx
lea    -0x18(%rbp),%r8
call   1030 <v14_encode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v32int_put_bits>:
push   %rax
movl   $0x0,0x4(%rsp)
shl    $0x4,%edx
shl    $0x3,%ecx
lea    (%rcx,%rcx,2),%ecx
lea    0x4(%rsp),%r8
call   1030 <v14_encode@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @v32int_put_bits(i16* %0, i16* %1, i16 signext %2, i16 signext %3) {
%5 = alloca i16*
%6 = alloca i16*
%7 = alloca i16
%8 = alloca i16
%9 = alloca i32
store i16* %0, i16** %5
store i16* %1, i16** %6
store i16 %2, i16* %7
store i16 %3, i16* %8
store i32 0, i32* %9
%10 = load i16*, i16** %5
%11 = bitcast i16* %10 to i8*
%12 = load i16*, i16** %6
%13 = bitcast i16* %12 to i8*
%14 = load i16, i16* %7
%15 = sext i16 %14 to i32
%16 = mul nsw i32 16, %15
%17 = load i16, i16* %8
%18 = sext i16 %17 to i32
%19 = mul nsw i32 24, %18
%20 = call i32 @v14_encode(i8* %11, i8* %13, i32 %16, i32 %19, i32* %9)
ret void
}

LLVM IR (-O2):
define void @v32int_put_bits(i16* %0, i16* %1, i16 signext %2, i16 signext %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%7 = bitcast i16* %0 to i8*
%8 = bitcast i16* %1 to i8*
%9 = sext i16 %2 to i32
%10 = shl nsw i32 %9, 4
%11 = sext i16 %3 to i32
%12 = mul nsw i32 %11, 24
%13 = call i32 @v14_encode(i8* %7, i8* %8, i32 %10, i32 %12, i32* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exactinit();
void detinit(void) {
  static int initialized = 0;
  int saved, cword;
  (void)saved, (void)cword;
  if (initialized)
    return;
  exactinit();
  initialized = 1;
}


x86 assembly (clang, -O0):
<detinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f0d(%rip)
je     112a <detinit+0x1a>
jmp    113b <detinit+0x2b>
mov    $0x0,%al
call   1030 <exactinit@plt>
movl   $0x1,0x2ef1(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detinit>:
push   %rax
cmpb   $0x0,0x2f14(%rip)
jne    1128 <detinit+0x18>
xor    %eax,%eax
call   1030 <exactinit@plt>
movb   $0x1,0x2f04(%rip)
pop    %rax
ret

LLVM IR (-O0):
@detinit.initialized = internal global i32 0
define void @detinit() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = load i32, i32* @detinit.initialized
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
br label %10
8: ; preds = %0
%9 = call i32 (...) @exactinit()
store i32 1, i32* @detinit.initialized
br label %10
10: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@detinit.initialized = internal unnamed_addr global i1 false
define void @detinit() {
%1 = load i1, i1* @detinit.initialized
br i1 %1, label %4, label %2
2: ; preds = %0
%3 = tail call i32 (...) @exactinit()
store i1 true, i1* @detinit.initialized
br label %4
4: ; preds = %0, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void argPrintVersion(char *szparam) {
  printf("%s %s.%s%s", "randword", "1", "1", "\n");
  exit(0);
}


x86 assembly (clang, -O0):
<argPrintVersion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xed1(%rip),%rsi
lea    0xed3(%rip),%rcx
lea    0xece(%rip),%r8
mov    %rcx,%rdx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<argPrintVersion>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedc(%rip),%rsi
lea    0xede(%rip),%rcx
lea    0xed9(%rip),%r8
mov    %rcx,%rdx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s %s.%s%s\00"
@.str.1 = [9 x i8] c"randword\00"
@.str.2 = [2 x i8] c"1\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @argPrintVersion(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s %s.%s%s\00"
@.str.1 = [9 x i8] c"randword\00"
@.str.2 = [2 x i8] c"1\00"
@.str.3 = [2 x i8] c"\0A\00"
define void @argPrintVersion(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Evert Kasteel\nAdres 123\n");
  printf("Plaats\tTelefoonnummer\n");
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Evert Kasteel\0AAdres 123\0A\00"
@.str.1 = [23 x i8] c"Plaats\09Telefoonnummer\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"Evert Kasteel\0AAdres 123\00"
@str.2 = [22 x i8] c"Plaats\09Telefoonnummer\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void InitializeSSL() {
  SSL_load_error_strings();
  SSL_library_init();
  OpenSSL_add_all_algorithms();
}


x86 assembly (clang, -O0):
<InitializeSSL>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1030 <SSL_library_init@plt>
mov    $0x0,%al
call   1040 <OpenSSL_add_all_algorithms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitializeSSL>:
push   %rax
xor    %eax,%eax
call   1050 <SSL_load_error_strings@plt>
xor    %eax,%eax
call   1030 <SSL_library_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <OpenSSL_add_all_algorithms@plt>

LLVM IR (-O0):
define void @InitializeSSL() {
%1 = call i32 (...) @SSL_load_error_strings()
%2 = call i32 (...) @SSL_library_init()
%3 = call i32 (...) @OpenSSL_add_all_algorithms()
ret void
}

LLVM IR (-O2):
define void @InitializeSSL() {
%1 = tail call i32 (...) @SSL_load_error_strings()
%2 = tail call i32 (...) @SSL_library_init()
%3 = tail call i32 (...) @OpenSSL_add_all_algorithms()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_surfvars_name_data(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void fgmvwrite_surfvars_name_data_(char varname[], char *vids) {
  char name[10];
  strncpy(name, varname, 8);
  *(name + 8) = '\0';
  gmvwrite_surfvars_name_data(name, vids);
}


x86 assembly (clang, -O0):
<fgmvwrite_surfvars_name_data_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1a(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x12(%rbp)
lea    -0x1a(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <gmvwrite_surfvars_name_data@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_surfvars_name_data_>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xe(%rsp),%r14
mov    %r14,%rdi
mov    $0x8,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x16(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <gmvwrite_surfvars_name_data@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @fgmvwrite_surfvars_name_data_(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [10 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strncpy(i8* %6, i8* %7, i32 8)
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds i8, i8* %9, i64 8
store i8 0, i8* %10
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%12 = load i8*, i8** %4
%13 = call i32 @gmvwrite_surfvars_name_data(i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_surfvars_name_data_(i8* %0, i8* %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @strncpy(i8* %4, i8* %0, i32 8)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 8
store i8 0, i8* %6
%7 = call i32 @gmvwrite_surfvars_name_data(i8* %4, i8* %1)
ret void
}
/* Type definitions */
struct symbol {
  int dummy;
};
struct ident {
  int dummy;
};

/* Variables and functions */
scalar_t__ __lookup_member(struct symbol *, struct ident *, int *);
struct symbol *no_member(struct ident *);
struct symbol *lookup_member(struct symbol *type, struct ident *name,
                             int *addr) {
  return __lookup_member(type, name, addr) ?: no_member(name);
}


x86 assembly (clang, -O0):
<lookup_member>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__lookup_member@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1160 <lookup_member+0x40>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    116d <lookup_member+0x4d>
mov    -0x10(%rbp),%rdi
call   1040 <no_member@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup_member>:
push   %rbx
mov    %rsi,%rbx
call   1030 <__lookup_member@plt>
test   %rax,%rax
je     1130 <lookup_member+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <no_member@plt>

LLVM IR (-O0):
%struct.symbol = type { i32 }
%struct.ident = type { i32 }
define %struct.symbol* @lookup_member(%struct.symbol* %0, %struct.ident* %1, i32* %2) {
%4 = alloca %struct.symbol*
%5 = alloca %struct.ident*
%6 = alloca i32*
store %struct.symbol* %0, %struct.symbol** %4
store %struct.ident* %1, %struct.ident** %5
store i32* %2, i32** %6
%7 = load %struct.symbol*, %struct.symbol** %4
%8 = load %struct.ident*, %struct.ident** %5
%9 = load i32*, i32** %6
%10 = call i64 @__lookup_member(%struct.symbol* %7, %struct.ident* %8, i32* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = inttoptr i64 %10 to %struct.symbol*
br label %17
14: ; preds = %3
%15 = load %struct.ident*, %struct.ident** %5
%16 = call %struct.symbol* @no_member(%struct.ident* %15)
br label %17
17: ; preds = %14, %12
%18 = phi %struct.symbol* [ %13, %12 ], [ %16, %14 ]
ret %struct.symbol* %18
}

LLVM IR (-O2):
%struct.symbol = type { i32 }
%struct.ident = type { i32 }
define %struct.symbol* @lookup_member(%struct.symbol* %0, %struct.ident* %1, i32* %2) {
%4 = tail call i64 @__lookup_member(%struct.symbol* %0, %struct.ident* %1, i32* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = inttoptr i64 %4 to %struct.symbol*
br label %10
8: ; preds = %3
%9 = tail call %struct.symbol* @no_member(%struct.ident* %1)
br label %10
10: ; preds = %8, %6
%11 = phi %struct.symbol* [ %7, %6 ], [ %9, %8 ]
ret %struct.symbol* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void print_version(void) {
  printf("%s %s by %s\n", "tasknc", "v0.8", "mjheagle");
}


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

x86 assembly (clang, -O2):
<print_version>:
lea    0xee9(%rip),%rdi
lea    0xeef(%rip),%rsi
lea    0xeef(%rip),%rdx
lea    0xeed(%rip),%rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s %s by %s\0A\00"
@.str.1 = [7 x i8] c"tasknc\00"
@.str.2 = [5 x i8] c"v0.8\00"
@.str.3 = [9 x i8] c"mjheagle\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s %s by %s\0A\00"
@.str.1 = [7 x i8] c"tasknc\00"
@.str.2 = [5 x i8] c"v0.8\00"
@.str.3 = [9 x i8] c"mjheagle\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void unlock_mtab(void) { unlink("/etc/mtab~"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"/etc/mtab~\00"
define void @unlock_mtab() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"/etc/mtab~\00"
define void @unlock_mtab() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
void playlist_select() {}


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

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

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

LLVM IR (-O2):
define void @playlist_select() {
ret void
}
char getcmd() {
  char ch = getchar();
  while (ch == '\n' || ch == ' ')
    ch = getchar;
  return ch;
}


x86 assembly (clang, -O0):
<getcmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     1131 <getcmd+0x31>
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1141 <getcmd+0x41>
jmp    1150 <getcmd+0x50>
mov    0x2e98(%rip),%rax
mov    %al,-0x1(%rbp)
jmp    1112 <getcmd+0x12>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcmd>:
push   %rax
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ecx
mov    0x2ed0(%rip),%dl
mov    %ecx,%eax
mov    %edx,%ecx
cmp    $0xa,%al
je     1110 <getcmd+0x10>
mov    %edx,%ecx
cmp    $0x20,%al
je     1110 <getcmd+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @getcmd() {
%1 = alloca i8
%2 = call i32 (...) @getchar()
%3 = trunc i32 %2 to i8
store i8 %3, i8* %1
br label %4
4: ; preds = %14, %0
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 10
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 32
br label %12
12: ; preds = %8, %4
%13 = phi i1 [ true, %4 ], [ %11, %8 ]
br i1 %13, label %14, label %15
14: ; preds = %12
store i8 ptrtoint (i32 (...)* @getchar to i8), i8* %1
br label %4
15: ; preds = %12
%16 = load i8, i8* %1
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @getcmd() {
%1 = tail call i32 (...) @getchar()
%2 = trunc i32 %1 to i8
br label %3
3: ; preds = %5, %0
%4 = phi i8 [ %2, %0 ], [ ptrtoint (i32 (...)* @getchar to i8), %5 ]
switch i8 %4, label %6 [
i8 32, label %5
i8 10, label %5
]
5: ; preds = %3, %3
br label %3
6: ; preds = %3
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  if (n % 2 == 0) {
    printf("even");
  } else {
    printf("odd");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1164 <main+0x44>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xec5(%rip),%rax
lea    0xec3(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"even\00"
@.str.2 = [4 x i8] c"odd\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"even\00"
@.str.2 = [4 x i8] c"odd\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SMLAD(uint32_t x, uint32_t y,
                                          uint32_t sum) {
  return ((uint32_t)(((((int32_t)x << 16) >> 16) * (((int32_t)y << 16) >> 16)) +
                     ((((int32_t)x) >> 16) * (((int32_t)y) >> 16)) +
                     (((int32_t)sum))));
}


x86 assembly (clang, -O0):
<__SMLAD>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
sar    $0x10,%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%rcx
sar    $0x10,%ecx
mov    -0x10(%rbp),%rdx
sar    $0x10,%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    -0x18(%rbp),%rcx
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SMLAD>:
movswl %di,%eax
movswl %si,%ecx
imul   %eax,%ecx
sar    $0x10,%edi
sar    $0x10,%esi
imul   %edi,%esi
add    %esi,%edx
add    %ecx,%edx
movslq %edx,%rax
ret

LLVM IR (-O0):
define i64 @__SMLAD(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 16
%14 = ashr i32 %13, 16
%15 = mul nsw i32 %10, %14
%16 = load i64, i64* %4
%17 = trunc i64 %16 to i32
%18 = ashr i32 %17, 16
%19 = load i64, i64* %5
%20 = trunc i64 %19 to i32
%21 = ashr i32 %20, 16
%22 = mul nsw i32 %18, %21
%23 = add nsw i32 %15, %22
%24 = load i64, i64* %6
%25 = trunc i64 %24 to i32
%26 = add nsw i32 %23, %25
%27 = sext i32 %26 to i64
ret i64 %27
}

LLVM IR (-O2):
define i64 @__SMLAD(i64 %0, i64 %1, i64 %2) {
%4 = trunc i64 %0 to i32
%5 = shl i32 %4, 16
%6 = ashr exact i32 %5, 16
%7 = trunc i64 %1 to i32
%8 = shl i32 %7, 16
%9 = ashr exact i32 %8, 16
%10 = mul nsw i32 %9, %6
%11 = ashr i32 %4, 16
%12 = ashr i32 %7, 16
%13 = mul nsw i32 %12, %11
%14 = trunc i64 %2 to i32
%15 = add i32 %13, %14
%16 = add i32 %15, %10
%17 = sext i32 %16 to i64
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, double);
void session_print_timestamp(char *buf, int bufs, double ts) {
  snprintf(buf, bufs, "% 12.9f\t", ts);
}


x86 assembly (clang, -O0):
<session_print_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
lea    0xec9(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<session_print_timestamp>:
lea    0xee9(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"% 12.9f\09\00"
define void @session_print_timestamp(i8* %0, i32 %1, double %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca double
store i8* %0, i8** %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load double, double* %6
%10 = call i32 @snprintf(i8* %7, i32 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %9)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"% 12.9f\09\00"
define void @session_print_timestamp(i8* %0, i32 %1, double %2) {
%4 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %2)
ret void
}
/* Variables and functions */
unsigned long GetFPS37();
unsigned long getfps() { return GetFPS37(); }


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

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

LLVM IR (-O0):
define i64 @getfps() {
%1 = call i64 (...) @GetFPS37()
ret i64 %1
}

LLVM IR (-O2):
define i64 @getfps() {
%1 = tail call i64 (...) @GetFPS37()
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_le16(int /*<<< orphan*/, void *);
void put_unaligned_le16(uint16_t val, void *p) { __put_unaligned_le16(val, p); }


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

x86 assembly (clang, -O2):
<put_unaligned_le16>:
jmp    1030 <__put_unaligned_le16@plt>

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

LLVM IR (-O2):
define void @put_unaligned_le16(i32 %0, i8* %1) {
%3 = tail call i32 @__put_unaligned_le16(i32 %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ const *);
struct tm *localtime_r(const time_t *t, struct tm *tm) {
  struct tm *tmp;
  if ((tmp = localtime(t)) && tm)
    *tm = *tmp;
  else
    return 0;
  return tm;
}


x86 assembly (clang, -O0):
<localtime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1153 <localtime_r+0x43>
cmpq   $0x0,-0x18(%rbp)
je     1153 <localtime_r+0x43>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
jmp    1160 <localtime_r+0x50>
movq   $0x0,-0x8(%rbp)
jmp    1168 <localtime_r+0x58>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<localtime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <localtime@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rbx,%rbx
je     112f <localtime_r+0x1f>
test   %rcx,%rcx
je     112f <localtime_r+0x1f>
mov    (%rcx),%eax
mov    %eax,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @localtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca %struct.tm*
%4 = alloca i32*
%5 = alloca %struct.tm*
%6 = alloca %struct.tm*
store i32* %0, i32** %4
store %struct.tm* %1, %struct.tm** %5
%7 = load i32*, i32** %4
%8 = call %struct.tm* @localtime(i32* %7)
store %struct.tm* %8, %struct.tm** %6
%9 = icmp ne %struct.tm* %8, null
br i1 %9, label %10, label %18
10: ; preds = %2
%11 = load %struct.tm*, %struct.tm** %5
%12 = icmp ne %struct.tm* %11, null
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load %struct.tm*, %struct.tm** %5
%15 = load %struct.tm*, %struct.tm** %6
%16 = bitcast %struct.tm* %14 to i8*
%17 = bitcast %struct.tm* %15 to i8*
br label %19
18: ; preds = %10, %2
store %struct.tm* null, %struct.tm** %3
br label %21
19: ; preds = %13
%20 = load %struct.tm*, %struct.tm** %5
store %struct.tm* %20, %struct.tm** %3
br label %21
21: ; preds = %19, %18
%22 = load %struct.tm*, %struct.tm** %3
ret %struct.tm* %22
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @localtime_r(i32* %0, %struct.tm* writeonly %1) {
%3 = tail call %struct.tm* @localtime(i32* %0)
%4 = icmp ne %struct.tm* %3, null
%5 = icmp ne %struct.tm* %1, null
%6 = and i1 %5, %4
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = getelementptr %struct.tm, %struct.tm* %3, i64 0, i32 0
%9 = getelementptr %struct.tm, %struct.tm* %1, i64 0, i32 0
%10 = load i32, i32* %8
store i32 %10, i32* %9
br label %11
11: ; preds = %2, %7
%12 = phi %struct.tm* [ %1, %7 ], [ null, %2 ]
ret %struct.tm* %12
}
int test_imm_13uint32_reg(unsigned int val) {
  return ((val) & (0x13 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_13uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x13,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_13uint32_reg>:
test   $0x13,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_13uint32_reg(i32 %0) {
%2 = and i32 %0, 19
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
int /*<<< orphan*/ wcsrtombs(char *, int /*<<< orphan*/ const **, size_t,
                             int /*<<< orphan*/ *);
void uninivar_wcsrtombs(void) {
  char *dst;
  const wchar_t *p;
  ;
  size_t len;
  mbstate_t *ps;
  (void)wcsrtombs(dst, &p, len, ps);
}


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

x86 assembly (clang, -O2):
<uninivar_wcsrtombs>:
push   %rax
mov    %rsp,%rsi
call   1030 <wcsrtombs@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @uninivar_wcsrtombs() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = call i32 @wcsrtombs(i8* undef, i32** %1, i64 undef, i32* undef)
ret void
}
/* Type definitions */
struct poker_hand {
  int dummy;
};

/* Variables and functions */
int find_four(struct poker_hand const *, int *);
int four_of_a_kind(const struct poker_hand *h) {
  int kicker = 0;
  int val = find_four(h, &kicker);
  if (val < 0)
    return val;
  return val * 0x100000 + kicker;
}


x86 assembly (clang, -O0):
<four_of_a_kind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <find_four@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1148 <four_of_a_kind+0x38>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <four_of_a_kind+0x44>
mov    -0x18(%rbp),%eax
shl    $0x14,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<four_of_a_kind>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <find_four@plt>
mov    %eax,%ecx
shl    $0x14,%ecx
add    0x4(%rsp),%ecx
test   %eax,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.poker_hand = type { i32 }
define i32 @four_of_a_kind(%struct.poker_hand* %0) {
%2 = alloca i32
%3 = alloca %struct.poker_hand*
%4 = alloca i32
%5 = alloca i32
store %struct.poker_hand* %0, %struct.poker_hand** %3
store i32 0, i32* %4
%6 = load %struct.poker_hand*, %struct.poker_hand** %3
%7 = call i32 @find_four(%struct.poker_hand* %6, i32* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = load i32, i32* %5
store i32 %11, i32* %2
br label %17
12: ; preds = %1
%13 = load i32, i32* %5
%14 = mul nsw i32 %13, 1048576
%15 = load i32, i32* %4
%16 = add nsw i32 %14, %15
store i32 %16, i32* %2
br label %17
17: ; preds = %12, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.poker_hand = type { i32 }
define i32 @four_of_a_kind(%struct.poker_hand* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @find_four(%struct.poker_hand* %0, i32* %2)
%5 = icmp slt i32 %4, 0
%6 = shl nsw i32 %4, 20
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
%9 = select i1 %5, i32 %4, i32 %8
ret i32 %9
}
void dummy() { return; }


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

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

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

LLVM IR (-O2):
define void @dummy() {
ret void
}
/* Variables and functions */
scalar_t__ foo(int *);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int c;
  int *p = (void *)foo(&c);
  *p = 3;
  test_assert(c == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <foo@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
cmpl   $0x3,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
movl   $0x3,(%rax)
xor    %edi,%edi
cmpl   $0x3,0x4(%rsp)
sete   %dil
call   1040 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i64 @foo(i32* %2)
%5 = inttoptr i64 %4 to i8*
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
store i32 3, i32* %7
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 3
%10 = zext i1 %9 to i32
%11 = call i32 @test_assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @foo(i32* %1)
%4 = inttoptr i64 %3 to i32*
store i32 3, i32* %4
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 3
%7 = zext i1 %6 to i32
%8 = call i32 @test_assert(i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_unlock_lockfile() {
  printf("NOT IMPLEMENTED:"
         "pa_unlock_lockfile"
         "\n");
}


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

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

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_unlock_lockfile\00"
define i32 @pa_unlock_lockfile() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}