xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgldla(int n) { ngen("%s\tax,[bp%+d]", "lea", n); }


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

x86 assembly (clang, -O2):
<cgldla>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%s\09ax,[bp%+d]\00"
@.str.1 = [4 x i8] c"lea\00"
define void @cgldla(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s\09ax,[bp%+d]\00"
@.str.1 = [4 x i8] c"lea\00"
define void @cgldla(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct uv__epoll_event {
  int dummy;
};
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int _NSIG;
int syscall(int, int, struct uv__epoll_event *, int, int,
            int /*<<< orphan*/ const *, int);
int uv__epoll_pwait(int epfd, struct uv__epoll_event *events, int nevents,
                    int timeout, const sigset_t *sigmask) {
  return syscall(281, epfd, events, nevents, timeout, sigmask, _NSIG / 8);
}


x86 assembly (clang, -O0):
<uv__epoll_pwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    $0x8,%edi
cltd
idiv   %edi
mov    -0x28(%rbp),%rdx
mov    $0x119,%edi
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv__epoll_pwait>:
push   %rax
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ecb(%rip),%rax
mov    (%rax),%eax
lea    0x7(%rax),%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x3,%edi
mov    %edi,(%rsp)
mov    $0x119,%edi
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.uv__epoll_event = type { i32 }
@_NSIG = global i32 0
define i32 @uv__epoll_pwait(i32 %0, %struct.uv__epoll_event* %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca %struct.uv__epoll_event*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
store i32 %0, i32* %6
store %struct.uv__epoll_event* %1, %struct.uv__epoll_event** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load %struct.uv__epoll_event*, %struct.uv__epoll_event** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32*, i32** %10
%16 = load i32, i32* @_NSIG
%17 = sdiv i32 %16, 8
%18 = call i32 @syscall(i32 281, i32 %11, %struct.uv__epoll_event* %12, i32 %13, i32 %14, i32* %15, i32 %17)
ret i32 %18
}

LLVM IR (-O2):
%struct.uv__epoll_event = type { i32 }
@_NSIG = global i32 0
define i32 @uv__epoll_pwait(i32 %0, %struct.uv__epoll_event* %1, i32 %2, i32 %3, i32* %4) {
%6 = load i32, i32* @_NSIG
%7 = sdiv i32 %6, 8
%8 = tail call i32 @syscall(i32 281, i32 %0, %struct.uv__epoll_event* %1, i32 %2, i32 %3, i32* %4, i32 %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int quit(void) { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @quit() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = call i32 @exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @quit() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ch8_STR_RPL() { printf("Error: ch8_STR_RPL not yet implemented\n"); }


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

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

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

LLVM IR (-O2):
@str = [39 x i8] c"Error: ch8_STR_RPL not yet implemented\00"
define void @ch8_STR_RPL() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, size_t);
void oom(size_t size) { die("OOM when allocating %ul bytes\n", size); }


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

x86 assembly (clang, -O2):
<oom>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <die@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"OOM when allocating %ul bytes\0A\00"
define void @oom(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @die(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %3)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"OOM when allocating %ul bytes\0A\00"
define void @oom(i64 %0) {
%2 = tail call i32 @die(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int average, grades[3];
  grades[0] = 80;
  grades[1] = 85;
  grades[2] = 90;
  average = (grades[0] + grades[1] + grades[2]) / 3;
  printf("The average of the 3 grades is: %d", average);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x50,-0x14(%rbp)
movl   $0x55,-0x10(%rbp)
movl   $0x5a,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"The average of the 3 grades is: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [3 x i32]
store i32 0, i32* %1
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32 80, i32* %4
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
store i32 85, i32* %5
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
store i32 90, i32* %6
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
%13 = load i32, i32* %12
%14 = add nsw i32 %11, %13
%15 = sdiv i32 %14, 3
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"The average of the 3 grades is: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 85)
ret i32 0
}
void lib3ds_vector_zero(float c[3]) {
  int i;
  for (i = 0; i < 3; ++i) {
    c[i] = 0.0f;
  }
}


x86 assembly (clang, -O0):
<lib3ds_vector_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1137 <lib3ds_vector_zero+0x37>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <lib3ds_vector_zero+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib3ds_vector_zero>:
movl   $0x0,0x8(%rdi)
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @lib3ds_vector_zero(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 3
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load float*, float** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds float, float* %8, i64 %10
store float 0.000000e+00, float* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @lib3ds_vector_zero(float* nocapture writeonly %0) {
%2 = bitcast float* %0 to i8*
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t usys_ntohs(uint16_t n) { return ntohs(n); }


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

x86 assembly (clang, -O2):
<usys_ntohs>:
jmp    1030 <ntohs@plt>

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

LLVM IR (-O2):
define i32 @usys_ntohs(i32 %0) {
%2 = tail call i32 @ntohs(i32 %0)
ret i32 %2
}
void unsigned_char_sub_signed_char_signed_char(unsigned char *LHS,
                                               signed char RHS) {
  (*LHS) -= RHS;
}


x86 assembly (clang, -O0):
<unsigned_char_sub_signed_char_signed_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
sub    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_char_sub_signed_char_signed_char>:
sub    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @unsigned_char_sub_signed_char_signed_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = sub nsw i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @unsigned_char_sub_signed_char_signed_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = sub i8 %3, %1
store i8 %4, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setUnblockOption(int, int);
void sockBlockingOff(int sock) { setUnblockOption(sock, 1); }


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

x86 assembly (clang, -O2):
<sockBlockingOff>:
mov    $0x1,%esi
jmp    1030 <setUnblockOption@plt>

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

LLVM IR (-O2):
define void @sockBlockingOff(i32 %0) {
%2 = tail call i32 @setUnblockOption(i32 %0, i32 1)
ret void
}
/* Variables and functions */
scalar_t__ source_peekn(char *, int /*<<< orphan*/);
int source_peekc() {
  char c = 0;
  if (source_peekn(&c, 0) <= 0)
    return -1;
  return (unsigned int)(unsigned char)c;
}


x86 assembly (clang, -O0):
<source_peekc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x5(%rbp)
lea    -0x5(%rbp),%rdi
xor    %esi,%esi
call   1030 <source_peekn@plt>
cmp    $0x0,%rax
jg     113d <source_peekc+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1144 <source_peekc+0x34>
movzbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<source_peekc>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rdi
xor    %esi,%esi
call   1030 <source_peekn@plt>
test   %rax,%rax
movzbl 0x7(%rsp),%ecx
mov    $0xffffffff,%eax
cmovg  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @source_peekc() {
%1 = alloca i32
%2 = alloca i8
store i8 0, i8* %2
%3 = call i64 @source_peekn(i8* %2, i32 0)
%4 = icmp sle i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 -1, i32* %1
br label %9
6: ; preds = %0
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @source_peekc() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @source_peekn(i8* %1, i32 0)
%3 = icmp slt i64 %2, 1
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
double suba(double f, double g, int i) { return i ? f : g; }


x86 assembly (clang, -O0):
<suba>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     112a <suba+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1134 <suba+0x34>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<suba>:
test   %edi,%edi
je     1107 <suba+0x7>
movaps %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @suba(double %0, double %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, double %1, double %0
ret double %5
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Fibonacci de 25: %d\n", fib(25));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Fibonacci de 25: %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fib(i32 25)
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Fibonacci de 25: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @fib(i32 25)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int sf(const void *i, const void *j) {
  return strcmp(*(const char **)i, *(const char **)j);
}


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

x86 assembly (clang, -O2):
<sf>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @sf(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @sf(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void unbind_x(const double *x) { ; }


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

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

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

LLVM IR (-O2):
define void @unbind_x(double* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ isupper(char);
int isCorrectFormat(char c) {
  return (isupper(c) || c == ' ' || c == ',' || c == '?' || c == '$');
}


x86 assembly (clang, -O0):
<isCorrectFormat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isupper@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    117c <isCorrectFormat+0x6c>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     117c <isCorrectFormat+0x6c>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2c,%ecx
mov    %al,-0x2(%rbp)
je     117c <isCorrectFormat+0x6c>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3f,%ecx
mov    %al,-0x2(%rbp)
je     117c <isCorrectFormat+0x6c>
movsbl -0x1(%rbp),%eax
cmp    $0x24,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isCorrectFormat>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1127 <isCorrectFormat+0x17>
pop    %rbx
ret
cmp    $0x3f,%bl
ja     113f <isCorrectFormat+0x2f>
movzbl %bl,%ecx
movabs $0x8000100100000000,%rdx
bt     %rcx,%rdx
jb     1125 <isCorrectFormat+0x15>
xor    %eax,%eax
cmp    $0x24,%bl
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isCorrectFormat(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isupper(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %22, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 32
br i1 %9, label %22, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 44
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 63
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 36
br label %22
22: ; preds = %18, %14, %10, %6, %1
%23 = phi i1 [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isCorrectFormat(i8 signext %0) {
%2 = tail call i64 @isupper(i8 signext %0)
%3 = freeze i64 %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
switch i8 %0, label %6 [
i8 63, label %9
i8 44, label %9
i8 32, label %9
]
6: ; preds = %5
%7 = icmp eq i8 %0, 36
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %5, %5, %1, %6
%10 = phi i32 [ 1, %5 ], [ %8, %6 ], [ 1, %1 ], [ 1, %5 ], [ 1, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("vlad vlad!!!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"vlad vlad!!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_CAint32_mem(int *val) {
  return ((*val) & (0xCA << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CAint32_mem>:
testb  $0xca,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CAint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 202
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long long gcd(long long a1, long long a2) {
  long long last, res;
  res = a1 % a2;
  if (res == 0)
    return a2;
  while (res != 0) {
    last = res;
    a1 = a2;
    a2 = res;
    res = a1 % a2;
  }
  return last;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1132 <gcd+0x32>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <gcd+0x75>
jmp    1137 <gcd+0x37>
cmpq   $0x0,-0x28(%rbp)
je     116d <gcd+0x6d>
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,-0x28(%rbp)
jmp    1137 <gcd+0x37>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     111b <gcd+0x1b>
cqto
idiv   %rsi
test   %rdx,%rdx
jne    1140 <gcd+0x40>
jmp    1124 <gcd+0x24>
xor    %edx,%edx
div    %esi
test   %rdx,%rdx
jne    1140 <gcd+0x40>
mov    %rsi,%rax
ret
nopl   0x0(%rax,%rax,1)
mov    %rsi,%rax
cqto
idiv   %rcx
mov    %rcx,%rsi
test   %rdx,%rdx
je     1157 <gcd+0x57>
mov    %rdx,%rcx
mov    %rsi,%rax
or     %rdx,%rax
shr    $0x20,%rax
jne    1130 <gcd+0x30>
mov    %esi,%eax
xor    %edx,%edx
div    %ecx
jmp    1138 <gcd+0x38>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ %3, %2 ]
%7 = phi i64 [ %6, %5 ], [ %1, %2 ]
%8 = srem i64 %7, %6
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi i64 [ %1, %2 ], [ %6, %5 ]
ret i64 %11
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *findchildelement(struct node *, char *);
struct node *findchildelementwithnameattr(struct node *, char const *);
struct node *findparamidentifier(struct node *node, const char *name) {
  node = findchildelement(node, "ArgumentList");
  if (node)
    node = findchildelementwithnameattr(node, name);
  return node;
}


x86 assembly (clang, -O0):
<findparamidentifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec5(%rip),%rsi
call   1030 <findchildelement@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1160 <findparamidentifier+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <findchildelementwithnameattr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findparamidentifier>:
push   %rbx
mov    %rsi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <findchildelement@plt>
test   %rax,%rax
je     1141 <findparamidentifier+0x21>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <findchildelementwithnameattr@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [13 x i8] c"ArgumentList\00"
define %struct.node* @findparamidentifier(%struct.node* %0, i8* %1) {
%3 = alloca %struct.node*
%4 = alloca i8*
store %struct.node* %0, %struct.node** %3
store i8* %1, i8** %4
%5 = load %struct.node*, %struct.node** %3
%6 = call %struct.node* @findchildelement(%struct.node* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store %struct.node* %6, %struct.node** %3
%7 = load %struct.node*, %struct.node** %3
%8 = icmp ne %struct.node* %7, null
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load %struct.node*, %struct.node** %3
%11 = load i8*, i8** %4
%12 = call %struct.node* @findchildelementwithnameattr(%struct.node* %10, i8* %11)
store %struct.node* %12, %struct.node** %3
br label %13
13: ; preds = %9, %2
%14 = load %struct.node*, %struct.node** %3
ret %struct.node* %14
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [13 x i8] c"ArgumentList\00"
define %struct.node* @findparamidentifier(%struct.node* %0, i8* %1) {
%3 = tail call %struct.node* @findchildelement(%struct.node* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq %struct.node* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call %struct.node* @findchildelementwithnameattr(%struct.node* %3, i8* %1)
br label %7
7: ; preds = %5, %2
%8 = phi %struct.node* [ %6, %5 ], [ null, %2 ]
ret %struct.node* %8
}
/* Variables and functions */
int /*<<< orphan*/ l_message(int /*<<< orphan*/ *, char *);
void print_version(void) {
  l_message(NULL, "Lua 5.1 (work6)"
                  "  "
                  "Copyright (C) 1994-2005 Tecgraf, PUC-Rio");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
lea    0xee1(%rip),%rsi
call   1030 <l_message@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [58 x i8] c"Lua 5.1 (work6) Copyright (C) 1994-2005 Tecgraf, PUC-Rio\00"
define void @print_version() {
%1 = call i32 @l_message(i32* null, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"Lua 5.1 (work6) Copyright (C) 1994-2005 Tecgraf, PUC-Rio\00"
define void @print_version() {
%1 = tail call i32 @l_message(i32* null, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
print_ack_wait_timeout(int block_number) {
  printf("Timeout. Resending ACK with block number %d\n", block_number);
}


x86 assembly (clang, -O0):
<print_ack_wait_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ack_wait_timeout>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Timeout. Resending ACK with block number %d\0A\00"
define i32 @print_ack_wait_timeout(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [45 x i8] c"Timeout. Resending ACK with block number %d\0A\00"
define i32 @print_ack_wait_timeout(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
double f4_sum_two_double(double v1, double v2) {
  return ((double)(v1)) + ((double)(v2));
}


x86 assembly (clang, -O0):
<f4_sum_two_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_two_double>:
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @f4_sum_two_double(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _free_val_fn(void *data) { free(data); }


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

x86 assembly (clang, -O2):
<_free_val_fn>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_free_val_fn(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void __attribute__((format(printf, 1, 2)))
__mark_check_format(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @__mark_check_format(i8* nocapture %0, ...) {
ret void
}
void pcp_def_irq_metrics(struct activity *a) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_def_irq_metrics(%struct.activity* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(long double);
int __attribute__((no)) g(long double b) {
  f(b);
  return 0;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <f@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <f@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @g(x86_fp80 %0) {
%2 = tail call i32 @f(x86_fp80 %0)
ret i32 0
}
long min(long a, long b) { return (a < b ? a : b); }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <min+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: isfctl <device> erase <offset> <size>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
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 = [46 x i8] c"usage: isfctl <device> erase <offset> <size>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"usage: isfctl <device> erase <offset> <size>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ write_instr(int);
void eval_log_and(void) { write_instr(0x1E); }


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

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

LLVM IR (-O0):
define void @eval_log_and() {
%1 = call i32 @write_instr(i32 30)
ret void
}

LLVM IR (-O2):
define void @eval_log_and() {
%1 = tail call i32 @write_instr(i32 30)
ret void
}
/* Variables and functions */
unsigned int f(int);
int g(void) {
  unsigned i = f(6);
  return 3;
}


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

x86 assembly (clang, -O2):
<g>:
push   %rax
mov    $0x6,%edi
call   1030 <f@plt>
mov    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @g() {
%1 = alloca i32
%2 = call i32 @f(i32 6)
store i32 %2, i32* %1
ret i32 3
}

LLVM IR (-O2):
define i32 @g() {
%1 = tail call i32 @f(i32 6)
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  for (int i = 0; i < 256; i++) {
    printf("%i: %c\n", i, i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%i: %c\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 256
br i1 %6, label %1, label %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x69() {
  Assert_real((iscntrl(105) == 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_iscntrl.c",
              530, ("iscntrl should be 0 for i"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x69>:
push   %rax
mov    $0x69,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x212,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for i\00"
define void @t_iscntrl_0x69() {
%1 = call i64 @iscntrl(i32 105)
%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 530, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for i\00"
define void @t_iscntrl_0x69() {
%1 = tail call i64 @iscntrl(i32 105)
%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 530, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int CotyleNbMaille(void) { return 2000; }


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

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

LLVM IR (-O0):
define i32 @CotyleNbMaille() {
ret i32 2000
}

LLVM IR (-O2):
define i32 @CotyleNbMaille() {
ret i32 2000
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int, int, int);
int /*<<< orphan*/ stdout;
void mouse(int button, int state, int x, int y) {
  printf("mouse: %d %d %d %d\n", button, state, x, y);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<mouse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mouse>:
push   %rax
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"mouse: %d %d %d %d\0A\00"
@stdout = global i32 0
define void @mouse(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
void cleanup_kill_process(void *data) {
  int pid = *(int *)data;
  kill(-pid, SIGTERM);
}


x86 assembly (clang, -O0):
<cleanup_kill_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
sub    -0xc(%rbp),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup_kill_process>:
xor    %eax,%eax
sub    (%rdi),%eax
mov    0x2ecd(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGTERM = global i32 0
define void @cleanup_kill_process(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = sub nsw i32 0, %7
%9 = load i32, i32* @SIGTERM
%10 = call i32 @kill(i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define void @cleanup_kill_process(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = load i32, i32* @SIGTERM
%6 = tail call i32 @kill(i32 %4, i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int mq_send(int /*<<< orphan*/, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void my_mq_send(mqd_t mq, void *buffer, int len) {
  int error;
  error = mq_send(mq, (char *)buffer, len, 0);
  if (error) {
    perror("mq_send");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<my_mq_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <mq_send@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1176 <my_mq_send+0x46>
lea    0xe99(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_mq_send>:
push   %rax
xor    %ecx,%ecx
call   1030 <mq_send@plt>
test   %eax,%eax
jne    113e <my_mq_send+0xe>
pop    %rax
ret
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"mq_send\00"
define void @my_mq_send(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @mq_send(i32 %8, i8* %9, i32 %10, i32 0)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"mq_send\00"
define void @my_mq_send(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @mq_send(i32 %0, i8* %1, i32 %2, i32 0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char *);
char *strcat(char *dest, const char *src) {
  strcpy(dest + strlen(dest), src);
  return (dest);
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strcat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret i8* %0
}
/* Variables and functions */
int machdep_sys_wait4(int /*<<< orphan*/, int *, int, int *);
machdep_sys_wait3(int *b, int c, int *d) {
  return (machdep_sys_wait4(0, b, c, d));
}


x86 assembly (clang, -O0):
<machdep_sys_wait3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %edi,%edi
call   1030 <machdep_sys_wait4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<machdep_sys_wait3>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <machdep_sys_wait4@plt>

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

LLVM IR (-O2):
define i32 @machdep_sys_wait3(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32 @machdep_sys_wait4(i32 0, i32* %0, i32 %1, i32* %2)
ret i32 %4
}
void quantum_zero_stats(void) {}


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

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

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

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