xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t op_gt(uint32_t a, uint32_t b) { return a > b; }


x86 assembly (clang, -O0):
<op_gt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_gt>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @op_gt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @op_gt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putc_k(int /*<<< orphan*/);
void puts_k(char *str) {
  while (*str)
    putc_k(*str++);
}


x86 assembly (clang, -O0):
<puts_k>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <puts_k+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putc_k@plt>
jmp    111c <puts_k+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @puts_k(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putc_k(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void __attribute__((no, noclone)) dirtify_stack(void) {
  volatile char a[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                      "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                      "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                      "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
}


x86 assembly (clang, -O0):
<dirtify_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
lea    -0xe0(%rbp),%rdi
lea    0xed7(%rip),%rsi
mov    $0xdd,%edx
call   1030 <memcpy@plt>
add    $0xe0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.dirtify_stack.a = [221 x i8] c"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\00"
define void @dirtify_stack() {
%1 = alloca [221 x i8]
%2 = bitcast [221 x i8]* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @dirtify_stack() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void fazAlgoETermina() {
  while (1 == 1) {
  }
  exit(0);
}


x86 assembly (clang, -O0):
<fazAlgoETermina>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <fazAlgoETermina+0x9>
jmp    1109 <fazAlgoETermina+0x9>

x86 assembly (clang, -O2):
<fazAlgoETermina>:
jmp    1100 <fazAlgoETermina>

LLVM IR (-O0):
define void @fazAlgoETermina() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @fazAlgoETermina() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int a_cas(int volatile *, int, unsigned int);
int a_fetch_add(volatile int *p, int v) {
  int old;
  do
    old = *p;
  while (a_cas(p, old, (unsigned)old + v) != old);
  return old;
}


x86 assembly (clang, -O0):
<a_fetch_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
add    -0xc(%rbp),%edx
call   1030 <a_cas@plt>
cmp    -0x10(%rbp),%eax
jne    111f <a_fetch_add+0xf>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_fetch_add>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r15
nopl   0x0(%rax,%rax,1)
mov    (%r15),%ebx
lea    (%rbx,%r14,1),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <a_cas@plt>
cmp    %ebx,%eax
jne    1120 <a_fetch_add+0x10>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @a_fetch_add(i32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = load volatile i32, i32* %0
%5 = add i32 %4, %1
%6 = tail call i32 @a_cas(i32* %0, i32 %4, i32 %5)
%7 = icmp eq i32 %6, %4
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ emit(int /*<<< orphan*/, void *);
void emit_string(const char *s, void *data) {
  while (*s)
    emit(*s++, data);
}


x86 assembly (clang, -O0):
<emit_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <emit_string+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <emit@plt>
jmp    1120 <emit_string+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_string>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <emit_string+0x36>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <emit@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <emit_string+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @emit_string(i8* nocapture %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @emit(i32 %9, i8* %1)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freestr(char *dynstr) { free(dynstr); }


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

LLVM IR (-O0):
define void @freestr(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 @freestr(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int current_setting(char *);
int current_csum() {
  return current_setting("/proc/sys/net/mptcp/mptcp_checksum");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"/proc/sys/net/mptcp/mptcp_checksum\00"
define i32 @current_csum() {
%1 = call i32 @current_setting(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [35 x i8] c"/proc/sys/net/mptcp/mptcp_checksum\00"
define i32 @current_csum() {
%1 = tail call i32 @current_setting(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
struct Multiarray_T {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_Multiarray_T_tol(struct Multiarray_T const *const,
                                          double);
void print_Multiarray_T(const struct Multiarray_T *const a) {
  print_Multiarray_T_tol(a, 1.0e-15);
}


x86 assembly (clang, -O0):
<print_Multiarray_T>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xed8(%rip),%xmm0
call   1030 <print_Multiarray_T_tol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_Multiarray_T>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <print_Multiarray_T_tol@plt>

LLVM IR (-O0):
%struct.Multiarray_T = type { i32 }
define void @print_Multiarray_T(%struct.Multiarray_T* %0) {
%2 = alloca %struct.Multiarray_T*
store %struct.Multiarray_T* %0, %struct.Multiarray_T** %2
%3 = load %struct.Multiarray_T*, %struct.Multiarray_T** %2
%4 = call i32 @print_Multiarray_T_tol(%struct.Multiarray_T* %3, double 1.000000e-15)
ret void
}

LLVM IR (-O2):
%struct.Multiarray_T = type { i32 }
define void @print_Multiarray_T(%struct.Multiarray_T* %0) {
%2 = tail call i32 @print_Multiarray_T_tol(%struct.Multiarray_T* %0, double 1.000000e-15)
ret void
}
int((hop_counter_receive))(struct ss7 *ss7, struct isup_call *c,
                           int messagetype, unsigned char *parm, int len) {
  return 1;
}


x86 assembly (clang, -O0):
<hop_counter_receive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @hop_counter_receive(%struct.ss7* %0, %struct.isup_call* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca %struct.ss7*
%7 = alloca %struct.isup_call*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store %struct.ss7* %0, %struct.ss7** %6
store %struct.isup_call* %1, %struct.isup_call** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret i32 1
}

LLVM IR (-O2):
%struct.ss7 = type opaque
%struct.isup_call = type opaque
define i32 @hop_counter_receive(%struct.ss7* nocapture readnone %0, %struct.isup_call* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32 %4) {
ret i32 1
}
void sowwakeup(so) struct SLIRPsocket *so;
{}


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

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

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

LLVM IR (-O2):
%struct.SLIRPsocket = type opaque
define void @sowwakeup(%struct.SLIRPsocket* nocapture %0) {
ret void
}
void someExitFunc() {
  int (*func)(void) = (int (*)(void))0x08003605;
  func();
}


x86 assembly (clang, -O0):
<someExitFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8003605,%eax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<someExitFunc>:
mov    $0x8003605,%eax
jmp    *%rax

LLVM IR (-O0):
define void @someExitFunc() {
%1 = alloca i32 ()*
store i32 ()* inttoptr (i64 134231557 to i32 ()*), i32 ()** %1
%2 = load i32 ()*, i32 ()** %1
%3 = call i32 %2()
ret void
}

LLVM IR (-O2):
define void @someExitFunc() {
%1 = tail call i32 inttoptr (i64 134231557 to i32 ()*)()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo3();
int main(void) {
  foo3();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo3()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __putch(char);
void putch(char c) {
  __putch(c);
  if (c == '\n')
    __putch('\r');
}


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <__putch@plt>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    113e <putch+0x2e>
mov    $0xd,%edi
call   1030 <__putch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
push   %rbx
mov    %edi,%ebx
call   1030 <__putch@plt>
cmp    $0xa,%bl
jne    1128 <putch+0x18>
mov    $0xd,%edi
pop    %rbx
jmp    1030 <__putch@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @putch(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @__putch(i8 signext %3)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 10
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @__putch(i8 signext 13)
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @putch(i8 signext %0) {
%2 = tail call i32 @__putch(i8 signext %0)
%3 = icmp eq i8 %0, 10
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @__putch(i8 signext 13)
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ __menuet__sys_exit();
int kill(pid_t pid, int sig) {
  if (pid == -1)
    __menuet__sys_exit();
}


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    112f <kill+0x1f>
mov    $0x0,%al
call   1030 <__menuet__sys_exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
cmp    $0xffffffff,%edi
je     1116 <kill+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <__menuet__sys_exit@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @kill(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @__menuet__sys_exit()
br label %6
6: ; preds = %4, %2
ret i32 undef
}
int gb18030_unicode_range_lookup(unsigned int unicode, unsigned char out[4]) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @gb18030_unicode_range_lookup(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ serial_iflush(int);
scalar_t__ serial_oflush(int);
int serial_ioflush(int handle) {
  return (serial_iflush(handle) && serial_oflush(handle) ? 1 : 0);
}


x86 assembly (clang, -O0):
<serial_ioflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <serial_iflush@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1157 <serial_ioflush+0x37>
mov    -0x4(%rbp),%edi
call   1030 <serial_oflush@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_ioflush>:
push   %rbx
mov    %edi,%ebx
call   1040 <serial_iflush@plt>
test   %rax,%rax
je     1141 <serial_ioflush+0x21>
mov    %ebx,%edi
call   1030 <serial_oflush@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @serial_ioflush(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @serial_iflush(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @serial_oflush(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @serial_ioflush(i32 %0) {
%2 = tail call i64 @serial_iflush(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @serial_oflush(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ clearPixel(int, int);
void clear_welcome_screen() {
  int i, j;
  for (i = 0; i < 35; i++) {
    for (j = 0; j < 5; j++) {
      clearPixel(25 + i, 12 + j);
    }
  }
}


x86 assembly (clang, -O0):
<clear_welcome_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x23,-0x4(%rbp)
jge    116c <clear_welcome_screen+0x5c>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1159 <clear_welcome_screen+0x49>
mov    -0x4(%rbp),%edi
add    $0x19,%edi
mov    -0x8(%rbp),%esi
add    $0xc,%esi
call   1030 <clearPixel@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <clear_welcome_screen+0x20>
jmp    115e <clear_welcome_screen+0x4e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <clear_welcome_screen+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_welcome_screen>:
push   %rbx
mov    $0x19,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    $0xc,%esi
call   1030 <clearPixel@plt>
mov    %ebx,%edi
mov    $0xd,%esi
call   1030 <clearPixel@plt>
mov    %ebx,%edi
mov    $0xe,%esi
call   1030 <clearPixel@plt>
mov    %ebx,%edi
mov    $0xf,%esi
call   1030 <clearPixel@plt>
mov    %ebx,%edi
mov    $0x10,%esi
call   1030 <clearPixel@plt>
add    $0x1,%ebx
cmp    $0x3c,%ebx
jne    1120 <clear_welcome_screen+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @clear_welcome_screen() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %9, %1 ]
%3 = add nuw nsw i32 %2, 25
%4 = tail call i32 @clearPixel(i32 %3, i32 12)
%5 = tail call i32 @clearPixel(i32 %3, i32 13)
%6 = tail call i32 @clearPixel(i32 %3, i32 14)
%7 = tail call i32 @clearPixel(i32 %3, i32 15)
%8 = tail call i32 @clearPixel(i32 %3, i32 16)
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 35
br i1 %10, label %11, label %1
11: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char letter;
  scanf("%c", &letter);
  char out = 'z' - letter + 'a';
  printf("%c\n", out);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
add    $0x61,%eax
mov    %al,-0x2(%rbp)
lea    0xeb3(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0x7(%rsp),%al
movsbl %al,%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int seis(int A, int B) {
  int result;
  result = A / B;
  printf("Resultado: %d", result);
  return (A % B);
}


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

x86 assembly (clang, -O2):
<seis>:
push   %rbx
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%ebx
lea    0xee1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Resultado: %d\00"
define i32 @seis(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sdiv i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
@.str = [14 x i8] c"Resultado: %d\00"
define i32 @seis(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = srem i32 %0, %1
ret i32 %5
}
int rl_tty_status(count, key)
int count __attribute__((unused)), key __attribute__((unused));
{
  rl_ding();
  return 0;
}


x86 assembly (clang, -O0):
<rl_tty_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rl_ding@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rl_tty_status(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rl_ding()
ret i32 0
}
unsigned char answer_7(unsigned char arg0, int arg1) {
  return (arg0 >> arg1) & 0b00000001;
}


x86 assembly (clang, -O0):
<answer_7>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<answer_7>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @answer_7(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = ashr i32 %6, %7
%9 = and i32 %8, 1
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @answer_7(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = lshr i32 %3, %1
%5 = trunc i32 %4 to i8
%6 = and i8 %5, 1
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ check_unsigned_ints(unsigned int, unsigned int, char *);
void check_unsigned_int(unsigned int actual, unsigned int expected) {
  check_unsigned_ints(actual, expected, "");
}


x86 assembly (clang, -O0):
<check_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0xed5(%rip),%rdx
call   1030 <check_unsigned_ints@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_unsigned_int>:
lea    0xee9(%rip),%rdx
jmp    1030 <check_unsigned_ints@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @check_unsigned_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @check_unsigned_ints(i32 %5, i32 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @check_unsigned_int(i32 %0, i32 %1) {
%3 = tail call i32 @check_unsigned_ints(i32 %0, i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
void X509V3_parse_list(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_parse_list() {
ret void
}
int xdr_void() { return ((1)); }


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

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

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

LLVM IR (-O2):
define i32 @xdr_void() {
ret i32 1
}
/* Variables and functions */
int shash_ly_update(int /*<<< orphan*/, char const *);
unsigned shash_ly(const char *buf) { return shash_ly_update(0, buf); }


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

x86 assembly (clang, -O2):
<shash_ly>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <shash_ly_update@plt>

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

LLVM IR (-O2):
define i32 @shash_ly(i8* %0) {
%2 = tail call i32 @shash_ly_update(i32 0, i8* %0)
ret i32 %2
}
int test_tagged_typedef_bitmask1(int val) { return val; }


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

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

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

LLVM IR (-O2):
define i32 @test_tagged_typedef_bitmask1(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/);
void traitement_signal(int sig) {
  printf("Signal %d reçu\n", sig);
  waitpid(0, NULL, WNOHANG);
}


x86 assembly (clang, -O0):
<traitement_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traitement_signal>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <waitpid@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Signal %d re\C3\A7u\0A\00"
@WNOHANG = global i32 0
define void @traitement_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @WNOHANG
%6 = call i32 @waitpid(i32 0, i32* null, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Signal %d re\C3\A7u\0A\00"
@WNOHANG = global i32 0
define void @traitement_signal(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @WNOHANG
%4 = tail call i32 @waitpid(i32 0, i32* null, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  if (2 != 2)
    abort();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test_imm_3Cuint8_mem(unsigned char *val) {
  return ((*val) & (0x3C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Cuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 60
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ perror(char *);
void *xcalloc(size_t number, size_t size) {
  void *p;
  if (!(p = calloc(number, size)))
    perror("Calloc");
  return (p);
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1157 <xcalloc+0x37>
lea    0xeae(%rip),%rdi
call   1040 <perror@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1133 <xcalloc+0x13>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xec6(%rip),%rdi
call   1040 <perror@plt>
jmp    112e <xcalloc+0xe>

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

LLVM IR (-O2):
@.str = [7 x i8] c"Calloc\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("GCD of %d and %d is %d ", a, b, gcd(a, b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <gcd@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    (%rsp),%ebp
mov    %ebx,%edi
mov    %ebp,%esi
call   1050 <gcd@plt>
lea    0xea7(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [24 x i8] c"GCD of %d and %d is %d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @gcd(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ inverseOrderPrint();
char *readFile(int /*<<< orphan*/ *);
int main(int argc, const char *argv[]) {
  FILE *infile;
  char *p;
  infile = fopen("/Users/MainasuK/Documents/Github/TASC/ch15/ex05_readFile/"
                 "ex05_readFile/prospero.txt",
                 "r");
  p = readFile(infile);
  inverseOrderPrint();
  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)
lea    0xeb3(%rip),%rdi
lea    0xf00(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <readFile@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <inverseOrderPrint@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xf15(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
call   1050 <readFile@plt>
xor    %eax,%eax
call   1030 <inverseOrderPrint@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [84 x i8] c"/Users/MainasuK/Documents/Github/TASC/ch15/ex05_readFile/ex05_readFile/prospero.txt\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32* @fopen(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = call i8* @readFile(i32* %9)
store i8* %10, i8** %7
%11 = call i32 (...) @inverseOrderPrint()
ret i32 0
}

LLVM IR (-O2):
@.str = [84 x i8] c"/Users/MainasuK/Documents/Github/TASC/ch15/ex05_readFile/ex05_readFile/prospero.txt\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i8* @readFile(i32* %3)
%5 = tail call i32 (...) @inverseOrderPrint()
ret i32 0
}
void fitfun_finalize() {}


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

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

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

LLVM IR (-O2):
define void @fitfun_finalize() {
ret void
}
void bottom_left(int end_windows) {}


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

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

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

LLVM IR (-O2):
define void @bottom_left(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lt_fatal(char *, int, char *);
scalar_t__ malloc(size_t);
void *xmalloc(size_t num) {
  void *p = (void *)malloc(num);
  if (!p)
    lt_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/HPDCS/libreverse/refs/heads/master/"
             "test/.libs/lt-test.c.c",
             314, "memory exhausted");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <xmalloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x13a,%esi
lea    0xf3d(%rip),%rdx
call   1030 <lt_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xmalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf58(%rip),%rdx
mov    $0x13a,%esi
call   1030 <lt_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/HPDCS/libreverse/refs/heads/master/test/.libs/lt-test.c.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @lt_fatal(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 314, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/HPDCS/libreverse/refs/heads/master/test/.libs/lt-test.c.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lt_fatal(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 314, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
int student_func(int arg) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @student_func(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
time_t tvTM2T(struct tm *ymdhms) { return (mktime(ymdhms)); }


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

x86 assembly (clang, -O2):
<tvTM2T>:
jmp    1030 <mktime@plt>

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @tvTM2T(%struct.tm* nocapture %0) {
%2 = tail call i32 @mktime(%struct.tm* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ curscr;
int /*<<< orphan*/ delwin(int /*<<< orphan*/);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ erase();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
int quit() {
  erase();
  refresh();
  endwin();
  delwin(curscr);
  delwin(stdscr);
  putchar('\n');
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <erase@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
mov    $0x0,%al
call   1070 <endwin@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1050 <delwin@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
call   1050 <delwin@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
xor    %eax,%eax
call   1040 <erase@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
xor    %eax,%eax
call   1070 <endwin@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
call   1050 <delwin@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1050 <delwin@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@curscr = global i32 0
@stdscr = global i32 0
define i32 @quit() {
%1 = call i32 (...) @erase()
%2 = call i32 (...) @refresh()
%3 = call i32 (...) @endwin()
%4 = load i32, i32* @curscr
%5 = call i32 @delwin(i32 %4)
%6 = load i32, i32* @stdscr
%7 = call i32 @delwin(i32 %6)
%8 = call i32 @putchar(i8 signext 10)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@curscr = global i32 0
@stdscr = global i32 0
define i32 @quit() {
%1 = tail call i32 (...) @erase()
%2 = tail call i32 (...) @refresh()
%3 = tail call i32 (...) @endwin()
%4 = load i32, i32* @curscr
%5 = tail call i32 @delwin(i32 %4)
%6 = load i32, i32* @stdscr
%7 = tail call i32 @delwin(i32 %6)
%8 = tail call i32 @putchar(i8 signext 10)
%9 = tail call i32 @exit(i32 0)
unreachable
}
void g_main_depth() {}


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

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

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

LLVM IR (-O2):
define void @g_main_depth() {
ret void
}
/* Variables and functions */
double fmod(double, double);
double sin(double const);
double noise(double x) {
  static const double prime = 9999999967.0;
  static const double half = 4999999983.5;
  return fmod((sin(fmod(x, 6.28318530717958647693) * prime) + 1.0) * half,
              2.0) -
         1.0;
}


x86 assembly (clang, -O0):
<noise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee6(%rip),%xmm1
call   1030 <fmod@plt>
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <sin@plt>
movsd  0xea8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xeac(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe98(%rip),%xmm1
call   1030 <fmod@plt>
movsd  0xe83(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<noise>:
push   %rax
movsd  0xed7(%rip),%xmm1
call   1030 <fmod@plt>
mulsd  0xed2(%rip),%xmm0
call   1040 <sin@plt>
addsd  0xecd(%rip),%xmm0
mulsd  0xecd(%rip),%xmm0
movsd  0xecd(%rip),%xmm1
call   1030 <fmod@plt>
addsd  0xec8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@noise.prime = internal constant double 0x4202A05F1EF80000
@noise.half = internal constant double 0x41F2A05F1EF80000
define double @noise(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @fmod(double %3, double 0x401921FB54442D18)
%5 = fmul double %4, 0x4202A05F1EF80000
%6 = call double @sin(double %5)
%7 = fadd double %6, 1.000000e+00
%8 = fmul double %7, 0x41F2A05F1EF80000
%9 = call double @fmod(double %8, double 2.000000e+00)
%10 = fsub double %9, 1.000000e+00
ret double %10
}

LLVM IR (-O2):
define double @noise(double %0) {
%2 = tail call double @fmod(double %0, double 0x401921FB54442D18)
%3 = fmul double %2, 0x4202A05F1EF80000
%4 = tail call double @sin(double %3)
%5 = fadd double %4, 1.000000e+00
%6 = fmul double %5, 0x41F2A05F1EF80000
%7 = tail call double @fmod(double %6, double 2.000000e+00)
%8 = fadd double %7, -1.000000e+00
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prog) {
  printf("usage: %s out.grib\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [20 x i8] c"usage: %s out.grib\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"usage: %s out.grib\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sdt(char *);
main() {
  char cha[30];
  sdt(cha);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
call   1030 <sdt@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1030 <sdt@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @sdt(i8* %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @sdt(i8* %2)
ret i32 0
}