xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ piece(char *, char, char *, int);
void parse_input_buffer(char *measurement_date, char *measurement_value,
                        char *input_buffer) {
  piece(measurement_date, '^', input_buffer, 0);
  piece(measurement_value, '^', input_buffer, 2);
}


x86 assembly (clang, -O0):
<parse_input_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x5e,%esi
xor    %ecx,%ecx
call   1030 <piece@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x5e,%esi
mov    $0x2,%ecx
call   1030 <piece@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_input_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    $0x5e,%esi
xor    %ecx,%ecx
call   1030 <piece@plt>
mov    %r14,%rdi
mov    $0x5e,%esi
mov    %rbx,%rdx
mov    $0x2,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <piece@plt>

LLVM IR (-O0):
define void @parse_input_buffer(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %6
%9 = call i32 @piece(i8* %7, i8 signext 94, i8* %8, i32 0)
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @piece(i8* %10, i8 signext 94, i8* %11, i32 2)
ret void
}

LLVM IR (-O2):
define void @parse_input_buffer(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @piece(i8* %0, i8 signext 94, i8* %2, i32 0)
%5 = tail call i32 @piece(i8* %1, i8 signext 94, i8* %2, i32 2)
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
main() { printf("EOF is: %d\n", EOF); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"EOF is: %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"EOF is: %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add(struct list *, int);
struct list *create_list();
int /*<<< orphan*/ dispose(struct list *);
int main() {
  struct list *l = create_list();
  add(l, 1);
  add(l, 2);
  add(l, 2);
  add(l, 4);
  dispose(l);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <create_list@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1040 <add@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1040 <add@plt>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1040 <add@plt>
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1040 <add@plt>
mov    -0x10(%rbp),%rdi
call   1030 <dispose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <create_list@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
call   1040 <add@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <add@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <add@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <add@plt>
mov    %rbx,%rdi
call   1030 <dispose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.list*
store i32 0, i32* %1
%3 = call %struct.list* (...) @create_list()
store %struct.list* %3, %struct.list** %2
%4 = load %struct.list*, %struct.list** %2
%5 = call i32 @add(%struct.list* %4, i32 1)
%6 = load %struct.list*, %struct.list** %2
%7 = call i32 @add(%struct.list* %6, i32 2)
%8 = load %struct.list*, %struct.list** %2
%9 = call i32 @add(%struct.list* %8, i32 2)
%10 = load %struct.list*, %struct.list** %2
%11 = call i32 @add(%struct.list* %10, i32 4)
%12 = load %struct.list*, %struct.list** %2
%13 = call i32 @dispose(%struct.list* %12)
ret i32 0
}

LLVM IR (-O2):
%struct.list = type { i32 }
define i32 @main() {
%1 = tail call %struct.list* (...) @create_list()
%2 = tail call i32 @add(%struct.list* %1, i32 1)
%3 = tail call i32 @add(%struct.list* %1, i32 2)
%4 = tail call i32 @add(%struct.list* %1, i32 2)
%5 = tail call i32 @add(%struct.list* %1, i32 4)
%6 = tail call i32 @dispose(%struct.list* %1)
ret i32 0
}
/* Variables and functions */
int get4BE(unsigned char const *);
int computeObjectArrayDumpLen(const unsigned char *origBuf, int len) {
  int arrayCount = get4BE(origBuf + 4 + 4);
  return 4 * 2 + 8 + arrayCount * 4;
}


x86 assembly (clang, -O0):
<computeObjectArrayDumpLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
add    $0x4,%rdi
call   1030 <get4BE@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
add    $0x10,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeObjectArrayDumpLen>:
push   %rax
add    $0x8,%rdi
call   1030 <get4BE@plt>
lea    0x10(,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @computeObjectArrayDumpLen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 4
%8 = getelementptr inbounds i8, i8* %7, i64 4
%9 = call i32 @get4BE(i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = mul nsw i32 %10, 4
%12 = add nsw i32 16, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @computeObjectArrayDumpLen(i8* %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 8
%4 = tail call i32 @get4BE(i8* %3)
%5 = shl nsw i32 %4, 2
%6 = add nsw i32 %5, 16
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ array_func();
int factorial_func(int value) {
  if (value > 1) {
    value *= factorial_func(value - 1);
  }
  array_func();
  return (value);
}


x86 assembly (clang, -O0):
<factorial_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1147 <factorial_func+0x27>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial_func@plt>
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <array_func@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial_func>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
jl     1135 <factorial_func+0x15>
lea    -0x1(%rbx),%edi
call   1030 <factorial_func@plt>
imul   %ebx,%eax
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <array_func@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @factorial_func(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = call i32 @factorial_func(i32 %7)
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, %8
store i32 %10, i32* %2
br label %11
11: ; preds = %5, %1
%12 = call i32 (...) @array_func()
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @factorial_func(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @factorial_func(i32 %4)
%6 = mul nsw i32 %5, %0
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ %6, %3 ], [ %0, %1 ]
%9 = tail call i32 (...) @array_func()
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ execve(char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fork();
int /*<<< orphan*/ open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void main() {
  if (!fork()) {
    execve("/bin/login", NULL, NULL);
    open("/dev/tty/0", 0);
    write(0, "login not found\n", 17);
    _exit(0);
  }
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <fork@plt>
cmp    $0x0,%eax
jne    119f <main+0x4f>
lea    0xe95(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1050 <execve@plt>
lea    0xe8d(%rip),%rdi
xor    %esi,%esi
call   1060 <open@plt>
xor    %edi,%edi
lea    0xe88(%rip),%rsi
mov    $0x11,%edx
call   1040 <write@plt>
xor    %edi,%edi
call   1030 <_exit@plt>
jmp    11a4 <main+0x54>
jmp    11a4 <main+0x54>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <fork@plt>
test   %eax,%eax
je     1162 <main+0x12>
nopl   0x0(%rax)
jmp    1160 <main+0x10>
lea    0xe97(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <execve@plt>
lea    0xe92(%rip),%rdi
xor    %esi,%esi
call   1060 <open@plt>
lea    0xe8f(%rip),%rsi
xor    %edi,%edi
mov    $0x11,%edx
call   1040 <write@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"/bin/login\00"
@.str.1 = [11 x i8] c"/dev/tty/0\00"
@.str.2 = [17 x i8] c"login not found\0A\00"
define void @main() {
%1 = call i32 (...) @fork()
%2 = icmp ne i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = call i32 @execve(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* null, i32* null)
%5 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 0)
%6 = call i32 @write(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 17)
%7 = call i32 @_exit(i32 0)
unreachable
8: ; preds = %0
br label %9
9: ; preds = %9, %8
br label %9
}

LLVM IR (-O2):
@.str = [11 x i8] c"/bin/login\00"
@.str.1 = [11 x i8] c"/dev/tty/0\00"
@.str.2 = [17 x i8] c"login not found\0A\00"
define void @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i32 @execve(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* null, i32* null)
%5 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 0)
%6 = tail call i32 @write(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 17)
%7 = tail call i32 @_exit(i32 0)
unreachable
8: ; preds = %0, %8
br label %8
}
/* Variables and functions */
scalar_t__ fdopen(int, char const *);
void *os_AttachFILE(int handle, char const *mode) {
  return (void *)fdopen(handle, mode);
}


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

x86 assembly (clang, -O2):
<os_AttachFILE>:
jmp    1030 <fdopen@plt>

LLVM IR (-O0):
define i8* @os_AttachFILE(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i64 @fdopen(i32 %5, i8* %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @os_AttachFILE(i32 %0, i8* %1) {
%3 = tail call i64 @fdopen(i32 %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int xcorr_range(double *, int, double *, int, double *, int, int, int);
int xcorr(double *output, int len_output, double *rev, int len_rev,
          double *local, int len_local) {
  return xcorr_range(output, len_output, rev, len_rev, local, len_local, -65534,
                     65533);
}


x86 assembly (clang, -O0):
<xcorr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
movl   $0xffff0002,(%rsp)
movl   $0xfffd,0x8(%rsp)
call   1030 <xcorr_range@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcorr>:
push   %rax
push   $0xfffd
push   $0xffffffffffff0002
call   1030 <xcorr_range@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @xcorr(double* %0, i32 %1, double* %2, i32 %3, double* %4, i32 %5) {
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
%11 = alloca double*
%12 = alloca i32
store double* %0, double** %7
store i32 %1, i32* %8
store double* %2, double** %9
store i32 %3, i32* %10
store double* %4, double** %11
store i32 %5, i32* %12
%13 = load double*, double** %7
%14 = load i32, i32* %8
%15 = load double*, double** %9
%16 = load i32, i32* %10
%17 = load double*, double** %11
%18 = load i32, i32* %12
%19 = call i32 @xcorr_range(double* %13, i32 %14, double* %15, i32 %16, double* %17, i32 %18, i32 -65534, i32 65533)
ret i32 %19
}

LLVM IR (-O2):
define i32 @xcorr(double* %0, i32 %1, double* %2, i32 %3, double* %4, i32 %5) {
%7 = tail call i32 @xcorr_range(double* %0, i32 %1, double* %2, i32 %3, double* %4, i32 %5, i32 -65534, i32 65533)
ret i32 %7
}
/* Variables and functions */
int get_end_ip_header(int);
int get_size_payload(int);
int get_end_payload(int port) {
  return get_end_ip_header(port) + get_size_payload(port);
}


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

x86 assembly (clang, -O2):
<get_end_payload>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <get_end_ip_header@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <get_size_payload@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_end_payload(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @get_end_ip_header(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @get_size_payload(i32 %5)
%7 = add nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_end_payload(i32 %0) {
%2 = tail call i32 @get_end_ip_header(i32 %0)
%3 = tail call i32 @get_size_payload(i32 %0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pid_listen();
int main() { pid_listen(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pid_listen()
ret i32 0
}
char *const ct_file_basename(char *const filename) {
  int i = 0;
  int last_slash_index = 0;
  char c = filename[0];
  while (c != '\0') {
    if (c == '/') {
      last_slash_index = i;
    }
    i++;
    c = filename[i];
  }
  return filename + (last_slash_index + 1);
}


x86 assembly (clang, -O0):
<ct_file_basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x0,%eax
je     115b <ct_file_basename+0x5b>
movsbl -0x11(%rbp),%eax
cmp    $0x2f,%eax
jne    113f <ct_file_basename+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
jmp    111f <ct_file_basename+0x1f>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct_file_basename>:
xor    %eax,%eax
xor    %ecx,%ecx
jmp    1116 <ct_file_basename+0x16>
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
add    $0x1,%rax
movzbl (%rdi,%rax,1),%edx
cmp    $0x2f,%dl
je     1110 <ct_file_basename+0x10>
test   %dl,%dl
jne    1112 <ct_file_basename+0x12>
movslq %ecx,%rax
add    %rdi,%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i8* @ct_file_basename(i8* %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = phi i8* [ %12, %9 ], [ %0, %1 ]
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %13
i8 47, label %7
]
7: ; preds = %2
%8 = trunc i64 %3 to i32
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
br label %2
13: ; preds = %2
%14 = add nsw i32 %4, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %0, i64 %15
ret i8* %16
}
void mbox_debugfs_unregister(void) { return; }


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

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

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

LLVM IR (-O2):
define void @mbox_debugfs_unregister() {
ret void
}
void spi_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @spi_enable() {
ret void
}
int event_reinit(struct event_base *base) {
  (void)base;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.event_base = type opaque
define i32 @event_reinit(%struct.event_base* %0) {
%2 = alloca %struct.event_base*
store %struct.event_base* %0, %struct.event_base** %2
%3 = load %struct.event_base*, %struct.event_base** %2
ret i32 0
}

LLVM IR (-O2):
%struct.event_base = type opaque
define i32 @event_reinit(%struct.event_base* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("benchmark_compare [old_benchmark] [new_benchmark]\n"); }


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

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

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

LLVM IR (-O2):
@str = [50 x i8] c"benchmark_compare [old_benchmark] [new_benchmark]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_8Bint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x8B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Bint64_midword_mem>:
testb  $0x8b,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Bint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9109504
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int __attribute__((weak)) _fcntl() { return -1; }


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

x86 assembly (clang, -O2):
<_fcntl>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define weak i32 @_fcntl() {
ret i32 -1
}

LLVM IR (-O2):
define weak i32 @_fcntl() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_100() {
  Assert_real((isqrt(100) == 10),
              "/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/stdlib/isqrt.c",
              505, ("Integer square root of 100 should be 10"));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <isqrt@plt>
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x1f9,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
mov    $0x64,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x1f9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 100 should be 10\00"
define void @t_sqrt_100() {
%1 = call i32 @isqrt(i32 100)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 100 should be 10\00"
define void @t_sqrt_100() {
%1 = tail call i32 @isqrt(i32 100)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ShrTest3(int X) { return -((unsigned)X >> 31); }


x86 assembly (clang, -O0):
<ShrTest3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x1f,%ecx
xor    %eax,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShrTest3>:
mov    %edi,%eax
sar    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @ShrTest3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 31
%5 = sub i32 0, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @ShrTest3(i32 %0) {
%2 = ashr i32 %0, 31
ret i32 %2
}
/* Variables and functions */
long long rint(double);
__attribute__((always_)) __attribute__((const)) long long llrint(double x) {
  return rint(x);
}


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

x86 assembly (clang, -O2):
<llrint>:
jmp    1030 <rint@plt>

LLVM IR (-O0):
define i64 @llrint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @rint(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @llrint(double %0) {
%2 = tail call i64 @rint(double %0)
ret i64 %2
}
int test_imm_13int64_lowword_reg(long long val) {
  return ((val) & (0x13 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_13int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 19
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int open(const char *name, int flags, int mode) { return -1; }


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @open(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int write_dobldobl_start_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(764, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_dobldobl_start_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2fc,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_dobldobl_start_Laurent_system>:
mov    $0x2fc,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @write_dobldobl_start_Laurent_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 764, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @write_dobldobl_start_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 764, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char const *);
int sqlite3UnixDelete(const char *zFilename) {
  unlink(zFilename);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @sqlite3UnixDelete(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 0
}
/* Variables and functions */
int isdigit(char);
bool number(char c) { return isdigit(c); }


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

x86 assembly (clang, -O2):
<number>:
jmp    1030 <isdigit@plt>

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

LLVM IR (-O2):
define i32 @number(i8 signext %0) {
%2 = tail call i32 @isdigit(i8 signext %0)
ret i32 %2
}
float sqr(float a) { return (a * a); }


x86 assembly (clang, -O0):
<sqr>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqr>:
mulss  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @sqr(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
ret float %5
}

LLVM IR (-O2):
define float @sqr(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fff(void) {
  int a = 1;
  a++;
  printf("CRACKED-fff: a is:%d\n", a);
}


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

x86 assembly (clang, -O2):
<fff>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"CRACKED-fff: a is:%d\0A\00"
define void @fff() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"CRACKED-fff: a is:%d\0A\00"
define void @fff() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void code_segment_gtext(void) { output_line(".text"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c".text\00"
define void @code_segment_gtext() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void ft_bzero(void *s, size_t n) {
  size_t i;
  char *ptr_s;
  i = 0;
  ptr_s = ((char *)s);
  while (i < n) {
    ptr_s[i] = 0;
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1147 <ft_bzero+0x47>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <ft_bzero+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_bzero>:
test   %rsi,%rsi
je     1124 <ft_bzero+0x14>
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @ft_bzero(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int getFlashSizeKB();
uint16_t getFlashPageSizeKB(void) { return 1 + (getFlashSizeKB() >= 256); }


x86 assembly (clang, -O0):
<getFlashPageSizeKB>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getFlashSizeKB@plt>
cmp    $0x100,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFlashPageSizeKB>:
push   %rax
xor    %eax,%eax
call   1030 <getFlashSizeKB@plt>
xor    %ecx,%ecx
cmp    $0x100,%eax
setge  %cl
add    $0x1,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getFlashPageSizeKB() {
%1 = call i32 (...) @getFlashSizeKB()
%2 = icmp sge i32 %1, 256
%3 = zext i1 %2 to i32
%4 = add nsw i32 1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @getFlashPageSizeKB() {
%1 = tail call i32 (...) @getFlashSizeKB()
%2 = icmp sgt i32 %1, 255
%3 = select i1 %2, i32 2, i32 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G33_f(char *s) {
  debug("G33_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G33_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G33_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G33_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G33_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G33_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G33_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int ns_add(const int a, const int b) { return a + b; }


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

x86 assembly (clang, -O2):
<ns_add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @ns_add(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 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ns_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ pmf_generic(int, unsigned long, int);
void pmf_executions(int pid, unsigned long int time) {
  pmf_generic(pid, time, 2);
}


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

x86 assembly (clang, -O2):
<pmf_executions>:
mov    $0x2,%edx
jmp    1030 <pmf_generic@plt>

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

LLVM IR (-O2):
define void @pmf_executions(i32 %0, i64 %1) {
%3 = tail call i32 @pmf_generic(i32 %0, i64 %1, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: xframedb [ -p <port> ] [ -s <server_backlog> ] [ -t "
                  "<threads> ]\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [72 x i8] c"Usage: xframedb [ -p <port> ] [ -s <server_backlog> ] [ -t <threads> ]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [72 x i8] c"Usage: xframedb [ -p <port> ] [ -s <server_backlog> ] [ -t <threads> ]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef char wint_t;

/* Variables and functions */
int __iswupper_ascii(wint_t c) { return (unsigned int)(c - 'A') < 26u; }


x86 assembly (clang, -O0):
<__iswupper_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
cmp    $0x1a,%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__iswupper_ascii>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @__iswupper_ascii(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 65
%6 = icmp ult i32 %5, 26
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @__iswupper_ascii(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int number_square(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int nummer;
  scanf("%d", &nummer);
  printf("%d", number_square(nummer));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <number_square@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
call   1050 <number_square@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @number_square(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void gemm(void *args) {}


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

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

LLVM IR (-O0):
define void @gemm(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @gemm(i8* nocapture %0) {
ret void
}
char *awktmp(i) {
  static char str[16];
  sprintf(str, "awk000%02d.tmp", i);
  return str;
}


x86 assembly (clang, -O0):
<awktmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
lea    0x2f06(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<awktmp>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@awktmp.str = internal global [16 x i8] zeroinitializer
@.str = [15 x i8] c"awk000%02d.tmp\00"
define i8* @awktmp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @awktmp.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @awktmp.str, i64 0, i64 0)
}

LLVM IR (-O2):
@awktmp.str = internal global [16 x i8] zeroinitializer
@.str = [15 x i8] c"awk000%02d.tmp\00"
define i8* @awktmp(i32 %0) {
%2 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @awktmp.str, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @awktmp.str, i64 0, i64 0)
}
/* Variables and functions */
int tuner_i2c_read(void *, unsigned short, unsigned char, unsigned char,
                   unsigned char *, unsigned char);
int bbm_com_tuner_read(void *handle, unsigned short devid, unsigned char addr,
                       unsigned char alen, unsigned char *buffer,
                       unsigned char len) {
  int res;
  res = tuner_i2c_read(handle, devid, addr, alen, buffer, len);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_tuner_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r9b,%al
mov    %rdi,-0x8(%rbp)
mov    %si,-0xa(%rbp)
mov    %dl,-0xb(%rbp)
mov    %cl,-0xc(%rbp)
mov    %r8,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%dx
mov    -0xb(%rbp),%cl
mov    -0xc(%rbp),%al
mov    -0x18(%rbp),%r8
movzwl %dx,%esi
movzbl %cl,%edx
movzbl %al,%ecx
movzbl -0x19(%rbp),%r9d
call   1030 <tuner_i2c_read@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_tuner_read>:
jmp    1030 <tuner_i2c_read@plt>

LLVM IR (-O0):
define i32 @bbm_com_tuner_read(i8* %0, i16 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8* %4, i8 zeroext %5) {
%7 = alloca i8*
%8 = alloca i16
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8*
%12 = alloca i8
%13 = alloca i32
store i8* %0, i8** %7
store i16 %1, i16* %8
store i8 %2, i8* %9
store i8 %3, i8* %10
store i8* %4, i8** %11
store i8 %5, i8* %12
%14 = load i8*, i8** %7
%15 = load i16, i16* %8
%16 = load i8, i8* %9
%17 = load i8, i8* %10
%18 = load i8*, i8** %11
%19 = load i8, i8* %12
%20 = call i32 @tuner_i2c_read(i8* %14, i16 zeroext %15, i8 zeroext %16, i8 zeroext %17, i8* %18, i8 zeroext %19)
store i32 %20, i32* %13
%21 = load i32, i32* %13
ret i32 %21
}

LLVM IR (-O2):
define i32 @bbm_com_tuner_read(i8* %0, i16 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8* %4, i8 zeroext %5) {
%7 = tail call i32 @tuner_i2c_read(i8* %0, i16 zeroext %1, i8 zeroext %2, i8 zeroext %3, i8* %4, i8 zeroext %5)
ret i32 %7
}
/* Type definitions */
struct catmc_atomic_uint_least64_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_uint_least64_t *);
void catmc_atomic_uint_least64_t_destroy(
    struct catmc_atomic_uint_least64_t *wrapper) {
  free(wrapper);
}


x86 assembly (clang, -O0):
<catmc_atomic_uint_least64_t_destroy>:
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):
<catmc_atomic_uint_least64_t_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.catmc_atomic_uint_least64_t = type { i32 }
define void @catmc_atomic_uint_least64_t_destroy(%struct.catmc_atomic_uint_least64_t* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_uint_least64_t* %0)
ret void
}
double lcg(long int *seed) {
  static long int a = 69069, c = 1, m = 2147483647;
  static double rm = 2147483647.0;
  *seed = (*seed * a + c) % m;
  return (double)*seed / rm;
}


x86 assembly (clang, -O0):
<lcg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
imul   0x2f09(%rip),%rax
add    0x2f0a(%rip),%rax
cqto
idivq  0x2f09(%rip)
mov    -0x8(%rbp),%rax
mov    %rdx,(%rax)
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm0
divsd  0x2ef9(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcg>:
imul   $0x10dcd,(%rdi),%rcx
lea    0x1(%rcx),%rax
movabs $0x8000000100000003,%rdx
imul   %rdx
lea    (%rdx,%rcx,1),%rax
add    $0x1,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x1e,%rax
add    %rdx,%rax
mov    %rax,%rdx
shl    $0x1f,%rdx
sub    %rdx,%rax
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,(%rdi)
cvtsi2sd %rax,%xmm0
divsd  0xeb1(%rip),%xmm0
ret

LLVM IR (-O0):
@lcg.a = internal global i64 69069
@lcg.c = internal global i64 1
@lcg.m = internal global i64 2147483647
@lcg.rm = internal global double 0x41DFFFFFFFC00000
define double @lcg(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = load i64, i64* @lcg.a
%6 = mul nsw i64 %4, %5
%7 = load i64, i64* @lcg.c
%8 = add nsw i64 %6, %7
%9 = load i64, i64* @lcg.m
%10 = srem i64 %8, %9
%11 = load i64*, i64** %2
store i64 %10, i64* %11
%12 = load i64*, i64** %2
%13 = load i64, i64* %12
%14 = sitofp i64 %13 to double
%15 = load double, double* @lcg.rm
%16 = fdiv double %14, %15
ret double %16
}

LLVM IR (-O2):
define double @lcg(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = mul nsw i64 %2, 69069
%4 = add nsw i64 %3, 1
%5 = srem i64 %4, 2147483647
store i64 %5, i64* %0
%6 = sitofp i64 %5 to double
%7 = fdiv double %6, 0x41DFFFFFFFC00000
ret double %7
}