xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isInArea(long, long, int);
int findAreaFor(long x, long y, int ccode) {
  while ((++ccode) < 541)
    if (isInArea(x, y, ccode))
      return ccode;
  return -1;
}


x86 assembly (clang, -O0):
<findAreaFor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x21d,%eax
jge    1161 <findAreaFor+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <isInArea@plt>
cmp    $0x0,%rax
je     115c <findAreaFor+0x4c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <findAreaFor+0x58>
jmp    1123 <findAreaFor+0x13>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findAreaFor>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
cmp    $0x21d,%edx
mov    $0x21c,%ebp
cmovge %edx,%ebp
nopl   (%rax)
cmp    %ebx,%ebp
je     114b <findAreaFor+0x3b>
add    $0x1,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <isInArea@plt>
test   %rax,%rax
je     1130 <findAreaFor+0x20>
jmp    1150 <findAreaFor+0x40>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @findAreaFor(i64 %0, i64 %1, i32 %2) {
%4 = call i32 @llvm.smax.i32(i32 %2, i32 540)
br label %5
5: ; preds = %9, %3
%6 = phi i32 [ %2, %3 ], [ %7, %9 ]
%7 = add nsw i32 %6, 1
%8 = icmp eq i32 %6, %4
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = tail call i64 @isInArea(i64 %0, i64 %1, i32 %7)
%11 = icmp eq i64 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %5, %9
%13 = phi i32 [ %7, %9 ], [ -1, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int PUTC(int c) {
  putchar(c);
  return 1;
}


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

x86 assembly (clang, -O2):
<PUTC>:
push   %rax
call   1030 <putchar@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @PUTC(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret i32 1
}
/* Variables and functions */
int Bar6(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int res;
  res = Bar6(1, 2);
  printf("main: res = %d\n", res);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <Bar6@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"main: res = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @Bar6(i32 1, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void *realloc(void *, size_t);
void *reallocordie(void *ptr, size_t sz) {
  void *tmp;
  if ((tmp = realloc(ptr, sz)) == NULL) {
    printf("out of memory\n");
    exit(EXIT_FAILURE);
  }
  return tmp;
}


x86 assembly (clang, -O0):
<reallocordie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1175 <reallocordie+0x45>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocordie>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <reallocordie+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"out of memory\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @reallocordie(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [14 x i8] c"out of memory\00"
define noalias i8* @reallocordie(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret i8* %3
}
int tls13_client_end_of_early_data_send(struct tls13_ctx *ctx) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_client_end_of_early_data_send(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_with_tab(char *);
void output_line(char ptr[]) {
  output_with_tab(ptr);
  newline();
}


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

x86 assembly (clang, -O2):
<output_line>:
push   %rax
call   1040 <output_with_tab@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <newline@plt>

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

LLVM IR (-O2):
define void @output_line(i8* %0) {
%2 = tail call i32 @output_with_tab(i8* %0)
%3 = tail call i32 (...) @newline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ back_square(double, double);
int /*<<< orphan*/ hrt(double, double, char *);
int /*<<< orphan*/ print_check(double, double);
void print_eight(double x, double y) {
  print_check(x, y + 0.5);
  back_square(x, y);
  hrt(x, y, "8");
}


x86 assembly (clang, -O0):
<print_eight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb1(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
call   1050 <print_check@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <back_square@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe8f(%rip),%rdi
call   1030 <hrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_eight>:
sub    $0x18,%rsp
movapd %xmm1,%xmm2
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  0xeb4(%rip),%xmm1
addsd  %xmm2,%xmm1
call   1050 <print_check@plt>
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <back_square@plt>
lea    0xe9b(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
add    $0x18,%rsp
jmp    1030 <hrt@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"8\00"
define void @print_eight(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* %4
%7 = fadd double %6, 5.000000e-01
%8 = call i32 @print_check(double %5, double %7)
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call i32 @back_square(double %9, double %10)
%12 = load double, double* %3
%13 = load double, double* %4
%14 = call i32 @hrt(double %12, double %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"8\00"
define void @print_eight(double %0, double %1) {
%3 = fadd double %1, 5.000000e-01
%4 = tail call i32 @print_check(double %0, double %3)
%5 = tail call i32 @back_square(double %0, double %1)
%6 = tail call i32 @hrt(double %0, double %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ tail(char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    fprintf(stderr, "usage: tail filename ...\n");
    exit(0);
  }
  tail(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1165 <main+0x35>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <tail@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jle    1143 <main+0x13>
mov    0x8(%rsi),%rdi
call   1040 <tail@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"usage: tail filename ...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %2
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @tail(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"usage: tail filename ...\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @tail(i8* %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int char_to_digit(char);
char digit_to_char(int);
void test_digit_char(void) {
  assert(char_to_digit('A') == 10);
  assert(char_to_digit('3') == 3);
  assert(digit_to_char(35) == 'Z');
  assert(digit_to_char(10) == 'A');
}


x86 assembly (clang, -O0):
<test_digit_char>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%edi
call   1030 <char_to_digit@plt>
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x33,%edi
call   1030 <char_to_digit@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x23,%edi
call   1050 <digit_to_char@plt>
movsbl %al,%eax
cmp    $0x5a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0xa,%edi
call   1050 <digit_to_char@plt>
movsbl %al,%eax
cmp    $0x41,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_digit_char>:
push   %rax
mov    $0x41,%edi
call   1030 <char_to_digit@plt>
xor    %edi,%edi
cmp    $0xa,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x33,%edi
call   1030 <char_to_digit@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
mov    $0x23,%edi
call   1050 <digit_to_char@plt>
xor    %edi,%edi
cmp    $0x5a,%al
sete   %dil
call   1040 <assert@plt>
mov    $0xa,%edi
call   1050 <digit_to_char@plt>
xor    %edi,%edi
cmp    $0x41,%al
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @test_digit_char() {
%1 = call i32 @char_to_digit(i8 signext 65)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 @char_to_digit(i8 signext 51)
%6 = icmp eq i32 %5, 3
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call signext i8 @digit_to_char(i32 35)
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 90
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call signext i8 @digit_to_char(i32 10)
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 65
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret void
}

LLVM IR (-O2):
define void @test_digit_char() {
%1 = tail call i32 @char_to_digit(i8 signext 65)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @char_to_digit(i8 signext 51)
%6 = icmp eq i32 %5, 3
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call signext i8 @digit_to_char(i32 35)
%10 = icmp eq i8 %9, 90
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call signext i8 @digit_to_char(i32 10)
%14 = icmp eq i8 %13, 65
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
ret void
}
void g_slist_concat() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_concat() {
ret void
}
int minVal(int x, int y) { return (x < y) ? x : y; }


x86 assembly (clang, -O0):
<minVal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <minVal+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <minVal+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minVal>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @minVal(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 slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @minVal(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int ReloadConfig() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @ReloadConfig() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int /*<<< orphan*/);
void cgstorib(void) { ngen("%s\t%%al,(%%rdx)", "movb", 0); }


x86 assembly (clang, -O0):
<cgstorib>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %edx,%edx
call   1030 <ngen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgstorib>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"%s\09%%al,(%%rdx)\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgstorib() {
%1 = call i32 @ngen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"%s\09%%al,(%%rdx)\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgstorib() {
%1 = tail call i32 @ngen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Type definitions */
struct __sk_buff {
  int dummy;
};
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
void cilium_trace(struct __sk_buff *skb, __u8 type, __u32 arg1, __u32 arg2) {}


x86 assembly (clang, -O0):
<cilium_trace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.__sk_buff = type { i32 }
define void @cilium_trace(%struct.__sk_buff* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.__sk_buff*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.__sk_buff* %0, %struct.__sk_buff** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.__sk_buff = type { i32 }
define void @cilium_trace(%struct.__sk_buff* nocapture %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bloco_b(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int quantidade;
  printf("Informe N:\n");
  scanf("%d", &quantidade);
  bloco_b(quantidade);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <bloco_b@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [11 x i8] c"Informe N:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @bloco_b(i32 %7)
ret i32 0
}
void Act_Done(void) { ; }


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

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

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

LLVM IR (-O2):
define void @Act_Done() {
ret void
}
/* Variables and functions */
bool validBlock(void *validBlockData, const unsigned char *solution) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @validBlock(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void reinit_rand(int add) { srand(time(NULL)); }


x86 assembly (clang, -O0):
<reinit_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reinit_rand>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @reinit_rand(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
ret void
}

LLVM IR (-O2):
define void @reinit_rand(i32 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
ret void
}
void zero_neighbours_clustering(int *arr, int lim) {
  register int i;
  for (i = 0; i < lim + 5; i++) {
    arr[i] = 0;
  }
}


x86 assembly (clang, -O0):
<zero_neighbours_clustering>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x5,%ecx
cmp    %ecx,%eax
jge    1140 <zero_neighbours_clustering+0x40>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <zero_neighbours_clustering+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_neighbours_clustering>:
cmp    $0xfffffffc,%esi
jl     1133 <zero_neighbours_clustering+0x23>
push   %rax
add    $0x4,%esi
xor    %eax,%eax
test   %esi,%esi
cmovle %eax,%esi
lea    0x4(,%rsi,4),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @zero_neighbours_clustering(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
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 5
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %19
11: ; preds = %6
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 0, i32* %15
br label %16
16: ; preds = %11
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @zero_neighbours_clustering(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, -5
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = add i32 %1, 4
%7 = call i32 @llvm.smax.i32(i32 %6, i32 0)
%8 = zext i32 %7 to i64
%9 = shl nuw nsw i64 %8, 2
%10 = add nuw nsw i64 %9, 4
br label %11
11: ; preds = %4, %2
ret void
}
void main() {
  if (0666 == 666) {
  }
}


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

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *malloc_or_die(size_t nbytes) {
  void *result;
  result = malloc(nbytes);
  if (result == NULL) {
    perror("malloc or die");
    abort();
  }
  return result;
}


x86 assembly (clang, -O0):
<malloc_or_die>:
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    1167 <malloc_or_die+0x37>
lea    0xea5(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_or_die>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <malloc_or_die+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"malloc or die\00"
define i8* @malloc_or_die(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 eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"malloc or die\00"
define noalias i8* @malloc_or_die(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret i8* %2
}
int msm_routing_get_dolby_dap_param_to_get_control(
    struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.snd_kcontrol = type opaque
%struct.snd_ctl_elem_value = type opaque
define i32 @msm_routing_get_dolby_dap_param_to_get_control(%struct.snd_kcontrol* nocapture readnone %0, %struct.snd_ctl_elem_value* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char buf[10] = "Hello";
  setuid(0);
  if (argc > 1) {
    strcpy(buf, argv[1]);
  }
  printf("%s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xeb0(%rip),%ax
mov    %ax,-0x12(%rbp)
xor    %edi,%edi
call   1050 <setuid@plt>
cmpl   $0x1,-0x8(%rbp)
jle    117e <main+0x4e>
lea    -0x1a(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x1a(%rbp),%rsi
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movabs $0x6f6c6c6548,%rax
mov    %rax,0x8(%rsp)
movw   $0x0,0x10(%rsp)
xor    %edi,%edi
call   1050 <setuid@plt>
cmp    $0x2,%ebp
jl     116b <main+0x3b>
mov    0x8(%rbx),%rsi
lea    0x8(%rsp),%rdi
call   1030 <strcpy@plt>
lea    0xe98(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.buf = [10 x i8] c"Hello\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [10 x i8]* %6 to i8*
%8 = call i32 @setuid(i32 0)
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @strcpy(i8* %12, i8* %15)
br label %17
17: ; preds = %11, %2
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %18)
ret i32 0
}

LLVM IR (-O2):
@__const.main.buf = [10 x i8] c"Hello\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @setuid(i32 0)
%6 = icmp sgt i32 %0, 1
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @strcpy(i8* %4, i8* %9)
br label %11
11: ; preds = %7, %2
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
char *s_all() { return "All requests welcomed"; }


x86 assembly (clang, -O0):
<s_all>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_all>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"All requests welcomed\00"
define i8* @s_all() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [22 x i8] c"All requests welcomed\00"
define i8* @s_all() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
unsigned char *aes128cbc_encrypt(unsigned char *, size_t *,
                                 unsigned char const *, size_t,
                                 unsigned char const *, unsigned char const *);
unsigned char *crypt_encrypt_aes128cbc(unsigned char *out, size_t *out_len,
                                       const unsigned char *in, size_t in_len,
                                       const unsigned char *nonce,
                                       const unsigned char *key) {
  return aes128cbc_encrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_encrypt_aes128cbc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <aes128cbc_encrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_encrypt_aes128cbc>:
jmp    1030 <aes128cbc_encrypt@plt>

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

LLVM IR (-O2):
define i8* @crypt_encrypt_aes128cbc(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @aes128cbc_encrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void print_int64(unsigned long long int val) {
  for (int byte = 7; byte >= 0; byte--)
    putchar((char)(val >> (byte * 8)));
}


x86 assembly (clang, -O0):
<print_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1152 <print_int64+0x42>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
mov    %ecx,%ecx
shr    %cl,%rax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_int64+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int64>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
shr    $0x38,%rax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    %rbx,%rax
shr    $0x30,%rax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    %rbx,%rax
shr    $0x28,%rax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    %rbx,%rax
shr    $0x20,%rax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
sar    $0x18,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
shr    $0x8,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @print_int64(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 7, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i64, i64* %2
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 8
%11 = zext i32 %10 to i64
%12 = lshr i64 %8, %11
%13 = trunc i64 %12 to i8
%14 = call i32 @putchar(i8 signext %13)
br label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = add nsw i32 %16, -1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @print_int64(i64 %0) {
%2 = lshr i64 %0, 56
%3 = trunc i64 %2 to i8
%4 = tail call i32 @putchar(i8 signext %3)
%5 = lshr i64 %0, 48
%6 = trunc i64 %5 to i8
%7 = tail call i32 @putchar(i8 signext %6)
%8 = lshr i64 %0, 40
%9 = trunc i64 %8 to i8
%10 = tail call i32 @putchar(i8 signext %9)
%11 = lshr i64 %0, 32
%12 = trunc i64 %11 to i8
%13 = tail call i32 @putchar(i8 signext %12)
%14 = lshr i64 %0, 24
%15 = trunc i64 %14 to i8
%16 = tail call i32 @putchar(i8 signext %15)
%17 = lshr i64 %0, 16
%18 = trunc i64 %17 to i8
%19 = tail call i32 @putchar(i8 signext %18)
%20 = lshr i64 %0, 8
%21 = trunc i64 %20 to i8
%22 = tail call i32 @putchar(i8 signext %21)
%23 = trunc i64 %0 to i8
%24 = tail call i32 @putchar(i8 signext %23)
ret void
}
double foo(double x, double y) {
  volatile int i = 0;
  return i > 0 ? x : y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x0,%eax
jle    1130 <foo+0x30>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    113a <foo+0x3a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,-0x4(%rsp)
cmpl   $0x0,-0x4(%rsp)
jg     1112 <foo+0x12>
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @foo(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
store double %1, double* %4
store volatile i32 0, i32* %5
%6 = load volatile i32, i32* %5
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @foo(double %0, double %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = load volatile i32, i32* %3
%6 = icmp sgt i32 %5, 0
%7 = select i1 %6, double %0, double %1
ret double %7
}
int __attribute__((target("arch=ivybridge"))) foo(int i) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 1
}
void __cyg_profile_func_exit(void *a, void *p) {}


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

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

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

LLVM IR (-O2):
define void @__cyg_profile_func_exit(i8* nocapture %0, i8* nocapture %1) {
ret void
}
double facial_average(double f00, double f10, double f11, double f01) {
  return ((f00 + f11 + f10 + f01) / 4);
}


x86 assembly (clang, -O0):
<facial_average>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<facial_average>:
addsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm3,%xmm0
mulsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @facial_average(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = fadd double %9, %10
%12 = load double, double* %6
%13 = fadd double %11, %12
%14 = load double, double* %8
%15 = fadd double %13, %14
%16 = fdiv double %15, 4.000000e+00
ret double %16
}

LLVM IR (-O2):
define double @facial_average(double %0, double %1, double %2, double %3) {
%5 = fadd double %0, %2
%6 = fadd double %5, %1
%7 = fadd double %6, %3
%8 = fmul double %7, 2.500000e-01
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void cdrom_null_reset(uint8_t id) {}


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

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

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

LLVM IR (-O2):
define void @cdrom_null_reset(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
unsigned char *serialize_u_int32_t(unsigned char *, int /*<<< orphan*/);
unsigned char *serialize_u_int32_t_array3(unsigned char *buffer,
                                          u_int32_t value[3]) {
  int i;
  for (i = 0; i < 3; i++) {
    buffer = serialize_u_int32_t(buffer, value[i]);
  }
  return buffer;
}


x86 assembly (clang, -O0):
<serialize_u_int32_t_array3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    1157 <serialize_u_int32_t_array3+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <serialize_u_int32_t@plt>
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <serialize_u_int32_t_array3+0x17>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize_u_int32_t_array3>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%esi
call   1030 <serialize_u_int32_t@plt>
mov    0x4(%rbx),%esi
mov    %rax,%rdi
call   1030 <serialize_u_int32_t@plt>
mov    0x8(%rbx),%esi
mov    %rax,%rdi
pop    %rbx
jmp    1030 <serialize_u_int32_t@plt>

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

LLVM IR (-O2):
define i8* @serialize_u_int32_t_array3(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i8* @serialize_u_int32_t(i8* %0, i32 %3)
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = tail call i8* @serialize_u_int32_t(i8* %4, i32 %6)
%8 = getelementptr inbounds i32, i32* %1, i64 2
%9 = load i32, i32* %8
%10 = tail call i8* @serialize_u_int32_t(i8* %7, i32 %9)
ret i8* %10
}
void f2(void) {
  char buf[1000];
  int i = 0;
  for (i = 0; i < 1000; i++)
    buf[i] = 0;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x380,%rsp
movl   $0x0,-0x3f4(%rbp)
movl   $0x0,-0x3f4(%rbp)
cmpl   $0x3e8,-0x3f4(%rbp)
jge    1152 <f2+0x52>
movslq -0x3f4(%rbp),%rax
movb   $0x0,-0x3f0(%rbp,%rax,1)
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    111f <f2+0x1f>
add    $0x380,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x6d() {
  Assert_real((isascii(109)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              550, ("isascii should be 1 for m"));
}


x86 assembly (clang, -O0):
<t_isascii_0x6d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6d,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x226,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x6d>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x226,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for m\00"
define void @t_isascii_0x6d() {
%1 = call i32 @isascii(i32 109)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 550, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for m\00"
define void @t_isascii_0x6d() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 550, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void NeverVoid(void) {
  printf("FAIL: NeverVoid should never be called\n");
  exit(1);
}


x86 assembly (clang, -O0):
<NeverVoid>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<NeverVoid>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"FAIL: NeverVoid should never be called\0A\00"
define void @NeverVoid() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [39 x i8] c"FAIL: NeverVoid should never be called\00"
define void @NeverVoid() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t mmio_read_32(uintptr_t addr) { return *(volatile uint32_t *)addr; }


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

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

LLVM IR (-O0):
define i32 @mmio_read_32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @mmio_read_32(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int print(int, char *);
int normal(int tty) { return print(tty, "\033[0m"); }


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

x86 assembly (clang, -O2):
<normal>:
lea    0xee9(%rip),%rsi
jmp    1030 <print@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define i32 @normal(i32 %0) {
%2 = tail call i32 @print(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
char *mute_ident() { return "$Id: mute_reciva.c 230 2007-10-23 17:42:49Z  $"; }


x86 assembly (clang, -O0):
<mute_ident>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mute_ident>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [47 x i8] c"$Id: mute_reciva.c 230 2007-10-23 17:42:49Z $\00"
define i8* @mute_ident() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [47 x i8] c"$Id: mute_reciva.c 230 2007-10-23 17:42:49Z $\00"
define i8* @mute_ident() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}