xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ router_get_by_id_digest(char const *);
scalar_t__ router_get_consensus_status_by_id(char const *);
int connection_or_digest_is_known_relay(const char *id_digest) {
  if (router_get_consensus_status_by_id(id_digest))
    return 1;
  if (router_get_by_id_digest(id_digest))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<connection_or_digest_is_known_relay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <router_get_consensus_status_by_id@plt>
cmp    $0x0,%rax
je     114b <connection_or_digest_is_known_relay+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1171 <connection_or_digest_is_known_relay+0x51>
mov    -0x10(%rbp),%rdi
call   1040 <router_get_by_id_digest@plt>
cmp    $0x0,%rax
je     116a <connection_or_digest_is_known_relay+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1171 <connection_or_digest_is_known_relay+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connection_or_digest_is_known_relay>:
push   %rbx
mov    %rdi,%rbx
call   1030 <router_get_consensus_status_by_id@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <connection_or_digest_is_known_relay+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <router_get_by_id_digest@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @connection_or_digest_is_known_relay(i8* %0) {
%2 = tail call i64 @router_get_consensus_status_by_id(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @router_get_by_id_digest(i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void kolibri_reformat_contents(struct gui_window *g) {}


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

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

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

LLVM IR (-O2):
%struct.gui_window = type opaque
define void @kolibri_reformat_contents(%struct.gui_window* nocapture %0) {
ret void
}
/* Variables and functions */
int get_cpuid_count(unsigned int, int /*<<< orphan*/, unsigned int *,
                    unsigned int *, unsigned int *, unsigned int *);
int get_cpuid(unsigned int leaf, unsigned int *eax, unsigned int *ebx,
              unsigned int *ecx, unsigned int *edx) {
  return (get_cpuid_count(leaf, 0, eax, ebx, ecx, edx));
}


x86 assembly (clang, -O0):
<get_cpuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
xor    %esi,%esi
call   1030 <get_cpuid_count@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpuid>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <get_cpuid_count@plt>

LLVM IR (-O0):
define i32 @get_cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load i32*, i32** %10
%16 = call i32 @get_cpuid_count(i32 %11, i32 0, i32* %12, i32* %13, i32* %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @get_cpuid_count(i32 %0, i32 0, i32* %1, i32* %2, i32* %3, i32* %4)
ret i32 %6
}
/* Variables and functions */
float my_cos(float);
float my_sin(float);
float my_tan(float x) { return my_sin(x) / my_cos(x); }


x86 assembly (clang, -O0):
<my_tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <my_sin@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <my_cos@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_tan>:
push   %rax
movss  %xmm0,(%rsp)
call   1030 <my_sin@plt>
movss  %xmm0,0x4(%rsp)
movss  (%rsp),%xmm0
call   1040 <my_cos@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @my_tan(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @my_sin(float %3)
%5 = load float, float* %2
%6 = call float @my_cos(float %5)
%7 = fdiv float %4, %6
ret float %7
}

LLVM IR (-O2):
define float @my_tan(float %0) {
%2 = tail call float @my_sin(float %0)
%3 = tail call float @my_cos(float %0)
%4 = fdiv float %2, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int spawn(char *, char **);
int main() {
  char *arg_list[] = {"ls", "-l", "/", NULL};
  int ret = spawn("ls", arg_list);
  printf("done with main program, ret = %d\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2cca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cc7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2cc4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cc1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1040 <spawn@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0x2ce5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2cc9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xebe(%rip),%rdi
mov    %rsp,%rsi
call   1040 <spawn@plt>
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [2 x i8] c"/\00"
@__const.main.arg_list = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.3 = [34 x i8] c"done with main program, ret = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8*]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [4 x i8*]* %2 to i8*
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
%6 = call i32 @spawn(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [2 x i8] c"/\00"
@__const.main.arg_list = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0), i8* null]
@.str.3 = [34 x i8] c"done with main program, ret = %d\0A\00"
define i32 @main() {
%1 = alloca [4 x i8*]
%2 = bitcast [4 x i8*]* %1 to i8*
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%4 = call i32 @spawn(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_line(char line[]) {
  int i;
  for (i = 0; line[i] != '\0'; ++i) {
    putchar(line[i]);
  }
}


x86 assembly (clang, -O0):
<print_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <print_line+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_line+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_line>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <print_line+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <print_line+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_line(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @putchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int getchar();
void in_comment(void) {
  int c, d;
  c = getchar();
  d = getchar();
  while (c != '*' || d != '/') {
    c = d;
    d = getchar();
  }
}


x86 assembly (clang, -O0):
<in_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x2a,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1145 <in_comment+0x35>
cmpl   $0x2f,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1155 <in_comment+0x45>
jmp    116a <in_comment+0x5a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    112c <in_comment+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_comment>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
nopl   0x0(%rax,%rax,1)
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x2a,%ebx
jne    1120 <in_comment+0x10>
cmp    $0x2f,%eax
jne    1120 <in_comment+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @in_comment() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 42
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 47
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = load i32, i32* %2
store i32 %14, i32* %1
%15 = call i32 (...) @getchar()
store i32 %15, i32* %2
br label %5
16: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @in_comment() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %1, 42
%4 = icmp ne i32 %2, 47
%5 = or i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = phi i32 [ %8, %6 ], [ %2, %0 ]
%8 = tail call i32 (...) @getchar()
%9 = icmp ne i32 %7, 42
%10 = icmp ne i32 %8, 47
%11 = or i1 %9, %10
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int readArgs() {
  int n;
  scanf("%d", &n);
  return n;
}


x86 assembly (clang, -O0):
<readArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readArgs>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @readArgs() {
%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
ret i32 %4
}
/* Variables and functions */
scalar_t__ isdigit(char);
char *skipDigits(char *arg) {
  while (isdigit(*arg))
    ++arg;
  return arg;
}


x86 assembly (clang, -O0):
<skipDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1143 <skipDigits+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipDigits+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipDigits>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isdigit@plt>
test   %rax,%rax
jne    1120 <skipDigits+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skipDigits(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isdigit(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @skipDigits(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isdigit(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main(void) {
  int i = 0;
  printf("Mój pid to %d\n", getpid());
  for (;; ++i) {
    sleep(1);
    printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0x8(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115b <main+0x2b>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xeba(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x1,%ebx
jmp    1160 <main+0x30>

LLVM IR (-O0):
@.str = [16 x i8] c"M\C3\B3j pid to %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %5
5: ; preds = %9, %0
%6 = call i32 @sleep(i32 1)
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %5
}

LLVM IR (-O2):
@.str = [16 x i8] c"M\C3\B3j pid to %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 0, %0 ], [ %7, %3 ]
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%7 = add nuw nsw i32 %4, 1
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ db_close();
int /*<<< orphan*/ start();
int main(int argc, char **argv) {
  start();
  db_close();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <start@plt>
mov    $0x0,%al
call   1030 <db_close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @start()
%6 = call i32 (...) @db_close()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @start()
%4 = tail call i32 (...) @db_close()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hej();
int /*<<< orphan*/ printf(char *);
int main() {
  hej();
  printf("Zjadles moje kanapki ?\n");
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Zjadles moje kanapki ?\0A\00"
define i32 @main() {
%1 = call i32 (...) @hej()
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Zjadles moje kanapki ?\00"
define i32 @main() {
%1 = tail call i32 (...) @hej()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void audio_resume(void) {}


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

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

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

LLVM IR (-O2):
define void @audio_resume() {
ret void
}
void bar(void) {
  char *nuller = 0;
  *nuller = 'a';
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @bar() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
store i8 97, i8* %2
ret void
}

LLVM IR (-O2):
void orf(char *str) {
  *str = 0x4f;
  *str = 0x52;
  *str = 0x52;
}


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

x86 assembly (clang, -O2):
<orf>:
movb   $0x52,(%rdi)
ret

LLVM IR (-O0):
define void @orf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
store i8 79, i8* %3
%4 = load i8*, i8** %2
store i8 82, i8* %4
%5 = load i8*, i8** %2
store i8 82, i8* %5
ret void
}

LLVM IR (-O2):
define void @orf(i8* nocapture writeonly %0) {
store i8 82, i8* %0
ret void
}
/* Variables and functions */
char hexchar(int x) {
  static const char table[16] = "0123456789abcdef";
  return table[x & 15];
}


x86 assembly (clang, -O0):
<hexchar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xee9(%rip),%rax
movsbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexchar>:
and    $0xf,%edi
lea    0xef6(%rip),%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
@hexchar.table = internal constant [16 x i8] c"0123456789abcdef"
define signext i8 @hexchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [16 x i8], [16 x i8]* @hexchar.table, i64 0, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}

LLVM IR (-O2):
@hexchar.table = internal unnamed_addr constant [16 x i8] c"0123456789abcdef"
define signext i8 @hexchar(i32 %0) {
%2 = and i32 %0, 15
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [16 x i8], [16 x i8]* @hexchar.table, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}
/* Variables and functions */
unsigned char *flag_table_3_5_location(unsigned char **);
int flag_table_3_5(unsigned char **sec) {
  unsigned char *p;
  p = flag_table_3_5_location(sec);
  if (p == NULL)
    return -1;
  return (int)*p;
}


x86 assembly (clang, -O0):
<flag_table_3_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <flag_table_3_5_location@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1140 <flag_table_3_5+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <flag_table_3_5+0x3a>
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flag_table_3_5>:
push   %rax
call   1030 <flag_table_3_5_location@plt>
test   %rax,%rax
je     1120 <flag_table_3_5+0x10>
movzbl (%rax),%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @flag_table_3_5(i8** %0) {
%2 = tail call i8* @flag_table_3_5_location(i8** %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Variables and functions */
int strlen(const unsigned char *src) {
  int ret;
  for (ret = 0; *src; src++)
    ret++;
  return ret;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <strlen+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
void hrtimer_init(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<hrtimer_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hrtimer_init>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.hrtimer_init = [13 x i8] c"hrtimer_init\00"
define void @hrtimer_init() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.hrtimer_init, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.hrtimer_init = [13 x i8] c"hrtimer_init\00"
define void @hrtimer_init() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.hrtimer_init, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: imlib2_grab [-v] [-id <drawable id>] [-width <width>] "
         "[-height <height>] [-noshape] <output file>\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 = [106 x i8] c"Usage: imlib2_grab [-v] [-id <drawable id>] [-width <width>] [-height <height>] [-noshape] <output file>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [105 x i8] c"Usage: imlib2_grab [-v] [-id <drawable id>] [-width <width>] [-height <height>] [-noshape] <output file>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([105 x i8], [105 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int inl(int);
int /*<<< orphan*/ slow_down_io();
__attribute__((always_)) unsigned int inl_p(int port) {
  unsigned int value = inl(port);
  slow_down_io();
  return value;
}


x86 assembly (clang, -O0):
<inl_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <inl@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <slow_down_io@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl_p>:
push   %rbx
call   1030 <inl@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <slow_down_io@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @inl_p(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @inl(i32 %4)
store i32 %5, i32* %3
%6 = call i32 (...) @slow_down_io()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @inl_p(i32 %0) {
%2 = tail call i32 @inl(i32 %0)
%3 = tail call i32 (...) @slow_down_io()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _mm_mwait(int /*<<< orphan*/, int /*<<< orphan*/);
void __attribute__((__target__("sse3"))) mm_mwait_wrap(int a) {
  _mm_mwait(0, 0);
}


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

x86 assembly (clang, -O2):
<mm_mwait_wrap>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <_mm_mwait@plt>

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

LLVM IR (-O2):
define void @mm_mwait_wrap(i32 %0) {
%2 = tail call i32 @_mm_mwait(i32 0, i32 0)
ret void
}
int lenStr(char str[]) {
  int i;
  for (i = 0; '\0' != str[i]; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<lenStr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1138 <lenStr+0x38>
jmp    112a <lenStr+0x2a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <lenStr+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @lenStr(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void bdb_free(void *mem) { free(mem); }


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

LLVM IR (-O0):
define void @bdb_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 @bdb_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
float sinf(float);
float __ocl_native_sin_float(float src) { return sinf(src); }


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

x86 assembly (clang, -O2):
<__ocl_native_sin_float>:
jmp    1030 <sinf@plt>

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

LLVM IR (-O2):
define float @__ocl_native_sin_float(float %0) {
%2 = tail call float @sinf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
int /*<<< orphan*/ fexpect_string(char *, int, char *, char *);
void escape() {
  int value = 10;
  fexpect(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/lex.c",
      31, 10, value);
  ;
  fexpect_string(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/lex.c",
      33, "a   bc", "a\   bc");
  ;
}


x86 assembly (clang, -O0):
<escape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xec7(%rip),%rdi
mov    $0x1f,%esi
mov    $0xa,%edx
call   1040 <fexpect@plt>
lea    0xeb1(%rip),%rdi
mov    $0x21,%esi
lea    0xf2d(%rip),%rcx
mov    %rcx,%rdx
call   1030 <fexpect_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escape>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1f,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
call   1040 <fexpect@plt>
lea    0xf42(%rip),%rcx
mov    %rbx,%rdi
mov    $0x21,%esi
mov    %rcx,%rdx
pop    %rbx
jmp    1030 <fexpect_string@plt>

LLVM IR (-O0):
@.str = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/lex.c\00"
@.str.1 = [7 x i8] c"a bc\00"
define void @escape() {
%1 = alloca i32
store i32 10, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @fexpect(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i32 31, i32 10, i32 %2)
%4 = call i32 @fexpect_string(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i32 33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/lex.c\00"
@.str.1 = [7 x i8] c"a bc\00"
define void @escape() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i32 31, i32 10, i32 10)
%2 = tail call i32 @fexpect_string(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), i32 33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct unrez_resourcefork {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int unrez_resourcefork_openat(struct unrez_resourcefork *, int /*<<< orphan*/,
                              char const *);
int unrez_resourcefork_open(struct unrez_resourcefork *rfork,
                            const char *path) {
  return unrez_resourcefork_openat(rfork, AT_FDCWD, path);
}


x86 assembly (clang, -O0):
<unrez_resourcefork_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <unrez_resourcefork_openat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unrez_resourcefork_open>:
mov    %rsi,%rdx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
jmp    1030 <unrez_resourcefork_openat@plt>

LLVM IR (-O0):
%struct.unrez_resourcefork = type { i32 }
@AT_FDCWD = global i32 0
define i32 @unrez_resourcefork_open(%struct.unrez_resourcefork* %0, i8* %1) {
%3 = alloca %struct.unrez_resourcefork*
%4 = alloca i8*
store %struct.unrez_resourcefork* %0, %struct.unrez_resourcefork** %3
store i8* %1, i8** %4
%5 = load %struct.unrez_resourcefork*, %struct.unrez_resourcefork** %3
%6 = load i32, i32* @AT_FDCWD
%7 = load i8*, i8** %4
%8 = call i32 @unrez_resourcefork_openat(%struct.unrez_resourcefork* %5, i32 %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.unrez_resourcefork = type { i32 }
@AT_FDCWD = global i32 0
define i32 @unrez_resourcefork_open(%struct.unrez_resourcefork* %0, i8* %1) {
%3 = load i32, i32* @AT_FDCWD
%4 = tail call i32 @unrez_resourcefork_openat(%struct.unrez_resourcefork* %0, i32 %3, i8* %1)
ret i32 %4
}
int noLargerThan(int valve, int data) { return (data <= valve); }


x86 assembly (clang, -O0):
<noLargerThan>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<noLargerThan>:
xor    %eax,%eax
cmp    %edi,%esi
setle  %al
ret

LLVM IR (-O0):
define i32 @noLargerThan(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @noLargerThan(i32 %0, i32 %1) {
%3 = icmp sle i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned int ndigits(unsigned long long val) {
  unsigned int len = 0;
  do {
    val /= 10;
    len++;
  } while (val);
  return (len);
}


x86 assembly (clang, -O0):
<ndigits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    110f <ndigits+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndigits>:
xor    %ecx,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
nopl   0x0(%rax)
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
add    $0x1,%ecx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1110 <ndigits+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ndigits(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %5, %2 ]
%4 = phi i32 [ 0, %1 ], [ %6, %2 ]
%5 = udiv i64 %3, 10
%6 = add i32 %4, 1
%7 = icmp ult i64 %3, 10
br i1 %7, label %8, label %2
8: ; preds = %2
ret i32 %6
}
int ahc_nothing(void *cls, struct MHD_Connection *connection, const char *url,
                const char *method, const char *version,
                const char *upload_data, unsigned int *upload_data_size,
                void **unused) {
  return 0;
}


x86 assembly (clang, -O0):
<ahc_nothing>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.MHD_Connection = type opaque
define i32 @ahc_nothing(i8* %0, %struct.MHD_Connection* %1, i8* %2, i8* %3, i8* %4, i8* %5, i32* %6, i8** %7) {
%9 = alloca i8*
%10 = alloca %struct.MHD_Connection*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32*
%16 = alloca i8**
store i8* %0, i8** %9
store %struct.MHD_Connection* %1, %struct.MHD_Connection** %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i32* %6, i32** %15
store i8** %7, i8*** %16
ret i32 0
}

LLVM IR (-O2):
%struct.MHD_Connection = type opaque
define i32 @ahc_nothing(i8* nocapture readnone %0, %struct.MHD_Connection* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i32* nocapture readnone %6, i8** nocapture readnone %7) {
ret i32 0
}
int main() { char f; }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
double sqrt(double);
double Len(double x, double y) { return sqrt(x * x + y * y); }


x86 assembly (clang, -O0):
<Len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Len>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <Len+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @Len(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @Len(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
/* Variables and functions */
size_t u_width_impl(char const *, int /*<<< orphan*/, int);
size_t u_width(const char *string) { return u_width_impl(string, 0, false); }


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

x86 assembly (clang, -O2):
<u_width>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <u_width_impl@plt>

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

LLVM IR (-O2):
define i64 @u_width(i8* %0) {
%2 = tail call i64 @u_width_impl(i8* %0, i32 0, i32 0)
ret i64 %2
}
/* Type definitions */
typedef int int16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(int *, int, int, int /*<<< orphan*/ *);
int16_t read_int16_inv(FILE *fp) {
  int16_t v;
  fread(&v, 2, 1, fp);
  return v >> 8 | v << 8;
}


x86 assembly (clang, -O0):
<read_int16_inv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int16_inv>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    0x4(%rsp),%eax
mov    %eax,%ecx
sar    $0x8,%ecx
shl    $0x8,%eax
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_int16_inv(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fread(i32* %3, i32 2, i32 1, i32* %4)
%6 = load i32, i32* %3
%7 = ashr i32 %6, 8
%8 = load i32, i32* %3
%9 = shl i32 %8, 8
%10 = or i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @read_int16_inv(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i32* %2, i32 2, i32 1, i32* %0)
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = shl i32 %5, 8
%8 = or i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int alt_handler(char **save) {
  write_instr(0x00);
  write_imm(0xE2);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<alt_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0xe2,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alt_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0xe2,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @alt_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 226)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @alt_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 226)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PyErr_SetString(int, char *);
int pyIndToCInd(int py_ind, unsigned dim) {
  ;
  if (py_ind < 0)
    py_ind += (int)dim;
  if (py_ind < (int)dim)
    return py_ind;
  PyErr_SetString(3, "list index out of range");
  return -1;
}


x86 assembly (clang, -O0):
<pyIndToCInd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <pyIndToCInd+0x21>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1148 <pyIndToCInd+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <pyIndToCInd+0x50>
mov    $0x3,%edi
lea    0xeac(%rip),%rsi
call   1030 <PyErr_SetString@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pyIndToCInd>:
mov    %edi,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edi,%eax
cmp    %esi,%eax
jl     1138 <pyIndToCInd+0x28>
push   %rax
lea    0xedb(%rip),%rsi
mov    $0x3,%edi
call   1030 <PyErr_SetString@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"list index out of range\00"
define i32 @pyIndToCInd(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = select i1 %3, i32 %1, i32 0
%5 = add nsw i32 %4, %0
%6 = icmp slt i32 %5, %1
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @PyErr_SetString(i32 3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ -1, %7 ], [ %5, %2 ]
ret i32 %10
}
void gtk_cell_renderer_start_editing() {}


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

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

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

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