xunge/DecIR huggingface dataset:
/* Variables and functions */
int either_or_both_is_null(const char *exp, const char *act) {
  return ((exp == NULL && act != NULL) || (exp != NULL && act == NULL) ||
          (exp == NULL && act == NULL));
}


x86 assembly (clang, -O0):
<either_or_both_is_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1127 <either_or_both_is_null+0x27>
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jne    1163 <either_or_both_is_null+0x63>
cmpq   $0x0,-0x8(%rbp)
je     1142 <either_or_both_is_null+0x42>
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1163 <either_or_both_is_null+0x63>
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x12(%rbp)
jne    115d <either_or_both_is_null+0x5d>
cmpq   $0x0,-0x10(%rbp)
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<either_or_both_is_null>:
mov    $0x1,%eax
test   %rdi,%rdi
jne    1110 <either_or_both_is_null+0x10>
test   %rsi,%rsi
je     1110 <either_or_both_is_null+0x10>
ret
test   %rdi,%rdi
je     111a <either_or_both_is_null+0x1a>
test   %rsi,%rsi
je     110f <either_or_both_is_null+0xf>
xor    %eax,%eax
or     %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @either_or_both_is_null(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 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %24, label %10
10: ; preds = %7, %2
%11 = load i8*, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i8*, i8** %4
%15 = icmp eq i8* %14, null
br i1 %15, label %24, label %16
16: ; preds = %13, %10
%17 = load i8*, i8** %3
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i8*, i8** %4
%21 = icmp eq i8* %20, null
br label %22
22: ; preds = %19, %16
%23 = phi i1 [ false, %16 ], [ %21, %19 ]
br label %24
24: ; preds = %22, %13, %7
%25 = phi i1 [ true, %13 ], [ true, %7 ], [ %23, %22 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @either_or_both_is_null(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = icmp ne i8* %0, null
%8 = icmp eq i8* %1, null
%9 = and i1 %7, %8
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = and i1 %3, %8
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %2, %10
%14 = phi i32 [ %12, %10 ], [ 1, %2 ], [ 1, %6 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int putc(int, int /*<<< orphan*/ *);
int fputc(int c, FILE *fp) { return (putc(c, fp)); }


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

x86 assembly (clang, -O2):
<fputc>:
jmp    1030 <putc@plt>

LLVM IR (-O0):
define i32 @fputc(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 = call i32 @putc(i32 %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @fputc(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @putc(i32 %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ q_isdigit(int);
int q_isxdigit(int c) {
  return (q_isdigit(c) || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'));
}


x86 assembly (clang, -O0):
<q_isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <q_isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    116d <q_isxdigit+0x5d>
cmpl   $0x61,-0x4(%rbp)
jl     114e <q_isxdigit+0x3e>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    116d <q_isxdigit+0x5d>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1167 <q_isxdigit+0x57>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <q_isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xffffffdf,%ebx
add    $0xffffffbf,%ebx
cmp    $0x6,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @q_isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @q_isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 97
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 102
br i1 %11, label %20, label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 70
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
br label %20
20: ; preds = %18, %9, %1
%21 = phi i1 [ true, %9 ], [ true, %1 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @q_isxdigit(i32 %0) {
%2 = tail call i64 @q_isdigit(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
int sgn(double x) {
  if (x == 0)
    return 0;
  if (x < 0)
    return -1;
  return +1;
}


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112d <sgn+0x2d>
jp     112d <sgn+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    114e <sgn+0x4e>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1147 <sgn+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <sgn+0x4e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setbe  %cl
xor    %eax,%eax
ucomisd %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sgn(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 -1, i32* %2
br label %12
11: ; preds = %7
store i32 1, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @sgn(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = select i1 %3, i32 -1, i32 1
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void bar() {
  {
    if (0) {
      abort();
    }
  };
}


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

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

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

LLVM IR (-O2):
define void @bar() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void t3() {
  struct {
    int a;
    struct {
      char b;
      int c;
    } y;
  } x;
  x.a = 61;
  x.y.b = 3;
  x.y.c = 3;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c",
          24, 67, x.a + x.y.b + x.y.c);
  ;
}


x86 assembly (clang, -O0):
<t3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3d,-0x10(%rbp)
movb   $0x3,-0xc(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x10(%rbp),%ecx
movsbl -0xc(%rbp),%eax
add    %eax,%ecx
add    -0x8(%rbp),%ecx
lea    0xec3(%rip),%rdi
mov    $0x18,%esi
mov    $0x43,%edx
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t3>:
lea    0xee9(%rip),%rdi
mov    $0x18,%esi
mov    $0x43,%edx
mov    $0x43,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
%struct.anon = type { i32, %struct.anon.0 }
%struct.anon.0 = type { i8, i32 }
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @t3() {
%1 = alloca %struct.anon
%2 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
store i32 61, i32* %2
%3 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 1
%4 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %3, i32 0, i32 0
store i8 3, i8* %4
%5 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 1
%6 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %5, i32 0, i32 1
store i32 3, i32* %6
%7 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 1
%10 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %9, i32 0, i32 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %8, %12
%14 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 1
%15 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %14, i32 0, i32 1
%16 = load i32, i32* %15
%17 = add nsw i32 %13, %16
%18 = call i32 @fexpect(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 24, i32 67, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @t3() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 24, i32 67, i32 67)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ externallyVisible(int *);
int /*<<< orphan*/ usesGlobalPtr();
int main() {
  int stack = 1;
  externallyVisible(&stack);
  usesGlobalPtr();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <externallyVisible@plt>
mov    $0x0,%al
call   1030 <usesGlobalPtr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <externallyVisible@plt>
xor    %eax,%eax
call   1030 <usesGlobalPtr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = call i32 @externallyVisible(i32* %2)
%4 = call i32 (...) @usesGlobalPtr()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @externallyVisible(i32* %1)
%4 = call i32 (...) @usesGlobalPtr()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *p, x = 10;
  p = &x;
  (*p)++;
  printf("%d \n", *p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xec1(%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    $0xb,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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

/* Variables and functions */
char feed_buf_write_character(struct feed_buf *const, char);
char feed_esc_write_prefix(struct feed_buf *const p_buf) {
  char b_result;
  b_result = feed_buf_write_character(p_buf, '\033');
  if (b_result) {
    b_result = feed_buf_write_character(p_buf, '[');
  }
  return b_result;
}


x86 assembly (clang, -O0):
<feed_esc_write_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1b,%esi
call   1030 <feed_buf_write_character@plt>
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
je     1148 <feed_esc_write_prefix+0x38>
mov    -0x8(%rbp),%rdi
mov    $0x5b,%esi
call   1030 <feed_buf_write_character@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feed_esc_write_prefix>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1b,%esi
call   1030 <feed_buf_write_character@plt>
test   %al,%al
je     1130 <feed_esc_write_prefix+0x20>
mov    %rbx,%rdi
mov    $0x5b,%esi
pop    %rbx
jmp    1030 <feed_buf_write_character@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.feed_buf = type { i32 }
define signext i8 @feed_esc_write_prefix(%struct.feed_buf* %0) {
%2 = alloca %struct.feed_buf*
%3 = alloca i8
store %struct.feed_buf* %0, %struct.feed_buf** %2
%4 = load %struct.feed_buf*, %struct.feed_buf** %2
%5 = call signext i8 @feed_buf_write_character(%struct.feed_buf* %4, i8 signext 27)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load %struct.feed_buf*, %struct.feed_buf** %2
%10 = call signext i8 @feed_buf_write_character(%struct.feed_buf* %9, i8 signext 91)
store i8 %10, i8* %3
br label %11
11: ; preds = %8, %1
%12 = load i8, i8* %3
ret i8 %12
}

LLVM IR (-O2):
%struct.feed_buf = type { i32 }
define signext i8 @feed_esc_write_prefix(%struct.feed_buf* %0) {
%2 = tail call signext i8 @feed_buf_write_character(%struct.feed_buf* %0, i8 signext 27)
%3 = icmp eq i8 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call signext i8 @feed_buf_write_character(%struct.feed_buf* %0, i8 signext 91)
br label %6
6: ; preds = %4, %1
%7 = phi i8 [ %5, %4 ], [ 0, %1 ]
ret i8 %7
}
void amsynth_lash_set_jack_client_name(const char *name) {}


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

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

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

LLVM IR (-O2):
define void @amsynth_lash_set_jack_client_name(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test57_SetFuncRefOnHost_targetTheHandler__I() {
  printf("target Handler called\n");
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"target Handler called\0A\00"
define void @test57_SetFuncRefOnHost_targetTheHandler__I() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"target Handler called\00"
define void @test57_SetFuncRefOnHost_targetTheHandler__I() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
void early_boot_irqs_on(void) {}


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

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

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

LLVM IR (-O2):
define void @early_boot_irqs_on() {
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
double some_func(double a) { return cos(a) + sin(a); }


x86 assembly (clang, -O0):
<some_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<some_func>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <cos@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @some_func(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @cos(double %3)
%5 = load double, double* %2
%6 = call double @sin(double %5)
%7 = fadd double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @some_func(double %0) {
%2 = tail call double @cos(double %0)
%3 = tail call double @sin(double %0)
%4 = fadd double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void print_char(int c, int n) {
  for (int i = 0; i < n; i++)
    putchar(c);
}


x86 assembly (clang, -O0):
<print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1147 <print_char+0x37>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <print_char+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112c <print_char+0x1c>
mov    %esi,%ebx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_char+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @print_char(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 = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %3
%12 = call i32 @putchar(i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @print_char(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @putchar(i32 %0)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %4, label %5
}
int cmpint(int *left, int *right) { return (*left - *right); }


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

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

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

LLVM IR (-O2):
define i32 @cmpint(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = sub nsw i32 %3, %4
ret i32 %5
}
void usleep(unsigned char usec) {
  do {
    asm volatile("nop");
  } while (--usec);
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
nop
mov    -0x1(%rbp),%al
add    $0xff,%al
mov    %al,-0x1(%rbp)
cmp    $0x0,%al
jne    110a <usleep+0xa>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
nop
add    $0xff,%dil
jne    1100 <usleep>
ret

LLVM IR (-O0):
define void @usleep(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %4, %1
br label %4
4: ; preds = %3
%5 = load i8, i8* %2
%6 = add i8 %5, -1
store i8 %6, i8* %2
%7 = icmp ne i8 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @usleep(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8 [ %0, %1 ], [ %4, %2 ]
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%4 = add i8 %3, -1
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
/* Variables and functions */
char tolower(char);
void str_to_lower(char *str) {
  while (*str) {
    (*str) = tolower(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<str_to_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <str_to_lower+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <str_to_lower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @str_to_lower(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 @tolower(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
}
int getCurrentTime() {}


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

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

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

LLVM IR (-O2):
define i32 @getCurrentTime() {
ret i32 undef
}
void gtk_ruler_set_metric() {}


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

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

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

LLVM IR (-O2):
define void @gtk_ruler_set_metric() {
ret void
}
/* Type definitions */
typedef size_t uint32_t;
typedef size_t int32_t;

/* Variables and functions */
int32_t find_symbol(char *buff, char byte, uint32_t size) {
  uint32_t i;
  for (i = 0; i < size; i++) {
    if (buff[i] == byte) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<find_symbol>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1163 <find_symbol+0x63>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114d <find_symbol+0x4d>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <find_symbol+0x6b>
jmp    1152 <find_symbol+0x52>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    111a <find_symbol+0x1a>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_symbol>:
mov    $0xffffffffffffffff,%rax
test   %rdx,%rdx
je     111f <find_symbol+0x1f>
xor    %ecx,%ecx
xchg   %ax,%ax
cmp    %sil,(%rdi,%rcx,1)
je     1120 <find_symbol+0x20>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <find_symbol+0x10>
ret
mov    %rcx,%rax
ret

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

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


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

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

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

LLVM IR (-O2):
define void @avio_wl16() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay_x();
int /*<<< orphan*/ led_init();
int /*<<< orphan*/ led_off();
int /*<<< orphan*/ led_on();
int /*<<< orphan*/ status_off();
int /*<<< orphan*/ status_on();
void blink(void) {
  led_init();
  for (;;) {
    led_off();
    status_on();
    delay_x();
    led_on();
    status_off();
    delay_x();
  }
}


x86 assembly (clang, -O0):
<blink>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <led_init@plt>
mov    $0x0,%al
call   1040 <led_off@plt>
mov    $0x0,%al
call   1070 <status_on@plt>
mov    $0x0,%al
call   1030 <delay_x@plt>
mov    $0x0,%al
call   1060 <led_on@plt>
mov    $0x0,%al
call   1080 <status_off@plt>
mov    $0x0,%al
call   1030 <delay_x@plt>
jmp    116b <blink+0xb>

x86 assembly (clang, -O2):
<blink>:
push   %rax
xor    %eax,%eax
call   1050 <led_init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <led_off@plt>
xor    %eax,%eax
call   1070 <status_on@plt>
xor    %eax,%eax
call   1030 <delay_x@plt>
xor    %eax,%eax
call   1060 <led_on@plt>
xor    %eax,%eax
call   1080 <status_off@plt>
xor    %eax,%eax
call   1030 <delay_x@plt>
jmp    1170 <blink+0x10>

LLVM IR (-O0):
define void @blink() {
%1 = call i32 (...) @led_init()
br label %2
2: ; preds = %2, %0
%3 = call i32 (...) @led_off()
%4 = call i32 (...) @status_on()
%5 = call i32 (...) @delay_x()
%6 = call i32 (...) @led_on()
%7 = call i32 (...) @status_off()
%8 = call i32 (...) @delay_x()
br label %2
}

LLVM IR (-O2):
define void @blink() {
%1 = tail call i32 (...) @led_init()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @led_off()
%4 = tail call i32 (...) @status_on()
%5 = tail call i32 (...) @delay_x()
%6 = tail call i32 (...) @led_on()
%7 = tail call i32 (...) @status_off()
%8 = tail call i32 (...) @delay_x()
br label %2
}
void hls_macc(int a, int b, int *accum, _Bool accum_clr) {
#pragma HLS INTERFACE s_axilite port = return bundle = HLS_MACC_PERIPH_BUS
#pragma HLS INTERFACE s_axilite port = &a bundle = HLS_MACC_PERIPH_BUS
#pragma HLS INTERFACE s_axilite port = &b bundle = HLS_MACC_PERIPH_BUS
#pragma HLS INTERFACE s_axilite port = &accum bundle = HLS_MACC_PERIPH_BUS
#pragma HLS INTERFACE s_axilite port = &accum_clr bundle = HLS_MACC_PERIPH_BUS
  static acc_reg = 0;
  if (accum_clr)
    acc_reg = 0;
  acc_reg += a * b;
  *accum = acc_reg;
}


x86 assembly (clang, -O0):
<hls_macc>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
and    $0x1,%al
mov    %al,-0x11(%rbp)
testb  $0x1,-0x11(%rbp)
je     1129 <hls_macc+0x29>
movl   $0x0,0x2efb(%rip)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    0x2eee(%rip),%eax
mov    %eax,0x2ee8(%rip)
mov    0x2ee2(%rip),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hls_macc>:
xor    %eax,%eax
test   %ecx,%ecx
jne    110c <hls_macc+0xc>
mov    0x2f18(%rip),%eax
imul   %edi,%esi
add    %eax,%esi
mov    %esi,0x2f0d(%rip)
mov    %esi,(%rdx)
ret

LLVM IR (-O0):
@hls_macc.acc_reg = internal global i32 0
define void @hls_macc(i32 %0, i32 %1, i32* %2, i1 zeroext %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%9 = zext i1 %3 to i8
store i8 %9, i8* %8
%10 = load i8, i8* %8
%11 = trunc i8 %10 to i1
br i1 %11, label %12, label %13
12: ; preds = %4
store i32 0, i32* @hls_macc.acc_reg
br label %13
13: ; preds = %12, %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* @hls_macc.acc_reg
%18 = add nsw i32 %17, %16
store i32 %18, i32* @hls_macc.acc_reg
%19 = load i32, i32* @hls_macc.acc_reg
%20 = load i32*, i32** %7
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
@hls_macc.acc_reg = internal unnamed_addr global i32 0
define void @hls_macc(i32 %0, i32 %1, i32* nocapture writeonly %2, i1 zeroext %3) {
%5 = load i32, i32* @hls_macc.acc_reg
%6 = select i1 %3, i32 0, i32 %5
%7 = mul nsw i32 %1, %0
%8 = add nsw i32 %6, %7
store i32 %8, i32* @hls_macc.acc_reg
store i32 %8, i32* %2
ret void
}
int efx_init_debugfs_netdev(struct net_device *net_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.net_device = type opaque
define i32 @efx_init_debugfs_netdev(%struct.net_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cdoFinish();
int /*<<< orphan*/ cdoInitialize(void *);
void *Test2(void *argument) {
  cdoInitialize(argument);
  cdoFinish();
  return (0);
}


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

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

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

LLVM IR (-O2):
define noalias i8* @Test2(i8* %0) {
%2 = tail call i32 @cdoInitialize(i8* %0)
%3 = tail call i32 (...) @cdoFinish()
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void log_and_exit(const char *error) {
  perror(error);
  exit(1);
}


x86 assembly (clang, -O0):
<log_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<log_and_exit>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @log_and_exit(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *strrchr(char *, char);
char *basen(char *s) {
  char *p = strrchr(s, '/');
  if (p)
    return p + 1;
  return s;
}


x86 assembly (clang, -O0):
<basen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <basen+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <basen+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basen>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @basen(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void set_white(uint8_t *bw, int i) { bw[i / 8] &= ~(1 << i % 8); }


x86 assembly (clang, -O0):
<set_white>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_white>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0xfffffffe,%eax
rol    %cl,%eax
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
and    %eax,(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @set_white(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = srem i32 %5, 8
%7 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = sdiv i32 %10, 8
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
%15 = and i32 %14, %8
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @set_white(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl nuw nsw i32 1, %3
%5 = xor i32 %4, -1
%6 = sdiv i32 %1, 8
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = and i32 %9, %5
store i32 %10, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wFree(char *);
int /*<<< orphan*/ wNotYet(char *);
char *wPopString();
void wBasRmDir() {
  char *name;
  name = wPopString();
  wNotYet("RmDir");
  wFree(name);
}


x86 assembly (clang, -O0):
<wBasRmDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <wPopString@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb6(%rip),%rdi
call   1040 <wNotYet@plt>
mov    -0x8(%rbp),%rdi
call   1050 <wFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasRmDir>:
push   %rbx
xor    %eax,%eax
call   1030 <wPopString@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
call   1040 <wNotYet@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <wFree@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"RmDir\00"
define void @wBasRmDir() {
%1 = alloca i8*
%2 = call i8* (...) @wPopString()
store i8* %2, i8** %1
%3 = call i32 @wNotYet(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = call i32 @wFree(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"RmDir\00"
define void @wBasRmDir() {
%1 = tail call i8* (...) @wPopString()
%2 = tail call i32 @wNotYet(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @wFree(i8* %1)
ret void
}
int msm_rtb_enabled(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @msm_rtb_enabled() {
ret i32 0
}

LLVM IR (-O2):
define i32 @msm_rtb_enabled() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
void *blank_runner(void *param) { pthread_exit(0); }


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

x86 assembly (clang, -O2):
<blank_runner>:
xor    %edi,%edi
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define noalias i8* @blank_runner(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_exit(i32 0)
ret i8* undef
}
void bitmap_print_sb(struct bitmap *bitmap) { return; }


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

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

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

LLVM IR (-O2):
%struct.bitmap = type opaque
define void @bitmap_print_sb(%struct.bitmap* nocapture %0) {
ret void
}
/* Variables and functions */
int strToInt(char *);
int progArguments(char **argStrings, int argAmount) {
  int gridSize;
  if (1 == argAmount) {
    gridSize = 20;
  } else if (2 == argAmount) {
    gridSize = strToInt(argStrings[1]);
  }
  return gridSize;
}


x86 assembly (clang, -O0):
<progArguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%eax
cmp    -0xc(%rbp),%eax
jne    1139 <progArguments+0x29>
movl   $0x14,-0x10(%rbp)
jmp    115c <progArguments+0x4c>
mov    $0x2,%eax
cmp    -0xc(%rbp),%eax
jne    1157 <progArguments+0x47>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strToInt@plt>
mov    %eax,-0x10(%rbp)
jmp    115c <progArguments+0x4c>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<progArguments>:
cmp    $0x2,%esi
jne    111e <progArguments+0xe>
mov    0x8(%rdi),%rdi
jmp    1030 <strToInt@plt>
mov    $0x14,%eax
ret

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

LLVM IR (-O2):
define i32 @progArguments(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %0, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strToInt(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 20, %2 ]
ret i32 %9
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ getchar6();
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char *argv[]) {
  printf("%c %d\n", EOF, EOF);
  getchar6();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar6@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%c %d\0A\00"
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EOF
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %3)
%5 = tail call i32 (...) @getchar6()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xa5() {
  Assert_real((isxdigit(165) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              830, ("isxdigit should be 0 for 0xa5"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xa5>:
push   %rax
mov    $0xa5,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x33e,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xa5\00"
define void @t_isxdigit_0xa5() {
%1 = call i64 @isxdigit(i32 165)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 830, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xa5\00"
define void @t_isxdigit_0xa5() {
%1 = tail call i64 @isxdigit(i32 165)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 830, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
const char *pr_tunnel(const char *ptr) { return (""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @pr_tunnel(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @pr_tunnel(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M350_f(char *s) {
  debug("M350_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

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

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

LLVM IR (-O2):
@.str = [47 x i8] c"M350_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M350_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
unsigned long LoadBLP2(char *destBuf, char *srcBuf, long *width, long *height) {
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @LoadBLP2(i8* %0, i8* %1, i64* %2, i64* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64*
%8 = alloca i64*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64* %2, i64** %7
store i64* %3, i64** %8
ret i64 0
}

LLVM IR (-O2):
define i64 @LoadBLP2(i8* nocapture readnone %0, i8* nocapture readnone %1, i64* nocapture readnone %2, i64* nocapture readnone %3) {
ret i64 0
}