xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isspace(int);
char *next_nonspace(const char *p) {
  while (*p != '\0' && isspace((int)*p))
    p++;
  return (char *)p;
}


x86 assembly (clang, -O0):
<next_nonspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <next_nonspace+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <next_nonspace+0x47>
jmp    1168 <next_nonspace+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <next_nonspace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_nonspace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <next_nonspace+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <next_nonspace+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <next_nonspace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @next_nonspace(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %12, %10 ], [ %2, %1 ]
%6 = phi i8* [ %11, %10 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @isspace(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %10, %1
%15 = phi i8* [ %0, %1 ], [ %11, %10 ], [ %6, %4 ]
ret i8* %15
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int __syscall_mkdir(char const *, int /*<<< orphan*/);
int mkdir(const char *pathname, mode_t mode) {
  return (__syscall_mkdir(pathname, mode));
}


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

x86 assembly (clang, -O2):
<mkdir>:
jmp    1030 <__syscall_mkdir@plt>

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

LLVM IR (-O2):
define i32 @mkdir(i8* %0, i32 %1) {
%3 = tail call i32 @__syscall_mkdir(i8* %0, i32 %1)
ret i32 %3
}
int block_sequence(int arg1, int arg2) {
  int c, d, e, f, g, h;
  c = arg1 + 1;
  d = arg2 - 1;
  goto B1;
B1:
  e = c + d;
  f = c - d;
  goto B2;
B2:
  g = (e + f) / 2;
  h = (e - f) / 2;
  return g + h;
}


x86 assembly (clang, -O0):
<block_sequence>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_sequence>:
lea    (%rdi,%rdi,1),%ecx
add    $0x2,%ecx
sar    %ecx
lea    (%rsi,%rsi,1),%eax
add    $0xfffffffe,%eax
sar    %eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @block_sequence(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %6
br label %15
15: ; preds = %2
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = add nsw i32 %16, %17
store i32 %18, i32* %7
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = sub nsw i32 %19, %20
store i32 %21, i32* %8
br label %22
22: ; preds = %15
%23 = load i32, i32* %7
%24 = load i32, i32* %8
%25 = add nsw i32 %23, %24
%26 = sdiv i32 %25, 2
store i32 %26, i32* %9
%27 = load i32, i32* %7
%28 = load i32, i32* %8
%29 = sub nsw i32 %27, %28
%30 = sdiv i32 %29, 2
store i32 %30, i32* %10
%31 = load i32, i32* %9
%32 = load i32, i32* %10
%33 = add nsw i32 %31, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @block_sequence(i32 %0, i32 %1) {
%3 = shl i32 %0, 1
%4 = add i32 %3, 2
%5 = sdiv i32 %4, 2
%6 = shl i32 %1, 1
%7 = add i32 %6, -2
%8 = sdiv i32 %7, 2
%9 = add nsw i32 %8, %5
ret i32 %9
}
/* Variables and functions */
void *recallocarray(void *, int, int, int);
void *CRYPTO_realloc_clean(void *ptr, int old_len, int num, const char *file,
                           int line) {
  if (num <= 0)
    return NULL;
  if (num < old_len)
    return NULL;
  return recallocarray(ptr, old_len, num, 1);
}


x86 assembly (clang, -O0):
<CRYPTO_realloc_clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     1141 <CRYPTO_realloc_clean+0x31>
movq   $0x0,-0x8(%rbp)
jmp    1172 <CRYPTO_realloc_clean+0x62>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115a <CRYPTO_realloc_clean+0x4a>
movq   $0x0,-0x8(%rbp)
jmp    1172 <CRYPTO_realloc_clean+0x62>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    $0x1,%ecx
call   1030 <recallocarray@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTO_realloc_clean>:
test   %edx,%edx
jle    1122 <CRYPTO_realloc_clean+0x12>
cmp    %esi,%edx
jl     1122 <CRYPTO_realloc_clean+0x12>
mov    $0x1,%ecx
jmp    1030 <recallocarray@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @CRYPTO_realloc_clean(i8* %0, i32 %1, i32 %2, i8* nocapture readnone %3, i32 %4) {
%6 = icmp slt i32 %2, 1
%7 = icmp slt i32 %2, %1
%8 = or i1 %6, %7
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i8* @recallocarray(i8* %0, i32 %1, i32 %2, i32 1)
br label %11
11: ; preds = %5, %9
%12 = phi i8* [ %10, %9 ], [ null, %5 ]
ret i8* %12
}
int add_more(int input) {
  static int one = 1;
  int two = 2;
  two += input;
  two += one;
  return two;
}


x86 assembly (clang, -O0):
<add_more>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2f03(%rip),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_more>:
lea    0x3(%rdi),%eax
ret

LLVM IR (-O0):
@add_more.one = internal global i32 1
define i32 @add_more(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %5, %4
store i32 %6, i32* %3
%7 = load i32, i32* @add_more.one
%8 = load i32, i32* %3
%9 = add nsw i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @add_more(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *const);
char *ft_get_viewer(char *const);
char *get_typed_fname(char const *);
const char *gv_get_viewer(const char path[]) {
  char *const typed_fname = get_typed_fname(path);
  const char *const viewer = ft_get_viewer(typed_fname);
  free(typed_fname);
  return viewer;
}


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

x86 assembly (clang, -O2):
<gv_get_viewer>:
push   %r14
push   %rbx
push   %rax
call   1040 <get_typed_fname@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <ft_get_viewer@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @gv_get_viewer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @get_typed_fname(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @ft_get_viewer(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
define i8* @gv_get_viewer(i8* %0) {
%2 = tail call i8* @get_typed_fname(i8* %0)
%3 = tail call i8* @ft_get_viewer(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i8* %3
}
char const *pubnub_uname(void) {
  return "Windows"
         "-PubNub-C-core%2F"
         "3.1.0";
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Windows-PubNub-C-core%2F3.1.0\00"
define i8* @pubnub_uname() {
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [30 x i8] c"Windows-PubNub-C-core%2F3.1.0\00"
define i8* @pubnub_uname() {
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
double sin(double);
double csinc(double n, double f) {
  if (n == 0)
    return f;
  else
    return sin(3.14159265358979323846 * n * f) / (3.14159265358979323846 * n);
}


x86 assembly (clang, -O0):
<csinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1149 <csinc+0x39>
jp     1149 <csinc+0x39>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1176 <csinc+0x66>
movsd  0xeaf(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movsd  0xe98(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csinc>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    1120 <csinc+0x10>
jp     1120 <csinc+0x10>
movaps %xmm1,%xmm0
ret
push   %rax
mulsd  0xed7(%rip),%xmm0
movsd  %xmm0,(%rsp)
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <sin@plt>
movapd %xmm0,%xmm1
divsd  (%rsp),%xmm1
add    $0x8,%rsp
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @csinc(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp oeq double %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %5
store double %9, double* %3
br label %19
10: ; preds = %2
%11 = load double, double* %4
%12 = fmul double 0x400921FB54442D18, %11
%13 = load double, double* %5
%14 = fmul double %12, %13
%15 = call double @sin(double %14)
%16 = load double, double* %4
%17 = fmul double 0x400921FB54442D18, %16
%18 = fdiv double %15, %17
store double %18, double* %3
br label %19
19: ; preds = %10, %8
%20 = load double, double* %3
ret double %20
}

LLVM IR (-O2):
define double @csinc(double %0, double %1) {
%3 = fcmp oeq double %0, 0.000000e+00
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = fmul double %0, 0x400921FB54442D18
%6 = fmul double %5, %1
%7 = tail call double @sin(double %6)
%8 = fdiv double %7, %5
br label %9
9: ; preds = %2, %4
%10 = phi double [ %8, %4 ], [ %1, %2 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("foo!\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"foo!\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addstr(char *);
curs_set(int on) { addstr(on ? "\e[?25h" : "\e[?25l"); }


x86 assembly (clang, -O0):
<curs_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
lea    0xee2(%rip),%rdi
lea    0xed4(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
call   1030 <addstr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curs_set>:
test   %edi,%edi
lea    0xeee(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <addstr@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25h\00"
@.str.1 = [7 x i8] c"\1B[?25l\00"
define i32 @curs_set(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%8 = call i32 @addstr(i8* %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25h\00"
@.str.1 = [7 x i8] c"\1B[?25l\00"
define i32 @curs_set(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @addstr(i8* %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  for (int i = 1; i < argc; ++i)
    puts(argv[i]);
  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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 1, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
int cc_test_bit(const unsigned long *bitmap, int entry) {
  int i, j, mask;
  i = (entry >> 5);
  j = entry & 31;
  mask = 1 << j;
  return (bitmap[i] & mask) ? 1 : 0;
}


x86 assembly (clang, -O0):
<cc_test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
movslq -0x18(%rbp),%rax
and    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_test_bit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sar    $0x5,%ecx
movslq %ecx,%rcx
movslq %eax,%rdx
xor    %eax,%eax
test   %rdx,(%rdi,%rcx,8)
setne  %al
ret

LLVM IR (-O0):
define i32 @cc_test_bit(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = ashr i32 %8, 5
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = and i32 %10, 31
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = shl i32 1, %12
store i32 %13, i32* %7
%14 = load i64*, i64** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i64, i64* %14, i64 %16
%18 = load i64, i64* %17
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = and i64 %18, %20
%22 = icmp ne i64 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 1, i32 0
ret i32 %24
}

LLVM IR (-O2):
define i32 @cc_test_bit(i64* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 5
%4 = and i32 %1, 31
%5 = shl nuw i32 1, %4
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i64, i64* %0, i64 %6
%8 = load i64, i64* %7
%9 = sext i32 %5 to i64
%10 = and i64 %8, %9
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void warning(void) {
  puts("you can use by :");
  puts("txt2bf -f </path/to/file>");
  puts("txt2bf -s <string>");
}


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

x86 assembly (clang, -O2):
<warning>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"you can use by :\00"
@.str.1 = [26 x i8] c"txt2bf -f </path/to/file>\00"
@.str.2 = [19 x i8] c"txt2bf -s <string>\00"
define void @warning() {
%1 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"you can use by :\00"
@.str.1 = [26 x i8] c"txt2bf -f </path/to/file>\00"
@.str.2 = [19 x i8] c"txt2bf -s <string>\00"
define void @warning() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void g(void) {}


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

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

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

LLVM IR (-O2):
define void @g() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dscal_(int *, double *, double *, int *);
int call_dscal(int n, double alpha, double *x, int incx) {
  dscal_(&n, &alpha, x, &incx);
  return 0;
}


x86 assembly (clang, -O0):
<call_dscal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdx
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rcx
call   1030 <dscal_@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_dscal>:
sub    $0x18,%rsp
mov    %rsi,%rax
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %edx,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
mov    %rax,%rdx
call   1030 <dscal_@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @call_dscal(i32 %0, double %1, double* %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store i32 %3, i32* %7
%8 = call i32 @dscal_(i32* %5, double* %6, double* %2, i32* %7)
ret i32 0
}
int test_imm_B6int64_lowword_reg(long long val) {
  return ((val) & (0xB6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B6int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 182
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int _Dmain(void) {
  asm("_Dmain_label: .globl _Dmain_label");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @_Dmain() {
tail call void asm sideeffect "_Dmain_label: .globl _Dmain_label", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
void finn_vec3_sub_vec3(float *result, float *lhs, float *rhs) {
  result[0] = lhs[0] - rhs[0];
  result[1] = lhs[1] - rhs[1];
  result[2] = lhs[2] - rhs[2];
}


x86 assembly (clang, -O0):
<finn_vec3_sub_vec3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<finn_vec3_sub_vec3>:
movss  (%rsi),%xmm0
subss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
subss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
subss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @finn_vec3_sub_vec3(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fsub float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %5
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %6
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fsub float %27, %30
%32 = load float*, float** %4
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @finn_vec3_sub_vec3(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fsub float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, int, int, int);
int pthread_self();
void *myfuc(void *parm) {
  int *par = (int *)parm;
  printf("thread id = %d, pid = %d, parm = %d\n", pthread_self(), (int)getpid(),
         *par);
  return NULL;
}


x86 assembly (clang, -O0):
<myfuc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfuc>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
mov    (%rbx),%ecx
lea    0xeb1(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"thread id = %d, pid = %d, parm = %d\0A\00"
define i8* @myfuc(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = call i32 (...) @pthread_self()
%7 = call i64 (...) @getpid()
%8 = trunc i64 %7 to i32
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8, i32 %10)
ret i8* null
}

LLVM IR (-O2):
@.str = [37 x i8] c"thread id = %d, pid = %d, parm = %d\0A\00"
define noalias i8* @myfuc(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 (...) @pthread_self()
%4 = tail call i64 (...) @getpid()
%5 = trunc i64 %4 to i32
%6 = load i32, i32* %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %6)
ret i8* null
}
/* Variables and functions */
int test_success();
int main() { return -test_success(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_success()
%2 = sub nsw i32 0, %1
ret i32 %2
}
int cmp_int(const void *vp, const void *vq) {
  int diff = *(int *)vp - *(int *)vq;
  return ((diff >= 0) ? ((diff > 0) ? +1 : 0) : -1);
}


x86 assembly (clang, -O0):
<cmp_int>:
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
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     113d <cmp_int+0x3d>
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
mov    %eax,-0x18(%rbp)
jmp    114a <cmp_int+0x4a>
mov    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    114a <cmp_int+0x4a>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = sub nsw i32 %8, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp sge i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %2
%16 = load i32, i32* %5
%17 = icmp sgt i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
br label %21
20: ; preds = %2
br label %21
21: ; preds = %20, %15
%22 = phi i32 [ %19, %15 ], [ -1, %20 ]
ret i32 %22
}

LLVM IR (-O2):
define i32 @cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = icmp sgt i32 %7, -1
%9 = icmp ne i32 %7, 0
%10 = zext i1 %9 to i32
%11 = select i1 %8, i32 %10, i32 -1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ EVLOOP_ONCE;
int /*<<< orphan*/ event_loop(int /*<<< orphan*/);
void av_wait(void) { event_loop(EVLOOP_ONCE); }


x86 assembly (clang, -O0):
<av_wait>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%edi
call   1030 <event_loop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_wait>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <event_loop@plt>

LLVM IR (-O0):
@EVLOOP_ONCE = global i32 0
define void @av_wait() {
%1 = load i32, i32* @EVLOOP_ONCE
%2 = call i32 @event_loop(i32 %1)
ret void
}

LLVM IR (-O2):
@EVLOOP_ONCE = global i32 0
define void @av_wait() {
%1 = load i32, i32* @EVLOOP_ONCE
%2 = tail call i32 @event_loop(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int, char *);
int /*<<< orphan*/ system(char *);
void mtd_write_bootloader(char *filename, int offset, int len) {
  char cmd[512];
  snprintf(cmd, 512, "/bin/mtd_write -o %d -l %d write %s Bootloader", offset,
           len, filename);
  printf("write bootloader");
  system(cmd);
  return;
}


x86 assembly (clang, -O0):
<mtd_write_bootloader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x8(%rbp),%r9
mov    $0x200,%esi
lea    0xe9d(%rip),%rdx
call   1050 <snprintf@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <system@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtd_write_bootloader>:
push   %rbx
sub    $0x200,%rsp
mov    %edx,%r8d
mov    %esi,%ecx
mov    %rdi,%r9
lea    0xeb9(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1050 <snprintf@plt>
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"/bin/mtd_write -o %d -l %d write %s Bootloader\00"
@.str.1 = [17 x i8] c"write bootloader\00"
define void @mtd_write_bootloader(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [512 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %4
%12 = call i32 @snprintf(i8* %8, i32 512, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%15 = call i32 @system(i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"/bin/mtd_write -o %d -l %d write %s Bootloader\00"
@.str.1 = [17 x i8] c"write bootloader\00"
define void @mtd_write_bootloader(i8* %0, i32 %1, i32 %2) {
%4 = alloca [512 x i8]
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 512, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i8* %0)
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @system(i8* %5)
ret void
}
/* Variables and functions */
size_t CMSG_LEN(size_t);
size_t us_cmsg_len(size_t s) { return CMSG_LEN(s); }


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

x86 assembly (clang, -O2):
<us_cmsg_len>:
jmp    1030 <CMSG_LEN@plt>

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

LLVM IR (-O2):
define i64 @us_cmsg_len(i64 %0) {
%2 = tail call i64 @CMSG_LEN(i64 %0)
ret i64 %2
}
int main(void) {
  int i;
  int j;
  i = 1;
  j = 2;
  return i + j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void bad_free(void) {
  fprintf(stderr, "Attempt to free unallocated closure");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Attempt to free unallocated closure\00"
define void @bad_free() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Attempt to free unallocated closure\00"
define void @bad_free() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xb3() {
  Assert_real((isprint(179) == 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_isprint.c",
              900, ("isprint should be 0 for 0xb3"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xb3>:
push   %rax
mov    $0xb3,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x384,%edx
pop    %rax
jmp    1040 <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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xb3\00"
define void @t_isprint_0xb3() {
%1 = call i64 @isprint(i32 179)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 900, i8* getelementptr inbounds ([29 x i8], [29 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xb3\00"
define void @t_isprint_0xb3() {
%1 = tail call i64 @isprint(i32 179)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 900, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char **b() {}


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

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

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

LLVM IR (-O2):
define noalias i8** @b() {
ret i8** undef
}
long sl_sl_test(long data) {
  printf("Entered %s:\n", __FUNCTION__);
  printf("Data In: %ld\n", data);
  printf("Exited  %s:\n", __FUNCTION__);
  return data;
}


x86 assembly (clang, -O0):
<sl_sl_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sl_sl_test>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%rdi
lea    0xee8(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Entered %s:\0A\00"
@__FUNCTION__.sl_sl_test = [11 x i8] c"sl_sl_test\00"
@.str.1 = [14 x i8] c"Data In: %ld\0A\00"
@.str.2 = [13 x i8] c"Exited %s:\0A\00"
define i64 @sl_sl_test(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.sl_sl_test, i64 0, i64 0))
%4 = load i64, i64* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i64 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.sl_sl_test, i64 0, i64 0))
%7 = load i64, i64* %2
ret i64 %7
}

LLVM IR (-O2):
@.str = [13 x i8] c"Entered %s:\0A\00"
@__FUNCTION__.sl_sl_test = [11 x i8] c"sl_sl_test\00"
@.str.1 = [14 x i8] c"Data In: %ld\0A\00"
@.str.2 = [13 x i8] c"Exited %s:\0A\00"
define i64 @sl_sl_test(i64 returned %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.sl_sl_test, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i64 %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.sl_sl_test, i64 0, i64 0))
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void rtpp_socket_getfd_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_socket@%p::getfd (rtpp_socket_getfd) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


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

x86 assembly (clang, -O2):
<rtpp_socket_getfd_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [79 x i8] c"Method rtpp_socket@%p::getfd (rtpp_socket_getfd) is invoked after destruction\0A\00"
define void @rtpp_socket_getfd_fin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [79 x i8] c"Method rtpp_socket@%p::getfd (rtpp_socket_getfd) is invoked after destruction\0A\00"
define void @rtpp_socket_getfd_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ rvs_overflow_imminent_signal();
void handle_overflow_imminent(int n, siginfo_t *si, void *_uc) {
  rvs_overflow_imminent_signal();
}


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

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

LLVM IR (-O0):
define void @handle_overflow_imminent(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = call i32 (...) @rvs_overflow_imminent_signal()
ret void
}

LLVM IR (-O2):
define void @handle_overflow_imminent(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @rvs_overflow_imminent_signal()
ret void
}
int foo(int b, int c) {
  int x;
  if (b)
    return x & c;
  else
    return 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1122 <foo+0x22>
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1129 <foo+0x29>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int _disable_interrupts();
int /*<<< orphan*/ _enable_interrupts(int);
int cngetc();
int /*<<< orphan*/ printk(char *);
void cnpause(void) {
  int c;
  int s = _disable_interrupts();
  printk("-- More? ");
  while ((c = cngetc()) == 0)
    ;
  printk("\r         \r");
  _enable_interrupts(s);
}


x86 assembly (clang, -O0):
<cnpause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <_disable_interrupts@plt>
mov    %eax,-0x8(%rbp)
lea    0xea7(%rip),%rdi
call   1030 <printk@plt>
mov    $0x0,%al
call   1050 <cngetc@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jne    1176 <cnpause+0x36>
jmp    115e <cnpause+0x1e>
lea    0xe8d(%rip),%rdi
call   1030 <printk@plt>
mov    -0x8(%rbp),%edi
call   1060 <_enable_interrupts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cnpause>:
push   %rbx
xor    %eax,%eax
call   1040 <_disable_interrupts@plt>
mov    %eax,%ebx
lea    0xeaf(%rip),%rdi
call   1030 <printk@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <cngetc@plt>
test   %eax,%eax
je     1160 <cnpause+0x20>
lea    0xe98(%rip),%rdi
call   1030 <printk@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <_enable_interrupts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"-- More? \00"
@.str.1 = [12 x i8] c"\0D \0D\00"
define void @cnpause() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @_disable_interrupts()
store i32 %3, i32* %2
%4 = call i32 @printk(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %8, %0
%6 = call i32 (...) @cngetc()
store i32 %6, i32* %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
br label %5
9: ; preds = %5
%10 = call i32 @printk(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = call i32 @_enable_interrupts(i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"-- More? \00"
@.str.1 = [12 x i8] c"\0D \0D\00"
define void @cnpause() {
%1 = tail call i32 (...) @_disable_interrupts()
%2 = tail call i32 @printk(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
%4 = tail call i32 (...) @cngetc()
%5 = icmp eq i32 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = tail call i32 @printk(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @_enable_interrupts(i32 %1)
ret void
}