xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int dns_packet_getname(char *, unsigned int, unsigned int, char **);
int /*<<< orphan*/ err(int, char *);
unsigned int x_getname(char *buf, unsigned int len, unsigned int pos,
                       char **out) {
  pos = dns_packet_getname(buf, len, pos, out);
  if (!pos)
    err(-1, "could not parse AXFR results");
  return pos;
}


x86 assembly (clang, -O0):
<x_getname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1040 <dns_packet_getname@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1167 <x_getname+0x47>
mov    $0xffffffff,%edi
lea    0xe9e(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_getname>:
push   %rbx
call   1040 <dns_packet_getname@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    113d <x_getname+0x1d>
lea    0xecd(%rip),%rsi
mov    $0xffffffff,%edi
call   1030 <err@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"could not parse AXFR results\00"
define i32 @x_getname(i8* %0, i32 %1, i32 %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8**
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i8**, i8*** %8
%13 = call i32 @dns_packet_getname(i8* %9, i32 %10, i32 %11, i8** %12)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %4
%17 = call i32 @err(i32 -1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %4
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
@.str = [29 x i8] c"could not parse AXFR results\00"
define i32 @x_getname(i8* %0, i32 %1, i32 %2, i8** %3) {
%5 = tail call i32 @dns_packet_getname(i8* %0, i32 %1, i32 %2, i8** %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @err(i32 -1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void write_header(void) {
  printf("    Recno e0of  c00f  File Offs             e0 pos   c0 pos\n");
}


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

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

LLVM IR (-O0):
@.str = [61 x i8] c" Recno e0of c00f File Offs e0 pos c0 pos\0A\00"
define void @write_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [60 x i8] c" Recno e0of c00f File Offs e0 pos c0 pos\00"
define void @write_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ chtype;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ getbkgd(int /*<<< orphan*/ *);
chtype ncurses_getbkgd(WINDOW *win) { return getbkgd(win); }


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

x86 assembly (clang, -O2):
<ncurses_getbkgd>:
jmp    1030 <getbkgd@plt>

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

LLVM IR (-O2):
define i32 @ncurses_getbkgd(i32* %0) {
%2 = tail call i32 @getbkgd(i32* %0)
ret i32 %2
}
long long GetVote(long long i) {
  if (i == 0)
    return 1;
  return i % 2;
}


x86 assembly (clang, -O0):
<GetVote>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <GetVote+0x20>
movq   $0x1,-0x8(%rbp)
jmp    1132 <GetVote+0x32>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetVote>:
test   %rdi,%rdi
je     111a <GetVote+0x1a>
mov    %rdi,%rax
mov    %rdi,%rcx
shr    $0x3f,%rcx
add    %rdi,%rcx
and    $0xfffffffffffffffe,%rcx
sub    %rcx,%rax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @GetVote(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = srem i64 %0, 2
%4 = select i1 %2, i64 1, i64 %3
ret i64 %4
}
/* Type definitions */
struct Cyc_Hashtable_Table {
  int dummy;
};
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_scan_exp(struct Cyc_Absyn_Exp *,
                                struct Cyc_Hashtable_Table *);
void Cyc_scan_exp_opt(struct Cyc_Absyn_Exp *eo,
                      struct Cyc_Hashtable_Table *dep) {
  struct Cyc_Absyn_Exp *_T0;
  unsigned _T1;
  _T0 = eo;
  _T1 = (unsigned)_T0;
  if (!_T1)
    goto _TL99;
  Cyc_scan_exp(eo, dep);
  goto _TL9A;
_TL99:
_TL9A:
  return;
}


x86 assembly (clang, -O0):
<Cyc_scan_exp_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    113e <Cyc_scan_exp_opt+0x2e>
jmp    1150 <Cyc_scan_exp_opt+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Cyc_scan_exp@plt>
jmp    1155 <Cyc_scan_exp_opt+0x45>
jmp    1155 <Cyc_scan_exp_opt+0x45>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_scan_exp_opt>:
test   %edi,%edi
je     1119 <Cyc_scan_exp_opt+0x9>
jmp    1030 <Cyc_scan_exp@plt>
ret

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
%struct.Cyc_Hashtable_Table = type { i32 }
define void @Cyc_scan_exp_opt(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Hashtable_Table* %1) {
%3 = alloca %struct.Cyc_Absyn_Exp*
%4 = alloca %struct.Cyc_Hashtable_Table*
%5 = alloca %struct.Cyc_Absyn_Exp*
%6 = alloca i32
store %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp** %3
store %struct.Cyc_Hashtable_Table* %1, %struct.Cyc_Hashtable_Table** %4
%7 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %3
store %struct.Cyc_Absyn_Exp* %7, %struct.Cyc_Absyn_Exp** %5
%8 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %5
%9 = ptrtoint %struct.Cyc_Absyn_Exp* %8 to i32
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %2
br label %17
13: ; preds = %2
%14 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %3
%15 = load %struct.Cyc_Hashtable_Table*, %struct.Cyc_Hashtable_Table** %4
%16 = call i32 @Cyc_scan_exp(%struct.Cyc_Absyn_Exp* %14, %struct.Cyc_Hashtable_Table* %15)
br label %18
17: ; preds = %12
br label %18
18: ; preds = %17, %13
ret void
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
%struct.Cyc_Hashtable_Table = type { i32 }
define void @Cyc_scan_exp_opt(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Hashtable_Table* %1) {
%3 = ptrtoint %struct.Cyc_Absyn_Exp* %0 to i64
%4 = trunc i64 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @Cyc_scan_exp(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Hashtable_Table* %1)
br label %8
8: ; preds = %2, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ pipe_unix_init(int /*<<< orphan*/, int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void e_comm_init(void) {
  signal(SIGINT, SIG_IGN);
  pipe_unix_init(0, 1);
}


x86 assembly (clang, -O0):
<e_comm_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <pipe_unix_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_comm_init>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %edi,%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <pipe_unix_init@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
define void @e_comm_init() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = call i32 @pipe_unix_init(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_IGN = global i32 0
define void @e_comm_init() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = tail call i32 @pipe_unix_init(i32 0, i32 1)
ret void
}
int EClipRange(int a, int low, int high) {
  if (a < low)
    return low;
  if (a > high)
    return high;
  return a;
}


x86 assembly (clang, -O0):
<EClipRange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <EClipRange+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <EClipRange+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <EClipRange+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <EClipRange+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EClipRange>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @EClipRange(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
double power(double base, int exp) {}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @power(double %0, i32 %1) {
ret double undef
}
void cmd_setoption(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @pthread_attr_getscope() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void host_attr_free(void *ptr) { free((char *)ptr); }


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

LLVM IR (-O0):
define void @host_attr_free(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 @host_attr_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void Info_Init(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @caller_1_1_1_1_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glutWireIcosahedron();
void drawIcos(void) {
  glColor3f(1.0, 0.0, 0.0);
  glPushMatrix();
  glScalef(6.0, 6.0, 6.0);
  glutWireIcosahedron();
  glPopMatrix();
}


x86 assembly (clang, -O0):
<drawIcos>:
push   %rbp
mov    %rsp,%rbp
movsd  0xeac(%rip),%xmm0
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm1
call   1040 <glColor3f@plt>
mov    $0x0,%al
call   1060 <glPushMatrix@plt>
movsd  0xe8a(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1050 <glScalef@plt>
mov    $0x0,%al
call   1070 <glutWireIcosahedron@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawIcos>:
push   %rax
movsd  0xea7(%rip),%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1040 <glColor3f@plt>
xor    %eax,%eax
call   1060 <glPushMatrix@plt>
movsd  0xe95(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1050 <glScalef@plt>
xor    %eax,%eax
call   1070 <glutWireIcosahedron@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glPopMatrix@plt>

LLVM IR (-O0):
define void @drawIcos() {
%1 = call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = call i32 (...) @glPushMatrix()
%3 = call i32 @glScalef(double 6.000000e+00, double 6.000000e+00, double 6.000000e+00)
%4 = call i32 (...) @glutWireIcosahedron()
%5 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @drawIcos() {
%1 = tail call i32 @glColor3f(double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = tail call i32 (...) @glPushMatrix()
%3 = tail call i32 @glScalef(double 6.000000e+00, double 6.000000e+00, double 6.000000e+00)
%4 = tail call i32 (...) @glutWireIcosahedron()
%5 = tail call i32 (...) @glPopMatrix()
ret void
}
int GetScreenBitDepth() { return 5; }


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

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

LLVM IR (-O0):
define i32 @GetScreenBitDepth() {
ret i32 5
}

LLVM IR (-O2):
define i32 @GetScreenBitDepth() {
ret i32 5
}
/* Type definitions */
struct group {
  int dummy;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int getgrgid_r(gid_t gid, struct group *grp, char *buf, size_t buflen,
               struct group **result) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<getgrgid_r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgrgid_r>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.group = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getgrgid_r(i32 %0, %struct.group* %1, i8* %2, i64 %3, %struct.group** %4) {
%6 = alloca i32
%7 = alloca %struct.group*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca %struct.group**
store i32 %0, i32* %6
store %struct.group* %1, %struct.group** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store %struct.group** %4, %struct.group*** %10
%11 = load i32, i32* @ENOSYS
store i32 %11, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.group = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getgrgid_r(i32 %0, %struct.group* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, %struct.group** nocapture readnone %4) {
%6 = load i32, i32* @ENOSYS
store i32 %6, i32* @errno
ret i32 -1
}
/* Variables and functions */
double round_money(double);
double round_pennies(double d) { return round_money(d); }


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

x86 assembly (clang, -O2):
<round_pennies>:
jmp    1030 <round_money@plt>

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

LLVM IR (-O2):
define double @round_pennies(double %0) {
%2 = tail call double @round_money(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ findSubsetWithGivenSumHelper(int *, int, int /*<<< orphan*/,
                                                int, int *, int /*<<< orphan*/);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void findSubsetWithGivenSum(int A[], int lengthA, int sum) {
  int *summandPosition = (int *)malloc(lengthA * sizeof(int));
  findSubsetWithGivenSumHelper(A, lengthA, 0, sum, summandPosition, 0);
  free(summandPosition);
}


x86 assembly (clang, -O0):
<findSubsetWithGivenSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
xor    %r9d,%r9d
mov    %r9d,%edx
call   1040 <findSubsetWithGivenSumHelper@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findSubsetWithGivenSum>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%r15
lea    0x0(,%rbx,4),%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
mov    %r15,%rdi
mov    %ebx,%esi
xor    %edx,%edx
mov    %r14d,%ecx
mov    %rax,%r8
xor    %r9d,%r9d
call   1040 <findSubsetWithGivenSumHelper@plt>
mov    %rbp,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @findSubsetWithGivenSum(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 4
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %7
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load i32*, i32** %7
%18 = call i32 @findSubsetWithGivenSumHelper(i32* %14, i32 %15, i32 0, i32 %16, i32* %17, i32 0)
%19 = load i32*, i32** %7
%20 = call i32 @free(i32* %19)
ret void
}

LLVM IR (-O2):
define void @findSubsetWithGivenSum(i32* %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 2
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @findSubsetWithGivenSumHelper(i32* %0, i32 %1, i32 0, i32 %2, i32* %6, i32 0)
%8 = tail call i32 @free(i32* %6)
ret void
}
char *strcat(char *restrict s1, char const *restrict s2) {
  char *i = s1;
  while (*i)
    ++i;
  for (; (*i = *s2); ++i, ++s2) {
  }
  return s1;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     116d <strcat+0x6d>
jmp    1150 <strcat+0x50>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <strcat+0x37>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
mov    (%rsi),%dl
mov    %dl,-0x1(%rcx)
test   %dl,%dl
je     1142 <strcat+0x42>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rsi,%rdx,1),%edi
mov    %dil,(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1130 <strcat+0x30>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* noalias returned %0, i8* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
store i8 %9, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %8, %11
%12 = phi i8* [ %14, %11 ], [ %4, %8 ]
%13 = phi i8* [ %15, %11 ], [ %1, %8 ]
%14 = getelementptr inbounds i8, i8* %12, i64 1
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = load i8, i8* %15
store i8 %16, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %11
18: ; preds = %11, %8
ret i8* %0
}
_Complex int fn15(_Complex volatile int *z) { return *z * ~*z; }


x86 assembly (clang, -O0):
<fn15>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    0x4(%rax),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%edi
mov    0x4(%rcx),%ecx
xor    %esi,%esi
sub    %ecx,%esi
mov    %edx,%ecx
imul   %edi,%ecx
mov    %eax,%r8d
imul   %esi,%r8d
sub    %r8d,%ecx
imul   %edi,%eax
imul   %esi,%edx
add    %edx,%eax
mov    %ecx,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn15>:
mov    (%rdi),%r8d
mov    0x4(%rdi),%edx
mov    (%rdi),%esi
mov    0x4(%rdi),%edi
mov    %esi,%ecx
imul   %r8d,%ecx
mov    %edi,%eax
imul   %edx,%eax
add    %ecx,%eax
imul   %edx,%esi
imul   %r8d,%edi
sub    %edi,%esi
shl    $0x20,%rsi
or     %rsi,%rax
ret

LLVM IR (-O0):
define i64 @fn15({ i32, i32 }* %0) {
%2 = alloca { i32, i32 }
%3 = alloca { i32, i32 }*
store { i32, i32 }* %0, { i32, i32 }** %3
%4 = load { i32, i32 }*, { i32, i32 }** %3
%5 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %4, i32 0, i32 0
%6 = load volatile i32, i32* %5
%7 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %4, i32 0, i32 1
%8 = load volatile i32, i32* %7
%9 = load { i32, i32 }*, { i32, i32 }** %3
%10 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %9, i32 0, i32 0
%11 = load volatile i32, i32* %10
%12 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %9, i32 0, i32 1
%13 = load volatile i32, i32* %12
%14 = sub i32 0, %13
%15 = mul i32 %6, %11
%16 = mul i32 %8, %14
%17 = sub i32 %15, %16
%18 = mul i32 %8, %11
%19 = mul i32 %6, %14
%20 = add i32 %18, %19
%21 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %2, i32 0, i32 0
%22 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %2, i32 0, i32 1
store i32 %17, i32* %21
store i32 %20, i32* %22
%23 = bitcast { i32, i32 }* %2 to i64*
%24 = load i64, i64* %23
ret i64 %24
}

LLVM IR (-O2):
define i64 @fn15({ i32, i32 }* %0) {
%2 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %0, i64 0, i32 0
%3 = load volatile i32, i32* %2
%4 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %0, i64 0, i32 1
%5 = load volatile i32, i32* %4
%6 = load volatile i32, i32* %2
%7 = load volatile i32, i32* %4
%8 = mul i32 %6, %3
%9 = mul i32 %7, %5
%10 = add i32 %9, %8
%11 = mul i32 %6, %5
%12 = mul i32 %7, %3
%13 = sub i32 %11, %12
%14 = zext i32 %13 to i64
%15 = shl nuw i64 %14, 32
%16 = zext i32 %10 to i64
%17 = or i64 %15, %16
ret i64 %17
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) {
  if (islower(c)) {
    return (c - ('a' - 'A'));
  }
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @islower(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 32
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char **argv) {
  long l = 0xdeadbeef;
  short s = l;
  char c = l;
  printf("long: %x\n", l);
  printf("short: %x\n", s);
  printf("Char: %x\n", c);
  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)
mov    $0xdeadbeef,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %ax,-0x1a(%rbp)
mov    -0x18(%rbp),%rax
mov    %al,-0x1b(%rbp)
mov    -0x18(%rbp),%rax
lea    0xeb7(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x1a(%rbp),%ax
lea    0xeae(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
movsbl -0x1b(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"long: %x\0A\00"
@.str.1 = [11 x i8] c"short: %x\0A\00"
@.str.2 = [10 x i8] c"Char: %x\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i16
%8 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 3735928559, i64* %6
%9 = load i64, i64* %6
%10 = trunc i64 %9 to i16
store i16 %10, i16* %7
%11 = load i64, i64* %6
%12 = trunc i64 %11 to i8
store i8 %12, i8* %8
%13 = load i64, i64* %6
%14 = trunc i64 %13 to i8
%15 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %14)
%16 = load i16, i16* %7
%17 = trunc i16 %16 to i8
%18 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext %17)
%19 = load i8, i8* %8
%20 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8 signext %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"long: %x\0A\00"
@.str.1 = [11 x i8] c"short: %x\0A\00"
@.str.2 = [10 x i8] c"Char: %x\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext -17)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8 signext -17)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8 signext -17)
ret i32 0
}
/* Variables and functions */
int RAND_MAX;
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d\n", RAND_MAX); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@RAND_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @RAND_MAX
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void null_open(struct fs_node *node, unsigned int flags) {
  (void)node;
  (void)flags;
  return;
}


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

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

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

LLVM IR (-O2):
%struct.fs_node = type opaque
define void @null_open(%struct.fs_node* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int);
int main(void) {
  int i = 2147483647;
  unsigned int j = 4294967295;
  printf("%d %d %d\n", i, i + 1, i + 2);
  printf("%u %u %u\n", j, j + 1, j + 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7fffffff,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
add    $0x1,%edx
mov    -0x8(%rbp),%ecx
add    $0x2,%ecx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x7fffffff,%esi
mov    $0x80000000,%edx
mov    $0x80000001,%ecx
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0xffffffff,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
@.str.1 = [10 x i8] c"%u %u %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2147483647, i32 -2147483648, i32 -2147483647)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 -1, i32 0, i32 1)
ret i32 0
}
/* Variables and functions */
int tc_core_time2tick(int);
unsigned tc_calc_xmittime(unsigned rate, unsigned size) {
  return tc_core_time2tick(1000000 * ((double)size / rate));
}


x86 assembly (clang, -O0):
<tc_calc_xmittime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2sd %rax,%xmm1
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
divsd  %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <tc_core_time2tick@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tc_calc_xmittime>:
mov    %esi,%eax
cvtsi2sd %rax,%xmm0
mov    %edi,%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
mulsd  0xed6(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <tc_core_time2tick@plt>

LLVM IR (-O0):
define i32 @tc_calc_xmittime(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = uitofp i32 %5 to double
%7 = load i32, i32* %3
%8 = uitofp i32 %7 to double
%9 = fdiv double %6, %8
%10 = fmul double 1.000000e+06, %9
%11 = fptosi double %10 to i32
%12 = call i32 @tc_core_time2tick(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @tc_calc_xmittime(i32 %0, i32 %1) {
%3 = uitofp i32 %1 to double
%4 = uitofp i32 %0 to double
%5 = fdiv double %3, %4
%6 = fmul double %5, 1.000000e+06
%7 = fptosi double %6 to i32
%8 = tail call i32 @tc_core_time2tick(i32 %7)
ret i32 %8
}
/* Variables and functions */
int Cyc_Core_nptrcmp(void *, void *);
int Cyc_Core_ptrcmp(void *a, void *b) {
  int _T0;
  _T0 = Cyc_Core_nptrcmp(a, b);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_Core_ptrcmp>:
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 <Cyc_Core_nptrcmp@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Core_ptrcmp>:
jmp    1030 <Cyc_Core_nptrcmp@plt>

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

LLVM IR (-O2):
define i32 @Cyc_Core_ptrcmp(i8* %0, i8* %1) {
%3 = tail call i32 @Cyc_Core_nptrcmp(i8* %0, i8* %1)
ret i32 %3
}
int zero(int x, int y) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @zero(i32 %0, i32 %1) {
ret i32 0
}
int GreatCommonNum(int p, int q) {
  if (q == 0)
    return p;
  return GreatCommonNum(q, p % q);
}


x86 assembly (clang, -O0):
<GreatCommonNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <GreatCommonNum+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <GreatCommonNum+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <GreatCommonNum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GreatCommonNum>:
mov    %edi,%eax
test   %esi,%esi
je     111d <GreatCommonNum+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <GreatCommonNum+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @GreatCommonNum(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* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = call i32 @GreatCommonNum(i32 %11, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @GreatCommonNum(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ GL_FILL;
int /*<<< orphan*/ teapot(int, int /*<<< orphan*/, int /*<<< orphan*/);
void glutSolidTeapot(GLdouble size) { teapot(7, size, GL_FILL); }


x86 assembly (clang, -O0):
<glutSolidTeapot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
mov    $0x7,%edi
call   1030 <teapot@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glutSolidTeapot>:
mov    %edi,%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edx
mov    $0x7,%edi
jmp    1030 <teapot@plt>

LLVM IR (-O0):
@GL_FILL = global i32 0
define void @glutSolidTeapot(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @GL_FILL
%5 = call i32 @teapot(i32 7, i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@GL_FILL = global i32 0
define void @glutSolidTeapot(i32 %0) {
%2 = load i32, i32* @GL_FILL
%3 = tail call i32 @teapot(i32 7, i32 %0, i32 %2)
ret void
}
int fun682() { return 682; }


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

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

LLVM IR (-O0):
define i32 @fun682() {
ret i32 682
}

LLVM IR (-O2):
define i32 @fun682() {
ret i32 682
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint8_t BME_UBFX_B(volatile uint8_t *addr, uint8_t bit,
                                            uint8_t width) {
  return *(volatile uint8_t *)((uint32_t)addr | (1 << 28) | (bit << 23) |
                               ((width - 1) << 19));
}


x86 assembly (clang, -O0):
<BME_UBFX_B>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
or     $0x10000000,%eax
mov    -0xc(%rbp),%ecx
shl    $0x17,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x13,%ecx
or     %ecx,%eax
cltq
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BME_UBFX_B>:
shl    $0x17,%esi
shl    $0x13,%edx
add    $0xfff80000,%edx
or     %edi,%esi
or     %edx,%esi
movslq %esi,%rax
or     $0x10000000,%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @BME_UBFX_B(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 = ptrtoint i32* %7 to i32
%9 = or i32 %8, 268435456
%10 = load i32, i32* %5
%11 = shl i32 %10, 23
%12 = or i32 %9, %11
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 1
%15 = shl i32 %14, 19
%16 = or i32 %12, %15
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @BME_UBFX_B(i32* %0, i32 %1, i32 %2) {
%4 = ptrtoint i32* %0 to i64
%5 = trunc i64 %4 to i32
%6 = shl i32 %1, 23
%7 = shl i32 %2, 19
%8 = add i32 %7, -524288
%9 = or i32 %6, %5
%10 = or i32 %9, %8
%11 = or i32 %10, 268435456
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
ret i32 %14
}
void end_dt() {}


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

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

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

LLVM IR (-O2):
define void @end_dt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_putstr(char *);
int /*<<< orphan*/ readLine();
int /*<<< orphan*/ start_game();
void show_enter() {
  char *get;
  my_putstr("\e[5;36m");
  my_putstr("     Press enter to cook\n\n\n");
  my_putstr("\e[0m");
  readLine();
  start_game();
}


x86 assembly (clang, -O0):
<show_enter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <my_putstr@plt>
lea    0xebd(%rip),%rdi
call   1040 <my_putstr@plt>
lea    0xecd(%rip),%rdi
call   1040 <my_putstr@plt>
mov    $0x0,%al
call   1030 <readLine@plt>
mov    $0x0,%al
call   1050 <start_game@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_enter>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <my_putstr@plt>
lea    0xec4(%rip),%rdi
call   1040 <my_putstr@plt>
lea    0xed4(%rip),%rdi
call   1040 <my_putstr@plt>
xor    %eax,%eax
call   1030 <readLine@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <start_game@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[5;36m\00"
@.str.1 = [28 x i8] c" Press enter to cook\0A\0A\0A\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @show_enter() {
%1 = alloca i8*
%2 = call i32 @my_putstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @my_putstr(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 (...) @readLine()
%6 = call i32 (...) @start_game()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[5;36m\00"
@.str.1 = [28 x i8] c" Press enter to cook\0A\0A\0A\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @show_enter() {
%1 = tail call i32 @my_putstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @my_putstr(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @my_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (...) @readLine()
%5 = tail call i32 (...) @start_game()
ret void
}
/* Variables and functions */
int f345(int *);
int f346(int *p) { return f345(p); }


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

x86 assembly (clang, -O2):
<f346>:
jmp    1030 <f345@plt>

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

LLVM IR (-O2):
define i32 @f346(i32* %0) {
%2 = tail call i32 @f345(i32* %0)
ret i32 %2
}
/* Variables and functions */
char fmod(int, int);
int /*<<< orphan*/ putchar(char);
int mbout(int ch) {
  int diff = ch - 128;
  putchar('\xC2' + (int)diff / 64);
  putchar('\x80' + fmod(diff, 64));
  return 0;
}


x86 assembly (clang, -O0):
<mbout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
add    $0xffffffc2,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
mov    $0x40,%esi
call   1040 <fmod@plt>
movsbl %al,%eax
add    $0xffffff80,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbout>:
push   %rbx
lea    -0x80(%rdi),%ebx
add    $0xffffffbf,%edi
test   %ebx,%ebx
cmovns %ebx,%edi
shr    $0x6,%edi
add    $0xc2,%dil
movsbl %dil,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
mov    $0x40,%esi
call   1040 <fmod@plt>
xor    $0x80,%al
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mbout(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 128
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sdiv i32 %6, 64
%8 = add nsw i32 -62, %7
%9 = trunc i32 %8 to i8
%10 = call i32 @putchar(i8 signext %9)
%11 = load i32, i32* %3
%12 = call signext i8 @fmod(i32 %11, i32 64)
%13 = sext i8 %12 to i32
%14 = add nsw i32 -128, %13
%15 = trunc i32 %14 to i8
%16 = call i32 @putchar(i8 signext %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @mbout(i32 %0) {
%2 = add nsw i32 %0, -128
%3 = sdiv i32 %2, 64
%4 = trunc i32 %3 to i8
%5 = add i8 %4, -62
%6 = tail call i32 @putchar(i8 signext %5)
%7 = tail call signext i8 @fmod(i32 %2, i32 64)
%8 = xor i8 %7, -128
%9 = tail call i32 @putchar(i8 signext %8)
ret i32 0
}