xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int clz(scalar_t__);
int log2i(uint64_t x) { return 64 - clz(x - 1); }


x86 assembly (clang, -O0):
<log2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <clz@plt>
mov    %eax,%ecx
mov    $0x40,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2i>:
push   %rax
add    $0xffffffffffffffff,%rdi
call   1030 <clz@plt>
mov    $0x40,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @log2i(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, 1
%5 = call i32 @clz(i64 %4)
%6 = sub nsw i32 64, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @log2i(i64 %0) {
%2 = add nsw i64 %0, -1
%3 = tail call i32 @clz(i64 %2)
%4 = sub nsw i32 64, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print_hex(int);
void main(void) {
  int i;
  i = 0;
  while (i < 6) {
    if (i > 2) {
      print_hex(i);
    } else {
      print_hex(1);
    }
    i = i + 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x6,-0x4(%rbp)
jge    1158 <main+0x48>
cmpl   $0x2,-0x4(%rbp)
jle    1140 <main+0x30>
mov    -0x4(%rbp),%edi
call   1030 <print_hex@plt>
jmp    114a <main+0x3a>
mov    $0x1,%edi
call   1030 <print_hex@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <print_hex@plt>
mov    $0x1,%edi
call   1030 <print_hex@plt>
mov    $0x1,%edi
call   1030 <print_hex@plt>
mov    $0x3,%edi
call   1030 <print_hex@plt>
mov    $0x4,%edi
call   1030 <print_hex@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <print_hex@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @print_hex(i32 1)
%2 = tail call i32 @print_hex(i32 1)
%3 = tail call i32 @print_hex(i32 1)
%4 = tail call i32 @print_hex(i32 3)
%5 = tail call i32 @print_hex(i32 4)
%6 = tail call i32 @print_hex(i32 5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int mkfifo(const char *pathname, mode_t mode) {
  assert(!"NYI");
  return -1;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"NYI\00"
define i32 @mkfifo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @assert(i32 0)
ret i32 -1
}

LLVM IR (-O2):
define i32 @mkfifo(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ s7_power();
void S9xResetSPC7110(void) { s7_power(); }


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

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

LLVM IR (-O0):
define void @S9xResetSPC7110() {
%1 = call i32 (...) @s7_power()
ret void
}

LLVM IR (-O2):
define void @S9xResetSPC7110() {
%1 = tail call i32 (...) @s7_power()
ret void
}
/* Variables and functions */
int strlen(char *);
void stripNewLine(char *s) {
  int l = strlen(s) - 1;
  if (0 <= l && s[l] == '\n')
    s[l] = '\0';
  return;
}


x86 assembly (clang, -O0):
<stripNewLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jg     1157 <stripNewLine+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1157 <stripNewLine+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripNewLine>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    112a <stripNewLine+0x1a>
add    $0xffffffff,%eax
cmpb   $0xa,(%rbx,%rax,1)
jne    112a <stripNewLine+0x1a>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @stripNewLine(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %4
store i8 0, i8* %7
br label %11
11: ; preds = %10, %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ banner();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void usage() {
  banner();
  puts("Usage: fannc COMMAND ARGS...");
  puts("To see a list of all commands, type: fannc help");
  puts("To see the help of a particular command, type: fannc COMMAND --help");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <banner@plt>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
xor    %eax,%eax
call   1040 <banner@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Usage: fannc COMMAND ARGS...\00"
@.str.1 = [48 x i8] c"To see a list of all commands, type: fannc help\00"
@.str.2 = [68 x i8] c"To see the help of a particular command, type: fannc COMMAND --help\00"
define void @usage() {
%1 = call i32 (...) @banner()
%2 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"Usage: fannc COMMAND ARGS...\00"
@.str.1 = [48 x i8] c"To see a list of all commands, type: fannc help\00"
@.str.2 = [68 x i8] c"To see the help of a particular command, type: fannc COMMAND --help\00"
define void @usage() {
%1 = tail call i32 (...) @banner()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void signal_handle_parent(int sig) {
  (void)sig;
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<signal_handle_parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<signal_handle_parent>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @signal_handle_parent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @signal_handle_parent(i32 %0) {
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
void av_mallocz() {}


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

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

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

LLVM IR (-O2):
define void @av_mallocz() {
ret void
}
/* Variables and functions */
int f222(int *);
int f223(int *p) { return f222(p); }


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

x86 assembly (clang, -O2):
<f223>:
jmp    1030 <f222@plt>

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

LLVM IR (-O2):
define i32 @f223(i32* %0) {
%2 = tail call i32 @f222(i32* %0)
ret i32 %2
}
char *f12(char smth[10]) { return &smth; }


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

x86 assembly (clang, -O2):
<f12>:
lea    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i8* @f12(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = bitcast i8** %2 to i8*
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @f12(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *run(void *data) { printf("%d!\n", (int)data); }


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

x86 assembly (clang, -O2):
<run>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%d!\0A\00"
define i8* @run(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = ptrtoint i8* %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d!\0A\00"
define noalias i8* @run(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* undef
}
/* Variables and functions */
int foo(int *);
int boo(int *a) { return foo(a); }


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

x86 assembly (clang, -O2):
<boo>:
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @boo(i32* %0) {
%2 = tail call i32 @foo(i32* %0)
ret i32 %2
}
int iora_buffer_type(int filno, int record_num) { return (0); }


x86 assembly (clang, -O0):
<iora_buffer_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @iora_buffer_type(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
void dStrRaw(const char *str, int len) {
  int k;
  for (k = 0; k < len; ++k)
    printf("%c", str[k]);
}


x86 assembly (clang, -O0):
<dStrRaw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <dStrRaw+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
lea    0xebf(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <dStrRaw+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dStrRaw>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <dStrRaw+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <dStrRaw+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @dStrRaw(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_expression(char *);
int main() {
  char A[2 + 2 + 4 + 1];
  A[2 + 2 + 4] = 0;
  parse_expression(A);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movb   $0x0,0x17(%rsp)
lea    0xf(%rsp),%rdi
call   1030 <parse_expression@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 8
store i8 0, i8* %3
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = call i32 @parse_expression(i8* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 8
store i8 0, i8* %3
%4 = call i32 @parse_expression(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ callee4();
callee3(char *strarg) { callee4(); }


x86 assembly (clang, -O0):
<callee3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <callee4@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @callee3(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @callee4()
ret i32 undef
}
/* Variables and functions */
scalar_t__ uf_find(int);
int uf_connected(int p, int q) { return uf_find(p) == uf_find(q); }


x86 assembly (clang, -O0):
<uf_connected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <uf_find@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <uf_find@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uf_connected>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <uf_find@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <uf_find@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @uf_connected(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i64 @uf_find(i32 %5)
%7 = load i32, i32* %4
%8 = call i64 @uf_find(i32 %7)
%9 = icmp eq i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @uf_connected(i32 %0, i32 %1) {
%3 = tail call i64 @uf_find(i32 %0)
%4 = tail call i64 @uf_find(i32 %1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int is_underscore(char c) { return c == 95; }


x86 assembly (clang, -O0):
<is_underscore>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_underscore>:
xor    %eax,%eax
cmp    $0x5f,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_underscore(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 95
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_underscore(i8 signext %0) {
%2 = icmp eq i8 %0, 95
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int atoi(char *);
char *getenv(char *);
int check_env(char *name) {
  char *val = getenv(name);
  if (val && atoi(val) == 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<check_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1162 <check_env+0x42>
mov    -0x18(%rbp),%rdi
call   1040 <atoi@plt>
cmp    $0x1,%eax
jne    1162 <check_env+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1169 <check_env+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_env>:
push   %rax
call   1030 <getenv@plt>
test   %rax,%rax
je     113f <check_env+0x1f>
mov    %rax,%rdi
call   1040 <atoi@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
je     1141 <check_env+0x21>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @check_env(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @atoi(i8* %2)
%6 = icmp eq i32 %5, 1
br i1 %6, label %8, label %7
7: ; preds = %4, %1
br label %8
8: ; preds = %4, %7
%9 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %9
}
unsigned char GetConstAddrSize(long Val) {
  if ((Val & ~0xFFL) == 0) {
    return 0x01;
  } else if ((Val & ~0xFFFFL) == 0) {
    return 0x02;
  } else if ((Val & ~0xFFFFFFL) == 0) {
    return 0x03;
  } else {
    return 0x04;
  }
}


x86 assembly (clang, -O0):
<GetConstAddrSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xffffffffffffff00,%rax
cmp    $0x0,%rax
jne    1125 <GetConstAddrSize+0x25>
movb   $0x1,-0x1(%rbp)
jmp    1163 <GetConstAddrSize+0x63>
mov    -0x10(%rbp),%rax
and    $0xffffffffffff0000,%rax
cmp    $0x0,%rax
jne    1142 <GetConstAddrSize+0x42>
movb   $0x2,-0x1(%rbp)
jmp    1163 <GetConstAddrSize+0x63>
mov    -0x10(%rbp),%rax
and    $0xffffffffff000000,%rax
cmp    $0x0,%rax
jne    115f <GetConstAddrSize+0x5f>
movb   $0x3,-0x1(%rbp)
jmp    1163 <GetConstAddrSize+0x63>
movb   $0x4,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetConstAddrSize>:
mov    $0x1,%al
cmp    $0x100,%rdi
jb     1121 <GetConstAddrSize+0x21>
mov    $0x2,%al
cmp    $0x10000,%rdi
jb     1121 <GetConstAddrSize+0x21>
cmp    $0x1000000,%rdi
mov    $0x4,%al
sbb    $0x0,%al
ret

LLVM IR (-O0):
define zeroext i8 @GetConstAddrSize(i64 %0) {
%2 = alloca i8
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = and i64 %4, -256
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 1, i8* %2
br label %19
8: ; preds = %1
%9 = load i64, i64* %3
%10 = and i64 %9, -65536
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 2, i8* %2
br label %19
13: ; preds = %8
%14 = load i64, i64* %3
%15 = and i64 %14, -16777216
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 3, i8* %2
br label %19
18: ; preds = %13
store i8 4, i8* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define zeroext i8 @GetConstAddrSize(i64 %0) {
%2 = icmp ult i64 %0, 256
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i64 %0, 65536
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ult i64 %0, 16777216
%7 = select i1 %6, i8 3, i8 4
br label %8
8: ; preds = %5, %3, %1
%9 = phi i8 [ 1, %1 ], [ 2, %3 ], [ %7, %5 ]
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ _mergesort(int *, int *, int, int);
int *malloc(int);
void mergesort(int *l, int left, int right) {
  int *tmp = malloc((right - left + 1) * sizeof(int));
  _mergesort(l, tmp, left, right);
}


x86 assembly (clang, -O0):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <_mergesort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %edx,%eax
sub    %esi,%eax
lea    0x4(,%rax,4),%edi
call   1030 <malloc@plt>
mov    %r14,%rdi
mov    %rax,%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <_mergesort@plt>

LLVM IR (-O0):
define void @mergesort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 4
%14 = trunc i64 %13 to i32
%15 = call i32* @malloc(i32 %14)
store i32* %15, i32** %7
%16 = load i32*, i32** %4
%17 = load i32*, i32** %7
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = call i32 @_mergesort(i32* %16, i32* %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
define void @mergesort(i32* %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = shl i32 %4, 2
%6 = add i32 %5, 4
%7 = tail call i32* @malloc(i32 %6)
%8 = tail call i32 @_mergesort(i32* %0, i32* %7, i32 %1, i32 %2)
ret void
}
int do_002() { return 2; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @do_002() {
ret i32 2
}

LLVM IR (-O2):
define i32 @do_002() {
ret i32 2
}
/* Type definitions */
typedef long clock_t;

/* Variables and functions */
int CLOCKS_PER_SEC;
long clock();
void delay(int milliseconds) {
  long pause;
  clock_t now, then;
  pause = milliseconds * (CLOCKS_PER_SEC / 1000);
  now = clock();
  then = clock();
  while ((now - then) < pause) {
    now = clock();
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
imul   %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1178 <delay+0x68>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x18(%rbp)
jmp    1156 <delay+0x46>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %r15
push   %r14
push   %rbx
mov    0x2ecc(%rip),%rax
movslq (%rax),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   %edi,%eax
movslq %eax,%r15
xor    %eax,%eax
call   1030 <clock@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rax,%r14
cmp    %r15,%r14
jge    116f <delay+0x5f>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
cmp    %r15,%rax
jl     1160 <delay+0x50>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* @CLOCKS_PER_SEC
%8 = sdiv i32 %7, 1000
%9 = mul nsw i32 %6, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %3
%11 = call i64 (...) @clock()
store i64 %11, i64* %4
%12 = call i64 (...) @clock()
store i64 %12, i64* %5
br label %13
13: ; preds = %19, %1
%14 = load i64, i64* %4
%15 = load i64, i64* %5
%16 = sub nsw i64 %14, %15
%17 = load i64, i64* %3
%18 = icmp slt i64 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i64 (...) @clock()
store i64 %20, i64* %4
br label %13
21: ; preds = %13
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define void @delay(i32 %0) {
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = sdiv i32 %2, 1000
%4 = mul nsw i32 %3, %0
%5 = sext i32 %4 to i64
%6 = tail call i64 (...) @clock()
%7 = tail call i64 (...) @clock()
%8 = sub nsw i64 %6, %7
%9 = icmp slt i64 %8, %5
br i1 %9, label %10, label %14
10: ; preds = %1, %10
%11 = tail call i64 (...) @clock()
%12 = sub nsw i64 %11, %7
%13 = icmp slt i64 %12, %5
br i1 %13, label %10, label %14
14: ; preds = %10, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ packi16(unsigned char *, unsigned int);
extern void serialize_int16(unsigned char *buf, unsigned int i) {
  packi16(buf, i);
}


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

x86 assembly (clang, -O2):
<serialize_int16>:
jmp    1030 <packi16@plt>

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

LLVM IR (-O2):
define void @serialize_int16(i8* %0, i32 %1) {
%3 = tail call i32 @packi16(i8* %0, i32 %1)
ret void
}
int test_imm_7Aint8_reg(signed char val) {
  return ((val) & (-0x7A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Aint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff86,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_7Aint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -122
%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_7Aint8_reg(i8 signext %0) {
%2 = and i8 %0, -122
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ UNLYOKOSync();
void UNLYOKOStateRestore(int version) { UNLYOKOSync(); }


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

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

LLVM IR (-O0):
define void @UNLYOKOStateRestore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @UNLYOKOSync()
ret void
}

LLVM IR (-O2):
define void @UNLYOKOStateRestore(i32 %0) {
%2 = tail call i32 (...) @UNLYOKOSync()
ret void
}
/* Variables and functions */
char *ERR_error_string(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ ERR_get_error();
char *ssl_strerr(void) { return ERR_error_string(ERR_get_error(), 0); }


x86 assembly (clang, -O0):
<ssl_strerr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ERR_get_error@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <ERR_error_string@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_strerr>:
push   %rax
xor    %eax,%eax
call   1040 <ERR_get_error@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <ERR_error_string@plt>

LLVM IR (-O0):
define i8* @ssl_strerr() {
%1 = call i32 (...) @ERR_get_error()
%2 = call i8* @ERR_error_string(i32 %1, i32 0)
ret i8* %2
}

LLVM IR (-O2):
define i8* @ssl_strerr() {
%1 = tail call i32 (...) @ERR_get_error()
%2 = tail call i8* @ERR_error_string(i32 %1, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x57() {
  Assert_real((islower(87) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              440, ("islower should be 0 for W"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x57>:
push   %rax
mov    $0x57,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1b8,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for W\00"
define void @t_islower_0x57() {
%1 = call i64 @islower(i32 87)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 440, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for W\00"
define void @t_islower_0x57() {
%1 = tail call i64 @islower(i32 87)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 440, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_tree_drag_source_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_drag_source_get_type() {
ret void
}
void X509_ATTRIBUTE_create_by_txt(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_ATTRIBUTE_create_by_txt() {
ret void
}
/* Variables and functions */
int isspace(unsigned char);
int nat_isspace(char a) { return isspace((unsigned char)a); }


x86 assembly (clang, -O0):
<nat_isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <isspace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nat_isspace>:
movzbl %dil,%edi
jmp    1030 <isspace@plt>

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

LLVM IR (-O2):
define i32 @nat_isspace(i8 signext %0) {
%2 = tail call i32 @isspace(i8 zeroext %0)
ret i32 %2
}
int equals(void *elem1, void *elem2) {
  return *((int *)elem1) == *((int *)elem2);
}


x86 assembly (clang, -O0):
<equals>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equals>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @equals(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ NameToObj(char *, int);
int /*<<< orphan*/ TestGenAttr1(int /*<<< orphan*/);
void TestGenAttr() {
  TestGenAttr1(NameToObj(("intelligent"), 1));
  TestGenAttr1(NameToObj(("rich"), 1));
  TestGenAttr1(NameToObj(("good"), 1));
}


x86 assembly (clang, -O0):
<TestGenAttr>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x1,%esi
call   1030 <NameToObj@plt>
mov    %eax,%edi
call   1040 <TestGenAttr1@plt>
lea    0xec9(%rip),%rdi
mov    $0x1,%esi
call   1030 <NameToObj@plt>
mov    %eax,%edi
call   1040 <TestGenAttr1@plt>
lea    0xeb6(%rip),%rdi
mov    $0x1,%esi
call   1030 <NameToObj@plt>
mov    %eax,%edi
call   1040 <TestGenAttr1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestGenAttr>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
call   1030 <NameToObj@plt>
mov    %eax,%edi
call   1040 <TestGenAttr1@plt>
lea    0xecc(%rip),%rdi
mov    $0x1,%esi
call   1030 <NameToObj@plt>
mov    %eax,%edi
call   1040 <TestGenAttr1@plt>
lea    0xeb9(%rip),%rdi
mov    $0x1,%esi
call   1030 <NameToObj@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <TestGenAttr1@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"intelligent\00"
@.str.1 = [5 x i8] c"rich\00"
@.str.2 = [5 x i8] c"good\00"
define void @TestGenAttr() {
%1 = call i32 @NameToObj(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = call i32 @TestGenAttr1(i32 %1)
%3 = call i32 @NameToObj(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = call i32 @TestGenAttr1(i32 %3)
%5 = call i32 @NameToObj(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 1)
%6 = call i32 @TestGenAttr1(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"intelligent\00"
@.str.1 = [5 x i8] c"rich\00"
@.str.2 = [5 x i8] c"good\00"
define void @TestGenAttr() {
%1 = tail call i32 @NameToObj(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @TestGenAttr1(i32 %1)
%3 = tail call i32 @NameToObj(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = tail call i32 @TestGenAttr1(i32 %3)
%5 = tail call i32 @NameToObj(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 1)
%6 = tail call i32 @TestGenAttr1(i32 %5)
ret void
}
unsigned int compare_and_swap32(volatile unsigned int *address,
                                unsigned int old_value,
                                unsigned int new_value) {
  unsigned long prev = 0;
  asm volatile("lock ; "
               "cmpxchgl %k1,%2"
               : "=a"(prev)
               : "r"(new_value), "m"(*address), "0"(old_value)
               : "memory");
  return prev == old_value;
}


x86 assembly (clang, -O0):
<compare_and_swap32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%eax
lock cmpxchg %ecx,(%rdx)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_and_swap32>:
mov    %esi,%ecx
mov    %rcx,%rax
lock cmpxchg %edx,(%rdi)
xor    %edx,%edx
cmp    %rcx,%rax
sete   %dl
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @compare_and_swap32(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i64 0, i64* %7
%8 = load i32, i32* %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = zext i32 %10 to i64
%12 = call i64 asm sideeffect "lock ; cmpxchgl ${1:k},$2", "={ax},r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %8, i32* elementtype(i32) %9, i64 %11)
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = icmp eq i64 %13, %15
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @compare_and_swap32(i32* %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = tail call i64 asm sideeffect "lock ; cmpxchgl ${1:k},$2", "={ax},r,*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %2, i32* elementtype(i32) %0, i64 %4)
%6 = icmp eq i64 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void my_pause() {
  getchar();
  printf("\nPress any key to continue...\n");
  getchar();
}


x86 assembly (clang, -O0):
<my_pause>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pause>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"\0APress any key to continue...\0A\00"
define void @my_pause() {
%1 = call i32 (...) @getchar()
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"\0APress any key to continue...\00"
define void @my_pause() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rdb_clean(int);
void rdb_gc() { rdb_clean(1); }


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

x86 assembly (clang, -O2):
<rdb_gc>:
mov    $0x1,%edi
jmp    1030 <rdb_clean@plt>

LLVM IR (-O0):
define void @rdb_gc() {
%1 = call i32 @rdb_clean(i32 1)
ret void
}

LLVM IR (-O2):
define void @rdb_gc() {
%1 = tail call i32 @rdb_clean(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int /*<<< orphan*/, int /*<<< orphan*/);
void C67_STB_SP_A0(int r) { C67_asm("STB.D *+SP[A0]", r, 0, 0); }


x86 assembly (clang, -O0):
<C67_STB_SP_A0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_STB_SP_A0>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"STB.D *+SP[A0]\00"
define void @C67_STB_SP_A0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @C67_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"STB.D *+SP[A0]\00"
define void @C67_STB_SP_A0(i32 %0) {
%2 = tail call i32 @C67_asm(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  struct date {
    int month;
    int day;
    int year;
  };
  struct date today;
  today.month = 9;
  today.day = 25;
  today.year = 2015;
  printf("Today's date is %i/%i/%.2i.\n", today.month, today.day,
         today.year % 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x10(%rbp)
movl   $0x19,-0xc(%rbp)
movl   $0x7df,-0x8(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x14(%rbp),%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x9,%esi
mov    $0x19,%edx
mov    $0xf,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.date = type { i32, i32, i32 }
@.str = [29 x i8] c"Today's date is %i/%i/%.2i.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.date
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 0
store i32 9, i32* %3
%4 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 1
store i32 25, i32* %4
%5 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 2
store i32 2015, i32* %5
%6 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 2
%11 = load i32, i32* %10
%12 = srem i32 %11, 100
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Today's date is %i/%i/%.2i.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 9, i32 25, i32 15)
ret i32 0
}
long spiral_total(int spiral_len) {
  long total = 0;
  for (int i = 1; i < spiral_len + 1; i += 2)
    total += (i * i);
  return total;
}


x86 assembly (clang, -O0):
<spiral_total>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1146 <spiral_total+0x46>
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    1116 <spiral_total+0x16>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<spiral_total>:
test   %edi,%edi
jle    1122 <spiral_total+0x22>
mov    %edi,%ecx
mov    $0x1,%edx
xor    %eax,%eax
nopl   (%rax)
mov    %edx,%esi
imul   %esi,%esi
add    %rsi,%rax
add    $0x2,%rdx
cmp    %rcx,%rdx
jbe    1110 <spiral_total+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @spiral_total(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = zext i32 %0 to i64
br label %7
5: ; preds = %7, %1
%6 = phi i64 [ 0, %1 ], [ %12, %7 ]
ret i64 %6
7: ; preds = %3, %7
%8 = phi i64 [ 1, %3 ], [ %13, %7 ]
%9 = phi i64 [ 0, %3 ], [ %12, %7 ]
%10 = mul i64 %8, %8
%11 = and i64 %10, 4294967295
%12 = add nuw nsw i64 %9, %11
%13 = add nuw nsw i64 %8, 2
%14 = icmp ugt i64 %13, %4
br i1 %14, label %5, label %7
}
void g_value_set_pointer() {}


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

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

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

LLVM IR (-O2):
define void @g_value_set_pointer() {
ret void
}
void gtk_target_list_add_image_targets() {}


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

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

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

LLVM IR (-O2):
define void @gtk_target_list_add_image_targets() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void test23_free(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<test23_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @test23_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}