xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ FH_DU();
int /*<<< orphan*/ init();
int /*<<< orphan*/ interface();
int main(void) {
  unsigned int i;
  for (i = 0; i < 373; i++) {
    init();
    interface();
    FH_DU();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x175,-0x8(%rbp)
jae    1176 <main+0x46>
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <interface@plt>
mov    $0x0,%al
call   1050 <FH_DU@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x175,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <interface@plt>
xor    %eax,%eax
call   1050 <FH_DU@plt>
add    $0xffffffff,%ebx
jne    1140 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp ult i32 %4, 373
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = call i32 (...) @init()
%8 = call i32 (...) @interface()
%9 = call i32 (...) @FH_DU()
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @interface()
%5 = tail call i32 (...) @FH_DU()
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 373
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
void clk_put(struct clk *clk) { return; }


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

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

LLVM IR (-O0):
%struct.clk = type opaque
define void @clk_put(%struct.clk* %0) {
%2 = alloca %struct.clk*
store %struct.clk* %0, %struct.clk** %2
ret void
}

LLVM IR (-O2):
%struct.clk = type opaque
define void @clk_put(%struct.clk* nocapture %0) {
ret void
}
unsigned int byte2lendian(unsigned char *b) {
  return b[0] | (b[1] << 8) | (b[2] << 16) | (b[3] << 24);
}


x86 assembly (clang, -O0):
<byte2lendian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @byte2lendian(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 24
%24 = or i32 %18, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @byte2lendian(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
/* Type definitions */
struct rlimit {
  int /*<<< orphan*/ rlim_max;
  int /*<<< orphan*/ rlim_cur;
};

/* Variables and functions */
int /*<<< orphan*/ getrlimit(int, struct rlimit *);
int /*<<< orphan*/ print_hex(int /*<<< orphan*/);
int /*<<< orphan*/ print_string(char *);
void print_rlimit(int resource) {
  struct rlimit rl;
  getrlimit(resource, &rl);
  print_string("cur=0x");
  print_hex(rl.rlim_cur);
  print_string(" max=0x");
  print_hex(rl.rlim_max);
}


x86 assembly (clang, -O0):
<print_rlimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1050 <getrlimit@plt>
lea    0xeb2(%rip),%rdi
call   1030 <print_string@plt>
mov    -0xc(%rbp),%edi
call   1040 <print_hex@plt>
lea    0xea5(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x10(%rbp),%edi
call   1040 <print_hex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_rlimit>:
push   %rax
mov    %rsp,%rsi
call   1050 <getrlimit@plt>
lea    0xec0(%rip),%rdi
call   1030 <print_string@plt>
mov    0x4(%rsp),%edi
call   1040 <print_hex@plt>
lea    0xeb2(%rip),%rdi
call   1030 <print_string@plt>
mov    (%rsp),%edi
call   1040 <print_hex@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.rlimit = type { i32, i32 }
@.str = [7 x i8] c"cur=0x\00"
@.str.1 = [8 x i8] c" max=0x\00"
define void @print_rlimit(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.rlimit
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @getrlimit(i32 %4, %struct.rlimit* %3)
%6 = call i32 @print_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %3, i32 0, i32 1
%8 = load i32, i32* %7
%9 = call i32 @print_hex(i32 %8)
%10 = call i32 @print_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %3, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @print_hex(i32 %12)
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i32, i32 }
@.str = [7 x i8] c"cur=0x\00"
@.str.1 = [8 x i8] c" max=0x\00"
define void @print_rlimit(i32 %0) {
%2 = alloca %struct.rlimit
%3 = bitcast %struct.rlimit* %2 to i8*
%4 = call i32 @getrlimit(i32 %0, %struct.rlimit* %2)
%5 = call i32 @print_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i64 0, i32 1
%7 = load i32, i32* %6
%8 = call i32 @print_hex(i32 %7)
%9 = call i32 @print_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i64 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @print_hex(i32 %11)
ret void
}
long _fun2(long EV_x, long EV_y) {
  if ((EV_x == 0)) {
    return EV_y;
  } else {
    return _fun2((EV_x - 1), EV_y);
  }
}


x86 assembly (clang, -O0):
<_fun2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1138 <_fun2+0x28>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114d <_fun2+0x3d>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_fun2@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fun2>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @_fun2(i64 %0, i64 %1) {
ret i64 %1
}
unsigned long SIO1_readData32(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @SIO1_readData32() {
ret i64 0
}

LLVM IR (-O2):
define i64 @SIO1_readData32() {
ret i64 0
}
void g_signal_new() {}


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

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

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

LLVM IR (-O2):
define void @g_signal_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ printf_base(int);
int main(void) {
  int var = 0;
  for (var = 0; var < 20; var = var + 4) {
    printf_base(var);
    printf("\n\n");
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1169 <main+0x49>
mov    -0x8(%rbp),%edi
call   1030 <printf_base@plt>
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1040 <printf_base@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x4,%edi
call   1040 <printf_base@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x8,%edi
call   1040 <printf_base@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xc,%edi
call   1040 <printf_base@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x10,%edi
call   1040 <printf_base@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 @printf_base(i32 0)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @printf_base(i32 4)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @printf_base(i32 8)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @printf_base(i32 12)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @printf_base(i32 16)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test() { printf("Weasel weasel\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Weasel weasel\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ft_memdel(void **ap) {
  if (ap) {
    if (*ap != NULL)
      free(*ap);
    *ap = NULL;
  }
}


x86 assembly (clang, -O0):
<ft_memdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <ft_memdel+0x3c>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <ft_memdel+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memdel>:
test   %rdi,%rdi
je     112e <ft_memdel+0x1e>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1126 <ft_memdel+0x16>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_memdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
br label %8
8: ; preds = %6, %3
store i8* null, i8** %0
br label %9
9: ; preds = %8, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long long strtoll(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
void test5(char *array, char *endptr) {
  array[0] = ' ';
  array[1] = '+';
  array[2] = '-';
  long long r = strtoll(array, NULL, 0);
  assert(r == 0);
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x20,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x2b,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x2d,0x2(%rax)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <strtoll@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
push   %rax
movw   $0x2b20,(%rdi)
movb   $0x2d,0x2(%rdi)
xor    %esi,%esi
xor    %edx,%edx
call   1030 <strtoll@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @test5(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 32, i8* %7
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 43, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 2
store i8 45, i8* %11
%12 = load i8*, i8** %3
%13 = call i64 @strtoll(i8* %12, i32* null, i32 0)
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret void
}

LLVM IR (-O2):
define void @test5(i8* nocapture %0, i8* nocapture readnone %1) {
store i8 32, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 43, i8* %3
%4 = getelementptr inbounds i8, i8* %0, i64 2
store i8 45, i8* %4
%5 = tail call i64 @strtoll(i8* nocapture %0, i32* null, i32 0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *Strdup(char *s) {
  char *new;
  if ((new = (char *)malloc(strlen(s) + 1)) == NULL)
    return NULL;
  strcpy(new, s);
  return new;
}


x86 assembly (clang, -O0):
<Strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    116c <Strdup+0x3c>
movq   $0x0,-0x8(%rbp)
jmp    1181 <Strdup+0x51>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
test   %rax,%rax
je     115a <Strdup+0x2a>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    115c <Strdup+0x2c>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @Strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
store i8* null, i8** %2
br label %17
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %12, %11
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @Strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %1, %7
%10 = phi i8* [ %5, %7 ], [ null, %1 ]
ret i8* %10
}
void pthread_attr_setstackaddr() {}


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

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

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

LLVM IR (-O2):
define void @pthread_attr_setstackaddr() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ screen;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
void *get_XWindowAttributes_screen(void *_p) {
  return (void *)((XWindowAttributes *)_p)->screen;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_XWindowAttributes_screen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_XWindowAttributes_screen(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int divisor(int);
int NextPrime(int n) {
  if (n < 3)
    n = 3;
  if (n % 2 == 0)
    n++;
  while (n > divisor(n))
    n = n + 2;
  return n;
}


x86 assembly (clang, -O0):
<NextPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    112c <NextPrime+0x1c>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1149 <NextPrime+0x39>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114e <NextPrime+0x3e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <divisor@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
jle    1177 <NextPrime+0x67>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    114e <NextPrime+0x3e>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NextPrime>:
push   %rbx
cmp    $0x4,%edi
mov    $0x3,%ecx
cmovge %edi,%ecx
mov    %ecx,%eax
not    %eax
and    $0x1,%eax
add    %ecx,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <divisor@plt>
mov    %eax,%ecx
lea    0x2(%rbx),%eax
cmp    %ecx,%ebx
jg     1130 <NextPrime+0x20>
add    $0xfffffffe,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @NextPrime(i32 %0) {
%2 = icmp sgt i32 %0, 3
%3 = select i1 %2, i32 %0, i32 3
%4 = and i32 %3, 1
%5 = xor i32 %4, 1
%6 = add nuw nsw i32 %5, %3
br label %7
7: ; preds = %7, %1
%8 = phi i32 [ %6, %1 ], [ %11, %7 ]
%9 = tail call i32 @divisor(i32 %8)
%10 = icmp sgt i32 %8, %9
%11 = add nuw nsw i32 %8, 2
br i1 %10, label %7, label %12
12: ; preds = %7
ret i32 %8
}
int find_previous_sibling(int con[500][5], int max, int b) {
  int i = 0;
  for (i = 0; i < max; i++) {
    if (con[i][0] == b)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<find_previous_sibling>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1160 <find_previous_sibling+0x60>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%eax
cmp    -0x18(%rbp),%eax
jne    114d <find_previous_sibling+0x4d>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <find_previous_sibling+0x67>
jmp    1152 <find_previous_sibling+0x52>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111c <find_previous_sibling+0x1c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_previous_sibling>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    1121 <find_previous_sibling+0x21>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi)
je     1122 <find_previous_sibling+0x22>
add    $0x1,%rcx
add    $0x14,%rdi
cmp    %rcx,%rsi
jne    1110 <find_previous_sibling+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @find_previous_sibling([5 x i32]* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca [5 x i32]*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store [5 x i32]* %0, [5 x i32]** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 0, i32* %8
store i32 0, i32* %8
br label %9
9: ; preds = %25, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %28
13: ; preds = %9
%14 = load [5 x i32]*, [5 x i32]** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %14, i64 %16
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %17, i64 0, i64 0
%19 = load i32, i32* %18
%20 = load i32, i32* %7
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %13
%23 = load i32, i32* %8
store i32 %23, i32* %4
br label %29
24: ; preds = %13
br label %25
25: ; preds = %24
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
store i32 %27, i32* %8
br label %9
28: ; preds = %9
store i32 -1, i32* %4
br label %29
29: ; preds = %28, %22
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
define i32 @find_previous_sibling([5 x i32]* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %0, i64 %8, i64 0
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
int my_atoi(const char *p) {
  int r2 = 0;
  char *p1;
  p1 = p;
  while (*p1 != '\0') {
    if (*p1 < '0' || *p1 > '9') {
      break;
    }
    r2 = r2 * 10 + (*p1 - '0');
    p1++;
  }
  return r2;
}


x86 assembly (clang, -O0):
<my_atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1170 <my_atoi+0x70>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1147 <my_atoi+0x47>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    114c <my_atoi+0x4c>
jmp    1170 <my_atoi+0x70>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <my_atoi+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_atoi>:
mov    (%rdi),%cl
lea    -0x3a(%rcx),%edx
xor    %eax,%eax
cmp    $0xf6,%dl
jb     113b <my_atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x3a(%rcx),%edx
add    $0x1,%rdi
cmp    $0xf5,%dl
ja     1120 <my_atoi+0x20>
ret

LLVM IR (-O0):
define i32 @my_atoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
store i8* %5, i8** %4
br label %6
6: ; preds = %22, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %32
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp slt i32 %14, 48
br i1 %15, label %21, label %16
16: ; preds = %11
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp sgt i32 %19, 57
br i1 %20, label %21, label %22
21: ; preds = %16, %11
br label %32
22: ; preds = %16
%23 = load i32, i32* %3
%24 = mul nsw i32 %23, 10
%25 = load i8*, i8** %4
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = sub nsw i32 %27, 48
%29 = add nsw i32 %24, %28
store i32 %29, i32* %3
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %4
br label %6
32: ; preds = %21, %6
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @my_atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -58
%4 = icmp ult i8 %3, -10
br i1 %4, label %17, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i8* [ %13, %5 ], [ %0, %1 ]
%8 = phi i32 [ %12, %5 ], [ 0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul nsw i32 %8, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = add i8 %14, -58
%16 = icmp ult i8 %15, -10
br i1 %16, label %17, label %5
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %18
}
int return_letters_in_string(char hexadec) {
  if (hexadec >= '0' && hexadec <= '9')
    return (hexadec - 48);
  if (hexadec >= 'a' && hexadec <= 'f')
    return (hexadec - 87);
  return 0;
}


x86 assembly (clang, -O0):
<return_letters_in_string>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <return_letters_in_string+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <return_letters_in_string+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <return_letters_in_string+0x63>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     115c <return_letters_in_string+0x5c>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     115c <return_letters_in_string+0x5c>
movsbl -0x5(%rbp),%eax
sub    $0x57,%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <return_letters_in_string+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_letters_in_string>:
mov    %edi,%eax
lea    -0x30(%rax),%ecx
cmp    $0x9,%cl
ja     110e <return_letters_in_string+0xe>
add    $0xffffffd0,%eax
ret
lea    -0x61(%rax),%ecx
add    $0xffffffa9,%eax
xor    %edx,%edx
cmp    $0x6,%cl
cmovb  %eax,%edx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @return_letters_in_string(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, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %28
15: ; preds = %7, %1
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 97
br i1 %18, label %19, label %27
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 102
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 87
store i32 %26, i32* %2
br label %28
27: ; preds = %19, %15
store i32 0, i32* %2
br label %28
28: ; preds = %27, %23, %11
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @return_letters_in_string(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nsw i32 %2, -48
br label %12
7: ; preds = %1
%8 = add i8 %0, -97
%9 = icmp ult i8 %8, 6
%10 = add nsw i32 %2, -87
%11 = select i1 %9, i32 %10, i32 0
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
ret i32 %13
}
void rt2x00crypto_tx_copy_iv(struct sk_buff *skb, struct txentry_desc *txdesc) {
}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.sk_buff = type opaque
%struct.txentry_desc = type opaque
define void @rt2x00crypto_tx_copy_iv(%struct.sk_buff* nocapture %0, %struct.txentry_desc* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putp(char *);
void my_putstring(char *s) { putp(s); }


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

x86 assembly (clang, -O2):
<my_putstring>:
jmp    1030 <putp@plt>

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

LLVM IR (-O2):
define void @my_putstring(i8* %0) {
%2 = tail call i32 @putp(i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
wchar_t *(wmemchr)(const wchar_t *segment, wchar_t c, size_t size) {
  while (size--)
    if (*segment++ == c)
      return segment - 1;
  return NULL;
}


x86 assembly (clang, -O0):
<wmemchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     115b <wmemchr+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    1156 <wmemchr+0x56>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <wmemchr+0x63>
jmp    1110 <wmemchr+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmemchr>:
add    $0xfffffffffffffff8,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
sub    $0x1,%rdx
jb     1124 <wmemchr+0x24>
lea    0x8(%rdi),%rax
cmp    %rsi,0x8(%rdi)
mov    %rax,%rdi
jne    1110 <wmemchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64* @wmemchr(i64* %0, i64 %1, i64 %2) {
br label %4
4: ; preds = %8, %3
%5 = phi i64* [ %0, %3 ], [ %10, %8 ]
%6 = phi i64 [ %2, %3 ], [ %9, %8 ]
%7 = icmp eq i64 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = add i64 %6, -1
%10 = getelementptr inbounds i64, i64* %5, i64 1
%11 = load i64, i64* %5
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %4
13: ; preds = %4, %8
%14 = phi i64* [ %5, %8 ], [ null, %4 ]
ret i64* %14
}
void cprop_result5(int *data) {
  if (data[0])
    data[1] = 10;
  else
    data[2] = 15;
  data[3] = 25;
}


x86 assembly (clang, -O0):
<cprop_result5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
je     1125 <cprop_result5+0x25>
mov    -0x8(%rbp),%rax
movl   $0xa,0x4(%rax)
jmp    1130 <cprop_result5+0x30>
mov    -0x8(%rbp),%rax
movl   $0xf,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x19,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprop_result5>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
sete   %al
lea    (%rax,%rax,4),%ecx
add    $0xa,%ecx
mov    %ecx,0x4(%rdi,%rax,4)
movl   $0x19,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @cprop_result5(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i64 2, i64 1
%5 = select i1 %3, i32 15, i32 10
%6 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 %5, i32* %6
%7 = getelementptr inbounds i32, i32* %0, i64 3
store i32 25, i32* %7
ret void
}
/* Variables and functions */
int fptr_capi20_get_profile(unsigned int, unsigned char *);
scalar_t__ loadlib();
unsigned capi20_get_profile(unsigned Ctrl, unsigned char *Buf) {
  if (loadlib() < 0)
    return 0x1009;
  return fptr_capi20_get_profile(Ctrl, Buf);
}


x86 assembly (clang, -O0):
<capi20_get_profile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <loadlib@plt>
cmp    $0x0,%rax
jge    114c <capi20_get_profile+0x2c>
movl   $0x1009,-0x4(%rbp)
jmp    115b <capi20_get_profile+0x3b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <fptr_capi20_get_profile@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capi20_get_profile>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <loadlib@plt>
test   %rax,%rax
js     1144 <capi20_get_profile+0x24>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fptr_capi20_get_profile@plt>
mov    $0x1009,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @capi20_get_profile(i32 %0, i8* %1) {
%3 = tail call i64 (...) @loadlib()
%4 = icmp slt i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @fptr_capi20_get_profile(i32 %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 4105, %2 ]
ret i32 %8
}
int bio_phys_segments(struct request_queue *x, struct bio *y) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.request_queue = type opaque
%struct.bio = type opaque
define i32 @bio_phys_segments(%struct.request_queue* %0, %struct.bio* %1) {
%3 = alloca %struct.request_queue*
%4 = alloca %struct.bio*
%5 = alloca i32
store %struct.request_queue* %0, %struct.request_queue** %3
store %struct.bio* %1, %struct.bio** %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.request_queue = type opaque
%struct.bio = type opaque
define i32 @bio_phys_segments(%struct.request_queue* nocapture readnone %0, %struct.bio* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
size_t run_nonulls(int *, size_t, int *, size_t);
size_t run(int moves[], size_t moves_len, int res[], size_t res_len) {
  size_t r = run_nonulls(moves, moves_len, res, res_len);
  for (size_t i = r; i < res_len; i++)
    res[i] = 0;
  return r;
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <run_nonulls@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1177 <run+0x67>
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1149 <run+0x39>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %rdx,%r15
call   1040 <run_nonulls@plt>
mov    %rax,%r14
cmp    %rbx,%rax
jae    114d <run+0x2d>
lea    (%r15,%r14,4),%rdi
sub    %r14,%rbx
shl    $0x2,%rbx
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @run(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = tail call i64 @run_nonulls(i32* %0, i64 %1, i32* %2, i64 %3)
%6 = icmp ult i64 %5, %3
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = getelementptr i32, i32* %2, i64 %5
%9 = bitcast i32* %8 to i8*
%10 = sub i64 %3, %5
%11 = shl i64 %10, 2
br label %12
12: ; preds = %7, %4
ret i64 %5
}
void foo(char *str) { str[20] = 'a'; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movb   $0x61,0x14(%rdi)
ret

LLVM IR (-O0):
define void @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 20
store i8 97, i8* %4
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 20
store i8 97, i8* %2
ret void
}
void setBitR(int *A, int k) { *A |= (1 << k); }


x86 assembly (clang, -O0):
<setBitR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBitR>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,(%rdi)
ret

LLVM IR (-O0):
define void @setBitR(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = or i32 %8, %6
store i32 %9, i32* %7
ret void
}

LLVM IR (-O2):
define void @setBitR(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load i32, i32* %0
%5 = or i32 %4, %3
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ simple_rand();
double simple_rand_x() { return (((double)simple_rand()) / ((double)32767)); }


x86 assembly (clang, -O0):
<simple_rand_x>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <simple_rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_rand_x>:
push   %rax
xor    %eax,%eax
call   1030 <simple_rand@plt>
cvtsi2sd %rax,%xmm0
divsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @simple_rand_x() {
%1 = call i64 (...) @simple_rand()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 3.276700e+04
ret double %3
}

LLVM IR (-O2):
define double @simple_rand_x() {
%1 = tail call i64 (...) @simple_rand()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 3.276700e+04
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ syscall1(int);
void sync() { syscall1(36); }


x86 assembly (clang, -O0):
<sync>:
push   %rbp
mov    %rsp,%rbp
mov    $0x24,%edi
call   1030 <syscall1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync>:
mov    $0x24,%edi
jmp    1030 <syscall1@plt>

LLVM IR (-O0):
define void @sync() {
%1 = call i32 @syscall1(i32 36)
ret void
}

LLVM IR (-O2):
define void @sync() {
%1 = tail call i32 @syscall1(i32 36)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ct_display_block_new();
int ct_game_init() {
  ct_display_block_new();
  return 0;
}


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

x86 assembly (clang, -O2):
<ct_game_init>:
push   %rax
xor    %eax,%eax
call   1030 <ct_display_block_new@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ct_game_init() {
%1 = call i32 (...) @ct_display_block_new()
ret i32 0
}

LLVM IR (-O2):
define i32 @ct_game_init() {
%1 = tail call i32 (...) @ct_display_block_new()
ret i32 0
}
int test_imm_E3uint16_reg(unsigned short val) {
  return ((val) & (-0xE3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E3uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff1d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_E3uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -227
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int string_length(char *string) {
  int size_string = 0;
  while (string[size_string] != '\n') {
    size_string++;
  }
  return size_string;
}


x86 assembly (clang, -O0):
<string_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     1132 <string_length+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <string_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0xa,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <string_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @string_length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void testClosureFIFrV(void (*closure)(float, int, float), float a1, int a2,
                      float a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureFIFrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
mov    -0x10(%rbp),%edi
movss  -0x14(%rbp),%xmm1
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureFIFrV>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureFIFrV(void (float, i32, float)* %0, float %1, i32 %2, float %3) {
%5 = alloca void (float, i32, float)*
%6 = alloca float
%7 = alloca i32
%8 = alloca float
store void (float, i32, float)* %0, void (float, i32, float)** %5
store float %1, float* %6
store i32 %2, i32* %7
store float %3, float* %8
%9 = load void (float, i32, float)*, void (float, i32, float)** %5
%10 = load float, float* %6
%11 = load i32, i32* %7
%12 = load float, float* %8
ret void
}

LLVM IR (-O2):
define void @testClosureFIFrV(void (float, i32, float)* nocapture %0, float %1, i32 %2, float %3) {
tail call void %0(float %1, i32 %2, float %3)
ret void
}