xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ gluOrtho2D(int /*<<< orphan*/, int, int, int /*<<< orphan*/);
void reshape(int w, int h) {
  glViewport(0, 0, w, h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(0, w, h, 0);
  glMatrixMode(GL_MODELVIEW);
}


x86 assembly (clang, -O0):
<reshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
xor    %ecx,%ecx
mov    %ecx,%edi
call   1050 <gluOrtho2D@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reshape>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1060 <glViewport@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1040 <glLoadIdentity@plt>
xor    %edi,%edi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %ecx,%ecx
call   1050 <gluOrtho2D@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <glMatrixMode@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @reshape(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 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @gluOrtho2D(i32 0, i32 %11, i32 %12, i32 0)
%14 = load i32, i32* @GL_MODELVIEW
%15 = call i32 @glMatrixMode(i32 %14)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @reshape(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = tail call i32 @gluOrtho2D(i32 0, i32 %0, i32 %1, i32 0)
%8 = load i32, i32* @GL_MODELVIEW
%9 = tail call i32 @glMatrixMode(i32 %8)
ret void
}
char *rev_w(const char w[]) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @rev_w(i8* nocapture readnone %0) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void infop(char *mesg) { printf("\e[0;34m[i] %s\e[0m\n", mesg); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"\1B[0;34m[i] %s\1B[0m\0A\00"
define void @infop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\1B[0;34m[i] %s\1B[0m\0A\00"
define void @infop(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ B9600;
int /*<<< orphan*/ CS8;
scalar_t__ logitech_command(int, char *);
int /*<<< orphan*/ setline(int, int /*<<< orphan*/, int /*<<< orphan*/);
int mzp_init(int fd) {
  if (logitech_command(fd, "*X*q"))
    return -1;
  setline(fd, CS8, B9600);
  return 0;
}


x86 assembly (clang, -O0):
<mzp_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1030 <logitech_command@plt>
cmp    $0x0,%rax
je     1150 <mzp_init+0x30>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <mzp_init+0x51>
mov    -0x8(%rbp),%edi
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
mov    0x2e85(%rip),%rax
mov    (%rax),%edx
call   1040 <setline@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mzp_init>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rsi
call   1030 <logitech_command@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     113e <mzp_init+0x1e>
pop    %rbx
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
call   1040 <setline@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"*X*q\00"
@CS8 = global i32 0
@B9600 = global i32 0
define i32 @mzp_init(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @logitech_command(i32 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = load i32, i32* @CS8
%11 = load i32, i32* @B9600
%12 = call i32 @setline(i32 %9, i32 %10, i32 %11)
store i32 0, i32* %2
br label %13
13: ; preds = %8, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"*X*q\00"
@CS8 = global i32 0
@B9600 = global i32 0
define i32 @mzp_init(i32 %0) {
%2 = tail call i64 @logitech_command(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @CS8
%6 = load i32, i32* @B9600
%7 = tail call i32 @setline(i32 %0, i32 %5, i32 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
short bext_h(short *, short *, short *);
short intr_wrap_523(short p1, short p2, short p3) {
  return bext_h(&p1, &p2, &p3);
}


x86 assembly (clang, -O0):
<intr_wrap_523>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
lea    -0x2(%rbp),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x6(%rbp),%rdx
call   1030 <bext_h@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_523>:
push   %rax
mov    %di,0x6(%rsp)
mov    %si,0x4(%rsp)
mov    %dx,0x2(%rsp)
lea    0x6(%rsp),%rdi
lea    0x4(%rsp),%rsi
lea    0x2(%rsp),%rdx
call   1030 <bext_h@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @intr_wrap_523(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = call signext i16 @bext_h(i16* %4, i16* %5, i16* %6)
ret i16 %7
}

LLVM IR (-O2):
define signext i16 @intr_wrap_523(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = call signext i16 @bext_h(i16* %4, i16* %5, i16* %6)
ret i16 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int io_change(int fd, uint32_t events, int *val) {
  *val = fd;
  return 0;
}


x86 assembly (clang, -O0):
<io_change>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @io_change(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** %6
store i32 %7, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @io_change(i32 %0, i32 %1, i32* nocapture writeonly %2) {
store i32 %0, i32* %2
ret i32 0
}
char *skipwhite(q)
char *q;
{
  char *p = q;
  while (isspace(*p))
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skipwhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
je     114a <skipwhite+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <skipwhite+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipwhite>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %eax,%eax
jne    1120 <skipwhite+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipwhite(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = tail call i32 @isspace(i32 %5)
%7 = icmp eq i32 %6, 0
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
char getch();
char get_std_cmd() { return getch(); }


x86 assembly (clang, -O0):
<get_std_cmd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getch@plt>
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @get_std_cmd() {
%1 = call signext i8 (...) @getch()
ret i8 %1
}

LLVM IR (-O2):
define signext i8 @get_std_cmd() {
%1 = tail call signext i8 (...) @getch()
ret i8 %1
}
/* Type definitions */
struct atm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ date_time(struct atm *, struct atm *, int);
void date_tea(struct atm *tm, struct atm *now, int *num) {
  date_time(tm, now, 17);
}


x86 assembly (clang, -O0):
<date_tea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x11,%edx
call   1030 <date_time@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_tea>:
mov    $0x11,%edx
jmp    1030 <date_time@plt>

LLVM IR (-O0):
%struct.atm = type { i32 }
define void @date_tea(%struct.atm* %0, %struct.atm* %1, i32* %2) {
%4 = alloca %struct.atm*
%5 = alloca %struct.atm*
%6 = alloca i32*
store %struct.atm* %0, %struct.atm** %4
store %struct.atm* %1, %struct.atm** %5
store i32* %2, i32** %6
%7 = load %struct.atm*, %struct.atm** %4
%8 = load %struct.atm*, %struct.atm** %5
%9 = call i32 @date_time(%struct.atm* %7, %struct.atm* %8, i32 17)
ret void
}

LLVM IR (-O2):
%struct.atm = type { i32 }
define void @date_tea(%struct.atm* %0, %struct.atm* %1, i32* nocapture readnone %2) {
%4 = tail call i32 @date_time(%struct.atm* %0, %struct.atm* %1, i32 17)
ret void
}
/* Variables and functions */
char get_mem(int);
char uart_get() {
  while ((get_mem(0x20000000 + 0x00215054) & 0x1) == 0) {
  }
  return get_mem(0x20000000 + 0x00215040);
}


x86 assembly (clang, -O0):
<uart_get>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <uart_get+0x9>
mov    $0x20215054,%edi
call   1030 <get_mem@plt>
movsbl %al,%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1137 <uart_get+0x27>
jmp    1119 <uart_get+0x9>
mov    $0x20215040,%edi
call   1030 <get_mem@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_get>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20215054,%edi
call   1030 <get_mem@plt>
test   $0x1,%al
je     1120 <uart_get+0x10>
mov    $0x20215040,%edi
pop    %rax
jmp    1030 <get_mem@plt>

LLVM IR (-O0):
define signext i8 @uart_get() {
br label %1
1: ; preds = %6, %0
%2 = call signext i8 @get_mem(i32 539054164)
%3 = sext i8 %2 to i32
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = call signext i8 @get_mem(i32 539054144)
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @uart_get() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 @get_mem(i32 539054164)
%3 = and i8 %2, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = tail call signext i8 @get_mem(i32 539054144)
ret i8 %6
}
int __attribute__((no)) foo(int x) {
  if ((x != 0 && x != 13) || x == 5 || x == 20)
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111b <foo+0x1b>
cmpl   $0xd,-0x8(%rbp)
jne    112f <foo+0x2f>
cmpl   $0x5,-0x8(%rbp)
je     112f <foo+0x2f>
cmpl   $0x14,-0x8(%rbp)
jne    113b <foo+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <foo+0x42>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x1,%edi
sbb    %ecx,%ecx
or     $0x1,%ecx
cmp    $0xd,%edi
mov    $0xffffffff,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp eq i32 %0, 13
%3 = icmp eq i32 %0, 0
%4 = or i1 %2, %3
%5 = select i1 %4, i32 -1, i32 1
ret i32 %5
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
long long tkh_micros_from_timeval(const struct timeval *tv) {
  if (tv->tv_usec < 0)
    return -1;
  else
    return ((long long)tv->tv_sec) * 1000000 + tv->tv_usec;
}


x86 assembly (clang, -O0):
<tkh_micros_from_timeval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jge    1123 <tkh_micros_from_timeval+0x23>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    113a <tkh_micros_from_timeval+0x3a>
mov    -0x10(%rbp),%rax
imul   $0xf4240,0x8(%rax),%rax
mov    -0x10(%rbp),%rcx
add    (%rcx),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tkh_micros_from_timeval>:
mov    (%rdi),%rcx
test   %rcx,%rcx
js     1114 <tkh_micros_from_timeval+0x14>
imul   $0xf4240,0x8(%rdi),%rax
add    %rcx,%rax
ret
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @tkh_micros_from_timeval(%struct.timeval* %0) {
%2 = alloca i64
%3 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
%4 = load %struct.timeval*, %struct.timeval** %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i64 -1, i64* %2
br label %18
9: ; preds = %1
%10 = load %struct.timeval*, %struct.timeval** %3
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 1
%12 = load i64, i64* %11
%13 = mul nsw i64 %12, 1000000
%14 = load %struct.timeval*, %struct.timeval** %3
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 0
%16 = load i64, i64* %15
%17 = add nsw i64 %13, %16
store i64 %17, i64* %2
br label %18
18: ; preds = %9, %8
%19 = load i64, i64* %2
ret i64 %19
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @tkh_micros_from_timeval(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%7 = load i64, i64* %6
%8 = mul nsw i64 %7, 1000000
%9 = add nsw i64 %8, %3
br label %10
10: ; preds = %1, %5
%11 = phi i64 [ %9, %5 ], [ -1, %1 ]
ret i64 %11
}
func4(param) int param;
{ return param; }


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

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

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

LLVM IR (-O2):
define i32 @func4(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ lp_set_var(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void lp_set_last_activity(time_t timeval) {
  char val[32];
  sprintf(val, "%i", (int)timeval);
  lp_set_var(0, "_last_act", val);
}


x86 assembly (clang, -O0):
<lp_set_last_activity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xec3(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdx
xor    %edi,%edi
lea    0xeb4(%rip),%rsi
call   1030 <lp_set_var@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lp_set_last_activity>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rdx
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
lea    0xec2(%rip),%rsi
xor    %edi,%edi
mov    %rbx,%rdx
call   1030 <lp_set_var@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [10 x i8] c"_last_act\00"
define void @lp_set_last_activity(i64 %0) {
%2 = alloca i64
%3 = alloca [32 x i8]
store i64 %0, i64* %2
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = load i64, i64* %2
%6 = trunc i64 %5 to i32
%7 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%9 = call i32 @lp_set_var(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [10 x i8] c"_last_act\00"
define void @lp_set_last_activity(i64 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = trunc i64 %0 to i32
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @lp_set_var(i32 0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
int fun175() { return 175; }


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

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

LLVM IR (-O0):
define i32 @fun175() {
ret i32 175
}

LLVM IR (-O2):
define i32 @fun175() {
ret i32 175
}
int placeInArray(char val, char *arr, int size) {
  int i;
  for (i = 0; i < size; i++) {
    if (arr[i] == val)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<placeInArray>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115a <placeInArray+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1147 <placeInArray+0x47>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <placeInArray+0x61>
jmp    114c <placeInArray+0x4c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1118 <placeInArray+0x18>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<placeInArray>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    111f <placeInArray+0x1f>
mov    %edx,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmp    %dil,(%rsi,%rcx,1)
je     1120 <placeInArray+0x20>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <placeInArray+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @placeInArray(i8 signext %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
void RTStrAAppendNTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrAAppendNTag() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char foo(char parameter_1) {
  printf("Parameter address: %p\n", &parameter_1);
  return parameter_1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0xee3(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1030 <printf@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Parameter address: %p\0A\00"
define signext i8 @foo(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
ret i8 %4
}

LLVM IR (-O2):
@.str = [23 x i8] c"Parameter address: %p\0A\00"
define signext i8 @foo(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
ret i8 %4
}
int MR_getopt(argc, argv, optstring)
int argc;
char *const *argv;
const char *optstring;
{
  return MR__getopt_internal(argc, argv, optstring, (const struct MR_option *)0,
                             (int *)0, 0);
}


x86 assembly (clang, -O0):
<MR_getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
mov    $0x0,%al
call   1030 <MR__getopt_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MR_getopt>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
jmp    1030 <MR__getopt_internal@plt>

LLVM IR (-O0):
%struct.MR_option = type opaque
define i32 @MR_getopt(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %6
%10 = call i32 (i32, i8**, i8*, %struct.MR_option*, i32*, i32, ...) bitcast (i32 (...)* @MR__getopt_internal to i32 (i32, i8**, i8*, %struct.MR_option*, i32*, i32, ...)*)(i32 %7, i8** %8, i8* %9, %struct.MR_option* null, i32* null, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.MR_option = type opaque
define i32 @MR_getopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 (i32, i8**, i8*, %struct.MR_option*, i32*, i32, ...) bitcast (i32 (...)* @MR__getopt_internal to i32 (i32, i8**, i8*, %struct.MR_option*, i32*, i32, ...)*)(i32 %0, i8** %1, i8* %2, %struct.MR_option* null, i32* null, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug_puts(char const *);
void _d(const char *str) { debug_puts(str); }


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

x86 assembly (clang, -O2):
<_d>:
jmp    1030 <debug_puts@plt>

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

LLVM IR (-O2):
define void @_d(i8* %0) {
%2 = tail call i32 @debug_puts(i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void lput2(void *p, uint16_t v) {
  assert(p != NULL);
  ((uint8_t *)p)[0] = v >> 0;
  ((uint8_t *)p)[1] = v >> 8;
}


x86 assembly (clang, -O0):
<lput2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lput2>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
mov    %ebx,(%r14)
sar    $0x8,%ebx
mov    %ebx,0x4(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @lput2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %4
%10 = ashr i32 %9, 0
%11 = load i8*, i8** %3
%12 = bitcast i8* %11 to i32*
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 %10, i32* %13
%14 = load i32, i32* %4
%15 = ashr i32 %14, 8
%16 = load i8*, i8** %3
%17 = bitcast i8* %16 to i32*
%18 = getelementptr inbounds i32, i32* %17, i64 1
store i32 %15, i32* %18
ret void
}

LLVM IR (-O2):
define void @lput2(i8* writeonly %0, i32 %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = bitcast i8* %0 to i32*
store i32 %1, i32* %6
%7 = ashr i32 %1, 8
%8 = getelementptr inbounds i8, i8* %0, i64 4
%9 = bitcast i8* %8 to i32*
store i32 %7, i32* %9
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long window;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
void set_XKeyEvent_window(void *_p, unsigned long _v) {
  ((XKeyEvent *)_p)->window = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XKeyEvent_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyEvent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_UTF8STRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_UTF8STRING_it;
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_UTF8STRING_it);
}


x86 assembly (clang, -O0):
<i2d_ASN1_UTF8STRING>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_ASN1_UTF8STRING>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@ASN1_UTF8STRING_it = global i32 0
define i32 @i2d_ASN1_UTF8STRING(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @ASN1_UTF8STRING_it)
ret i32 %3
}
void timer_set_timeout_us(struct timeval *timer, unsigned us) {
  (void)timer;
  (void)us;
}


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

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

LLVM IR (-O0):
%struct.timeval = type opaque
define void @timer_set_timeout_us(%struct.timeval* %0, i32 %1) {
%3 = alloca %struct.timeval*
%4 = alloca i32
store %struct.timeval* %0, %struct.timeval** %3
store i32 %1, i32* %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
%struct.timeval = type opaque
define void @timer_set_timeout_us(%struct.timeval* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int retval = 0;
  printf("\n--------------Hello world ...Exiting...---------\n");
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
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 = [51 x i8] c"\0A--------------Hello world ...Exiting...---------\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
@str = [50 x i8] c"\0A--------------Hello world ...Exiting...---------\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  unsigned char local1;
  {
    state[0UL] = (input[0UL] + 914778474UL) - (unsigned char)183;
    local1 = 0UL;
    while (local1 < (unsigned char)0) {
      state[0UL] += state[0UL];
      state[local1] = state[0UL] + state[0UL];
      local1++;
    }
    output[0UL] = (state[0UL] - 443658316UL) + (unsigned char)165;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x3686696a,%rax
sub    $0xb7,%rax
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
cmp    $0x0,%eax
jge    1161 <RandomFunc+0x61>
movzbl -0x11(%rbp),%ecx
movzbl -0x11(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
movzbl -0x11(%rbp),%ecx
add    %ecx,%eax
mov    %al,%cl
movzbl -0x12(%rbp),%eax
mov    %cl,-0x11(%rbp,%rax,1)
mov    -0x12(%rbp),%al
add    $0x1,%al
mov    %al,-0x12(%rbp)
jmp    1126 <RandomFunc+0x26>
movzbl -0x11(%rbp),%eax
sub    $0x1a71b04c,%rax
add    $0xa5,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%al
add    $0xc,%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1 x i8]
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = add i64 %10, 914778474
%12 = sub i64 %11, 183
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %13, i8* %14
store i8 0, i8* %6
br label %15
15: ; preds = %19, %2
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %41
19: ; preds = %15
%20 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = add nsw i32 %25, %22
%27 = trunc i32 %26 to i8
store i8 %27, i8* %23
%28 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = add nsw i32 %30, %33
%35 = trunc i32 %34 to i8
%36 = load i8, i8* %6
%37 = zext i8 %36 to i64
%38 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 %37
store i8 %35, i8* %38
%39 = load i8, i8* %6
%40 = add i8 %39, 1
store i8 %40, i8* %6
br label %15
41: ; preds = %15
%42 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%43 = load i8, i8* %42
%44 = zext i8 %43 to i64
%45 = sub i64 %44, 443658316
%46 = add i64 %45, 165
%47 = trunc i64 %46 to i8
%48 = load i8*, i8** %4
%49 = getelementptr inbounds i8, i8* %48, i64 0
store i8 %47, i8* %49
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, 12
store i8 %4, i8* %1
ret void
}
/* Variables and functions */
int izbaciCifruDesetica(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d\n", izbaciCifruDesetica(n));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @izbaciCifruDesetica(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
Finish(rcode) { exit(rcode); }


x86 assembly (clang, -O0):
<Finish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<Finish>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @Finish(i32 %0) {
tail call void @exit(i32 %0)
unreachable
}
float clampf(float a, float min, float max) {
  if (a < min)
    return min;
  else if (a > max)
    return max;
  else
    return a;
}


x86 assembly (clang, -O0):
<clampf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <clampf+0x35>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <clampf+0x5d>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1153 <clampf+0x53>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <clampf+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampf>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @clampf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %6
store float %12, float* %4
br label %21
13: ; preds = %3
%14 = load float, float* %5
%15 = load float, float* %7
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %7
store float %18, float* %4
br label %21
19: ; preds = %13
%20 = load float, float* %5
store float %20, float* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @clampf(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
const char *error_simgen_name() { return "Error"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"Error\00"
define i8* @error_simgen_name() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"Error\00"
define i8* @error_simgen_name() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ drawable;
};
struct TYPE_4__ {
  TYPE_1__ xgraphicsexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xgraphicsexpose_drawable(void *_p) {
  return (unsigned long)((XEvent *)_p)->xgraphicsexpose.drawable;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xgraphicsexpose_drawable>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xgraphicsexpose_drawable(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xgraphicsexpose_drawable(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argn, char *argv[]) {
  printf("lophilo\n");
  printf("hello word\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"lophilo\00"
@str.2 = [11 x i8] c"hello word\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void parse_error(type, expect) const char *type, *expect;
{
  eprintf("%s syntax error: expected %s, found %s.", type, expect,
          error_text());
}


x86 assembly (clang, -O0):
<parse_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <error_text@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <eprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_error>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <error_text@plt>
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <eprintf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"%s syntax error: expected %s, found %s.\00"
define void @parse_error(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** %4
%7 = call i32 (...) @error_text()
%8 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @eprintf to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"%s syntax error: expected %s, found %s.\00"
define void @parse_error(i8* %0, i8* %1) {
%3 = tail call i32 (...) @error_text()
%4 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @eprintf to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
double __ieee754_atan2(double, double);
double atan2(double y, double x) { return __ieee754_atan2(y, x); }


x86 assembly (clang, -O0):
<atan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__ieee754_atan2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan2>:
jmp    1030 <__ieee754_atan2@plt>

LLVM IR (-O0):
define double @atan2(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 = call double @__ieee754_atan2(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @atan2(double %0, double %1) {
%3 = tail call double @__ieee754_atan2(double %0, double %1)
ret double %3
}
/* Variables and functions */
int ECONNRESET;
int close(int);
int errno;
int ruby_close(int s) {
  int err = errno;
  errno = 0;
  s = close(s);
  if (errno == ECONNRESET) {
    errno = 0;
    s = 0;
  } else if (errno == 0)
    errno = err;
  return s;
}


x86 assembly (clang, -O0):
<ruby_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    0x2eaa(%rip),%rax
movl   $0x0,(%rax)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%eax
jne    1170 <ruby_close+0x60>
mov    0x2e7a(%rip),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1191 <ruby_close+0x81>
mov    0x2e61(%rip),%rax
cmpl   $0x0,(%rax)
jne    118c <ruby_close+0x7c>
mov    -0x8(%rbp),%ecx
mov    0x2e4e(%rip),%rax
mov    %ecx,(%rax)
jmp    1191 <ruby_close+0x81>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ruby_close>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ebe(%rip),%rbx
mov    (%rbx),%ebp
movl   $0x0,(%rbx)
call   1030 <close@plt>
mov    (%rbx),%edx
mov    0x2eb0(%rip),%rdi
xor    %ecx,%ecx
mov    $0x0,%esi
cmp    (%rdi),%edx
je     1143 <ruby_close+0x33>
mov    %ebp,%ecx
mov    %eax,%esi
test   %edx,%edx
jne    1147 <ruby_close+0x37>
mov    %ecx,(%rbx)
mov    %esi,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
@ECONNRESET = global i32 0
define i32 @ruby_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
store i32 0, i32* @errno
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* @errno
%8 = load i32, i32* @ECONNRESET
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* @errno
store i32 0, i32* %2
br label %17
11: ; preds = %1
%12 = load i32, i32* @errno
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i32, i32* %3
store i32 %15, i32* @errno
br label %16
16: ; preds = %14, %11
br label %17
17: ; preds = %16, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@errno = global i32 0
@ECONNRESET = global i32 0
define i32 @ruby_close(i32 %0) {
%2 = load i32, i32* @errno
store i32 0, i32* @errno
%3 = tail call i32 @close(i32 %0)
%4 = load i32, i32* @errno
%5 = load i32, i32* @ECONNRESET
%6 = icmp eq i32 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = icmp eq i32 %4, 0
br i1 %8, label %9, label %12
9: ; preds = %7, %1
%10 = phi i32 [ 0, %1 ], [ %2, %7 ]
%11 = phi i32 [ 0, %1 ], [ %3, %7 ]
store i32 %10, i32* @errno
br label %12
12: ; preds = %9, %7
%13 = phi i32 [ %3, %7 ], [ %11, %9 ]
ret i32 %13
}