xunge/DecIR huggingface dataset:
void api_stream_on_peerclosed(struct api_filter_t *filter) {}


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

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

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

LLVM IR (-O2):
%struct.api_filter_t = type opaque
define void @api_stream_on_peerclosed(%struct.api_filter_t* nocapture %0) {
ret void
}
/* Variables and functions */
char toupper(char);
void strupr(char *s) {
  while (*s != '\0') {
    *s = toupper(*s);
    ++s;
  }
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <strupr+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strupr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @strupr(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 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call signext i8 @toupper(i8 signext %10)
%12 = load i8*, i8** %2
store i8 %11, i8* %12
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @strupr(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 i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%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
ret void
}
drawellip(m, n) int m, n;
{}


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

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

LLVM IR (-O0):
define i32 @drawellip(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @drawellip(i32 %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
struct qt_atom {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct qt_atom *);
void free_smhd(struct qt_atom *self) { free(self); }


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

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

LLVM IR (-O2):
%struct.qt_atom = type { i32 }
define void @free_smhd(%struct.qt_atom* nocapture %0) {
%2 = tail call i32 @free(%struct.qt_atom* %0)
ret void
}
/* Variables and functions */
char *put_dec_full9(char *, unsigned long long);
char *put_dec_trunc8(char *, unsigned long long);
char *put_dec(char *buf, unsigned long long n) {
  if (n >= 100 * 1000 * 1000) {
    while (n >= 1000 * 1000 * 1000)
      ;
    if (n >= 100 * 1000 * 1000)
      return put_dec_full9(buf, n);
  }
  return put_dec_trunc8(buf, n);
}


x86 assembly (clang, -O0):
<put_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x5f5e100,-0x18(%rbp)
05
jb     117f <put_dec+0x5f>
jmp    1143 <put_dec+0x23>
cmpq   $0x3b9aca00,-0x18(%rbp)
3b
jb     1156 <put_dec+0x36>
jmp    1143 <put_dec+0x23>
cmpq   $0x5f5e100,-0x18(%rbp)
05
jb     117a <put_dec+0x5a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <put_dec_full9@plt>
mov    %rax,-0x8(%rbp)
jmp    1190 <put_dec+0x70>
jmp    117f <put_dec+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <put_dec_trunc8@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_dec>:
cmp    $0x5f5e100,%rsi
jb     1142 <put_dec+0x22>
cmp    $0x3b9aca00,%rsi
jb     1147 <put_dec+0x27>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1140 <put_dec+0x20>
jmp    1040 <put_dec_trunc8@plt>
jmp    1030 <put_dec_full9@plt>

LLVM IR (-O0):
define i8* @put_dec(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp uge i64 %6, 100000000
br i1 %7, label %8, label %21
8: ; preds = %2
br label %9
9: ; preds = %12, %8
%10 = load i64, i64* %5
%11 = icmp uge i64 %10, 1000000000
br i1 %11, label %12, label %13
12: ; preds = %9
br label %9
13: ; preds = %9
%14 = load i64, i64* %5
%15 = icmp uge i64 %14, 100000000
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i8*, i8** %4
%18 = load i64, i64* %5
%19 = call i8* @put_dec_full9(i8* %17, i64 %18)
store i8* %19, i8** %3
br label %25
20: ; preds = %13
br label %21
21: ; preds = %20, %2
%22 = load i8*, i8** %4
%23 = load i64, i64* %5
%24 = call i8* @put_dec_trunc8(i8* %22, i64 %23)
store i8* %24, i8** %3
br label %25
25: ; preds = %21, %16
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
define i8* @put_dec(i8* %0, i64 %1) {
%3 = icmp ugt i64 %1, 99999999
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = icmp ugt i64 %1, 999999999
br i1 %5, label %6, label %7
6: ; preds = %4, %6
br label %6
7: ; preds = %4
%8 = tail call i8* @put_dec_full9(i8* %0, i64 %1)
br label %11
9: ; preds = %2
%10 = tail call i8* @put_dec_trunc8(i8* %0, i64 %1)
br label %11
11: ; preds = %9, %7
%12 = phi i8* [ %8, %7 ], [ %10, %9 ]
ret i8* %12
}
unsigned f10(unsigned x, int y) {
  unsigned a = (int)x - y;
  return x - a;
}


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

x86 assembly (clang, -O2):
<f10>:
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @f10(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = sub i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @f10(i32 %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  char prev;
  char c;
  while ((c = getchar()) != EOF) {
    if (c != ' ' || prev != ' ') {
      putchar(prev = c);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x6(%rbp)
movsbl %al,%eax
mov    0x2ea5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     117b <main+0x5b>
movsbl -0x6(%rbp),%eax
cmp    $0x20,%eax
jne    1168 <main+0x48>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1176 <main+0x56>
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb6(%rip),%r14
cmp    (%r14),%al
jne    1141 <main+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
jmp    1166 <main+0x46>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %bl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %ebx,%ecx
cmp    (%r14),%al
je     1137 <main+0x17>
mov    %eax,%ebx
cmp    $0x20,%al
jne    1150 <main+0x30>
cmp    $0x20,%cl
je     1158 <main+0x38>
jmp    1150 <main+0x30>

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

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %16, label %4
4: ; preds = %0, %12
%5 = phi i8 [ %13, %12 ], [ %1, %0 ]
%6 = phi i8 [ %5, %12 ], [ undef, %0 ]
%7 = icmp ne i8 %5, 32
%8 = icmp ne i8 %6, 32
%9 = select i1 %7, i1 true, i1 %8
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = tail call i32 @putchar(i8 signext %5)
br label %12
12: ; preds = %4, %10
%13 = tail call signext i8 (...) @getchar()
%14 = load i8, i8* @EOF
%15 = icmp eq i8 %13, %14
br i1 %15, label %16, label %4
16: ; preds = %12, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, squ, cube;
  scanf("%d", &num);
  squ = num * num;
  cube = num * num * num;
  printf("\n%d", squ);
  printf("\n%d", cube);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xeb8(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %2
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%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 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int main() {
  int i;
  for (i = 1; i <= 4; i++) {
    printf("%d\n", rand());
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jg     1163 <main+0x43>
mov    $0x0,%al
call   1040 <rand@plt>
mov    %eax,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <rand@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <rand@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <rand@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @rand()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @rand()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @rand()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @rand()
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DB_process_UDP(unsigned char *);
int /*<<< orphan*/ free(unsigned char *);
void *DB_udphandler(void *udp_BUF) {
  DB_process_UDP((unsigned char *)udp_BUF);
  free((unsigned char *)udp_BUF);
}


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

x86 assembly (clang, -O2):
<DB_udphandler>:
push   %rbx
mov    %rdi,%rbx
call   1040 <DB_process_UDP@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define i8* @DB_udphandler(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @DB_process_UDP(i8* %4)
%6 = load i8*, i8** %3
%7 = call i32 @free(i8* %6)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @DB_udphandler(i8* %0) {
%2 = tail call i32 @DB_process_UDP(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret i8* undef
}
__attribute__((no, noclone)) int fn1(int a, int b) { return (a == b ? 0 : -1); }


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
neg    %eax
ret

LLVM IR (-O0):
define i32 @fn1(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 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 -1
ret i32 %9
}

LLVM IR (-O2):
define i32 @fn1(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = sext i1 %3 to i32
ret i32 %4
}
int testArea(int width, int height) {
  int ERROR = 0;
  return ERROR;
}


x86 assembly (clang, -O0):
<testArea>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @testArea(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fatal(char *, int /*<<< orphan*/);
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void xgettimeofday(struct timeval *tv) {
  if (gettimeofday(tv, 0) != 0)
    fatal("gettimeofday failed: %s", strerror(errno));
}


x86 assembly (clang, -O0):
<xgettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     116d <xgettimeofday+0x3d>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
call   1050 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xgettimeofday>:
push   %rax
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
je     115a <xgettimeofday+0x2a>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1050 <fatal@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [24 x i8] c"gettimeofday failed: %s\00"
@errno = global i32 0
define void @xgettimeofday(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i64 @gettimeofday(%struct.timeval* %3, i32 0)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @errno
%8 = call i32 @strerror(i32 %7)
%9 = call i32 @fatal(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [24 x i8] c"gettimeofday failed: %s\00"
@errno = global i32 0
define void @xgettimeofday(%struct.timeval* %0) {
%2 = tail call i64 @gettimeofday(%struct.timeval* %0, i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @fatal(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error_exit(char *msg) {
  fprintf(stderr, "Aborting: %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_exit>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"Aborting: %s\0A\00"
define void @error_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"Aborting: %s\0A\00"
define void @error_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int main(void) {
  fprintf(stdout, "Hello World!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ extern_func1_12(int, char *, unsigned long);
void extern_func1_11(int a, char *b, unsigned long c) {
  extern_func1_12(a, b, c);
}


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

x86 assembly (clang, -O2):
<extern_func1_11>:
jmp    1030 <extern_func1_12@plt>

LLVM IR (-O0):
define void @extern_func1_11(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @extern_func1_12(i32 %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @extern_func1_11(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @extern_func1_12(i32 %0, i8* %1, i64 %2)
ret void
}
unsigned char op_and(unsigned char n1, unsigned char n2) { return n1 & n2; }


x86 assembly (clang, -O0):
<op_and>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
and    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_and>:
mov    %edi,%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @op_and(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = and i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @op_and(i8 zeroext %0, i8 zeroext %1) {
%3 = and i8 %1, %0
ret i8 %3
}
int pth_pth_uctx_create(void *p) {}


x86 assembly (clang, -O0):
<pth_pth_uctx_create>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pth_pth_uctx_create(i8* nocapture readnone %0) {
ret i32 undef
}
int test_imm_F7uint16_mem(unsigned short *val) {
  return ((*val) & (-0xF7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F7uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff09,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F7uint16_mem>:
movzwl (%rdi),%eax
test   $0xff09,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F7uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -247
%7 = icmp ne i32 %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_F7uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -247
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int c1, c2;
  c1 = 197;
  c2 = 198;
  printf("c1 = %c,c2 = %c\n", c1, c2);
  printf("c1 = %d,c2 = %d\n", c1, c2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc5,-0x8(%rbp)
movl   $0xc6,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"c1 = %c,c2 = %c\0A\00"
@.str.1 = [17 x i8] c"c1 = %d,c2 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 197, i32 198)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 197, i32 198)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ critical(char *);
void *malloc(size_t);
void *mp_malloc(size_t size) {
  void *p;
  p = malloc(size);
  if (!p)
    critical("Out of memory!");
  return p;
}


x86 assembly (clang, -O0):
<mp_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <mp_malloc+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <critical@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <mp_malloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <critical@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Out of memory!\00"
define i8* @mp_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @critical(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"Out of memory!\00"
define noalias i8* @mp_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @critical(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int main() {
  for (int i = 0; i < 10; ++i) {
    for (int j = 0; j < 10; ++j) {
    }
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1153 <main+0x53>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1140 <main+0x40>
jmp    1132 <main+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <main+0x23>
jmp    1145 <main+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @EXIT_SUCCESS
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
float __infer_nondet_float();
float wcstof(const wchar_t *nptr, wchar_t **endptr) {
  return __infer_nondet_float();
}


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

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

LLVM IR (-O0):
define float @wcstof(i32* %0, i32** %1) {
%3 = alloca i32*
%4 = alloca i32**
store i32* %0, i32** %3
store i32** %1, i32*** %4
%5 = call float (...) @__infer_nondet_float()
ret float %5
}

LLVM IR (-O2):
define float @wcstof(i32* nocapture readnone %0, i32** nocapture readnone %1) {
%3 = tail call float (...) @__infer_nondet_float()
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ clip_y(long);
long get_chr_top(long, long);
long get_chr_bottom(long y, long dy) {
  if (!clip_y(y))
    return -1;
  return (get_chr_top(y, dy) + dy - 1);
}


x86 assembly (clang, -O0):
<get_chr_bottom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <clip_y@plt>
cmp    $0x0,%eax
jne    114f <get_chr_bottom+0x2f>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1168 <get_chr_bottom+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <get_chr_top@plt>
add    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_chr_bottom>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <clip_y@plt>
test   %eax,%eax
je     1147 <get_chr_bottom+0x27>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <get_chr_top@plt>
add    %r14,%rax
add    $0xffffffffffffffff,%rax
jmp    114e <get_chr_bottom+0x2e>
mov    $0xffffffffffffffff,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @get_chr_bottom(i64 %0, i64 %1) {
%3 = tail call i32 @clip_y(i64 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @get_chr_top(i64 %0, i64 %1)
%7 = add i64 %1, -1
%8 = add i64 %7, %6
br label %9
9: ; preds = %2, %5
%10 = phi i64 [ %8, %5 ], [ -1, %2 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ io_write_004x(int);
void io_write_0042() { io_write_004x(2); }


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

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

LLVM IR (-O0):
define void @io_write_0042() {
%1 = call i32 @io_write_004x(i32 2)
ret void
}

LLVM IR (-O2):
define void @io_write_0042() {
%1 = tail call i32 @io_write_004x(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rcc_printf(char *, char const *, char const *);
void emit_equ(const char *key, const char *value) {
  rcc_printf(".equ %s,%s\n", key, value);
}


x86 assembly (clang, -O0):
<emit_equ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <rcc_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_equ>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <rcc_printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c".equ %s,%s\0A\00"
define void @emit_equ(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @rcc_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c".equ %s,%s\0A\00"
define void @emit_equ(i8* %0, i8* %1) {
%3 = tail call i32 @rcc_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int blk_mq_debugfs_register_rqos(struct rq_qos *rqos) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.rq_qos = type opaque
define i32 @blk_mq_debugfs_register_rqos(%struct.rq_qos* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_53() {
  Assert_real((isqrt(53) == 7),
              "/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",
              270, ("Integer square root of 53 should be 7"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_53>:
push   %rax
mov    $0x35,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x7,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x10e,%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 = [38 x i8] c"Integer square root of 53 should be 7\00"
define void @t_sqrt_53() {
%1 = call i32 @isqrt(i32 53)
%2 = icmp eq i32 %1, 7
%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 270, i8* getelementptr inbounds ([38 x i8], [38 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 = [38 x i8] c"Integer square root of 53 should be 7\00"
define void @t_sqrt_53() {
%1 = tail call i32 @isqrt(i32 53)
%2 = icmp eq i32 %1, 7
%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 270, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void hw_sleep(const unsigned int seconds) { (void)seconds; }


x86 assembly (clang, -O0):
<hw_sleep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @hw_sleep(i32 %0) {
ret void
}
/* Variables and functions */
int CHAR_BIT;
int my_ctzl(unsigned long x) {
  int i;
  for (i = 0; i < CHAR_BIT * sizeof(unsigned long); i++)
    if (x & ((unsigned long)1 << i))
      break;
  return i;
}


x86 assembly (clang, -O0):
<my_ctzl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    0x2ec6(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
cmp    %rcx,%rax
jae    1161 <my_ctzl+0x61>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     114e <my_ctzl+0x4e>
jmp    1161 <my_ctzl+0x61>
jmp    1153 <my_ctzl+0x53>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <my_ctzl+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_ctzl>:
mov    0x2ed9(%rip),%rax
movslq (%rax),%rax
test   %rax,%rax
je     1143 <my_ctzl+0x43>
shl    $0x3,%rax
cmp    $0x2,%rax
mov    $0x1,%ecx
cmovae %rax,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
bt     %rax,%rdi
jb     1142 <my_ctzl+0x42>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1130 <my_ctzl+0x30>
mov    %rcx,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @my_ctzl(i64 %0) {
%2 = load i32, i32* @CHAR_BIT
%3 = icmp eq i32 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl nsw i64 %5, 3
%7 = call i64 @llvm.umax.i64(i64 %6, i64 1)
br label %8
8: ; preds = %4, %13
%9 = phi i64 [ 0, %4 ], [ %14, %13 ]
%10 = shl nuw i64 1, %9
%11 = and i64 %10, %0
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = add nuw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %16, label %8
16: ; preds = %8, %13
%17 = phi i64 [ %7, %13 ], [ %9, %8 ]
%18 = trunc i64 %17 to i32
br label %19
19: ; preds = %16, %1
%20 = phi i32 [ 0, %1 ], [ %18, %16 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int my_putchar(char c) {
  write(1, &c, 1);
  return 0;
}


x86 assembly (clang, -O0):
<my_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putchar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @my_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @my_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret i32 0
}
void my_hook(int val) {
  printf("%s\n", __FUNCTION__);
  printf("%s: Hooked with %d\n", __FUNCTION__, val);
}


x86 assembly (clang, -O0):
<my_hook>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rdi
lea    0xec3(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_hook>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@__FUNCTION__.my_hook = [8 x i8] c"my_hook\00"
@.str.1 = [20 x i8] c"%s: Hooked with %d\0A\00"
define void @my_hook(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.my_hook, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.my_hook, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@__FUNCTION__.my_hook = [8 x i8] c"my_hook\00"
@.str.1 = [20 x i8] c"%s: Hooked with %d\0A\00"
define void @my_hook(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.my_hook, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.my_hook, i64 0, i64 0), i32 %0)
ret void
}
void mdp4_dsi_cmd_base_swap(int cndx, struct mdp4_overlay_pipe *pipe) {}


x86 assembly (clang, -O0):
<mdp4_dsi_cmd_base_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_dsi_cmd_base_swap(i32 %0, %struct.mdp4_overlay_pipe* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void s_free1(void *pointer) { free(pointer); }


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

LLVM IR (-O0):
define void @s_free1(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 @s_free1(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void gtk_text_iter_inside_word() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_inside_word() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bye_do(int);
int /*<<< orphan*/ exit_wrapper(int /*<<< orphan*/);
void quit(void) {
  bye_do(1);
  exit_wrapper(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <bye_do@plt>
xor    %edi,%edi
call   1040 <exit_wrapper@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<quit>:
push   %rax
mov    $0x1,%edi
call   1030 <bye_do@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <exit_wrapper@plt>

LLVM IR (-O0):
define void @quit() {
%1 = call i32 @bye_do(i32 1)
%2 = call i32 @exit_wrapper(i32 0)
ret void
}

LLVM IR (-O2):
define void @quit() {
%1 = tail call i32 @bye_do(i32 1)
%2 = tail call i32 @exit_wrapper(i32 0)
ret void
}
/* Variables and functions */
int initializePlatformSockets();
int initializePlatform(void) {
  int err;
  err = initializePlatformSockets();
  if (err != 0) {
    return err;
  }
  return 0;
}


x86 assembly (clang, -O0):
<initializePlatform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <initializePlatformSockets@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1137 <initializePlatform+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <initializePlatform+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @initializePlatform() {
%1 = tail call i32 (...) @initializePlatformSockets()
ret i32 %1
}
/* Variables and functions */
int ERR;
int getch();
int /*<<< orphan*/ lnxckeybMakeKey(int);
void lnxckeybProcess() {
  int keyvalue = getch();
  if (keyvalue != ERR) {
    lnxckeybMakeKey(keyvalue);
  }
}


x86 assembly (clang, -O0):
<lnxckeybProcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%eax
je     114c <lnxckeybProcess+0x2c>
mov    -0x4(%rbp),%edi
call   1030 <lnxckeybMakeKey@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lnxckeybProcess>:
push   %rax
xor    %eax,%eax
call   1040 <getch@plt>
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%eax
jne    1135 <lnxckeybProcess+0x15>
pop    %rax
ret
mov    %eax,%edi
pop    %rax
jmp    1030 <lnxckeybMakeKey@plt>

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

LLVM IR (-O2):
@ERR = global i32 0
define void @lnxckeybProcess() {
%1 = tail call i32 (...) @getch()
%2 = load i32, i32* @ERR
%3 = icmp eq i32 %1, %2
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @lnxckeybMakeKey(i32 %1)
br label %6
6: ; preds = %4, %0
ret void
}