xunge/DecIR huggingface dataset:
OP(dd, d5) {
  illegal_1();
  op_d5();
}


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

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1040 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <op_d5@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_d5()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_d5()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void ok(const char *test) { fprintf(stderr, "%s: OK\n", test); }


x86 assembly (clang, -O0):
<ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ok>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: OK\0A\00"
define void @ok(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: OK\0A\00"
define void @ok(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct group {
  int /*<<< orphan*/ gr_gid;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
struct group *getgrnam(char const *);
int audit_name_to_gid(const char *name, gid_t *gid) {
  struct group *gr;
  gr = getgrnam(name);
  if (gr == NULL)
    return 1;
  *gid = gr->gr_gid;
  return 0;
}


x86 assembly (clang, -O0):
<audit_name_to_gid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getgrnam@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1144 <audit_name_to_gid+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1157 <audit_name_to_gid+0x47>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audit_name_to_gid>:
push   %rbx
mov    %rsi,%rbx
call   1030 <getgrnam@plt>
test   %rax,%rax
je     1126 <audit_name_to_gid+0x16>
mov    (%rax),%eax
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.group = type { i32 }
define i32 @audit_name_to_gid(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca %struct.group*
store i8* %0, i8** %4
store i32* %1, i32** %5
%7 = load i8*, i8** %4
%8 = call %struct.group* @getgrnam(i8* %7)
store %struct.group* %8, %struct.group** %6
%9 = load %struct.group*, %struct.group** %6
%10 = icmp eq %struct.group* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %17
12: ; preds = %2
%13 = load %struct.group*, %struct.group** %6
%14 = getelementptr inbounds %struct.group, %struct.group* %13, i32 0, i32 0
%15 = load i32, i32* %14
%16 = load i32*, i32** %5
store i32 %15, i32* %16
store i32 0, i32* %3
br label %17
17: ; preds = %12, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.group = type { i32 }
define i32 @audit_name_to_gid(i8* %0, i32* nocapture writeonly %1) {
%3 = tail call %struct.group* @getgrnam(i8* %0)
%4 = icmp eq %struct.group* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = getelementptr inbounds %struct.group, %struct.group* %3, i64 0, i32 0
%7 = load i32, i32* %6
store i32 %7, i32* %1
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int sonypi_open(void) {
  int fd;
  if ((fd = open("/dev/sonypi", O_RDWR)) < 0) {
    syslog(LOG_INFO, "Failed to open sonypi device!");
    return (-1);
  }
  return (fd);
}


x86 assembly (clang, -O0):
<sonypi_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    116a <sonypi_open+0x4a>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <syslog@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <sonypi_open+0x50>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sonypi_open>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <open@plt>
test   %eax,%eax
js     113c <sonypi_open+0x1c>
pop    %rcx
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <syslog@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/dev/sonypi\00"
@O_RDWR = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [30 x i8] c"Failed to open sonypi device!\00"
define i32 @sonypi_open() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_RDWR
%4 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @LOG_INFO
%8 = call i32 @syslog(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [12 x i8] c"/dev/sonypi\00"
@O_RDWR = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [30 x i8] c"Failed to open sonypi device!\00"
define i32 @sonypi_open() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @LOG_INFO
%6 = tail call i32 @syslog(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ -1, %4 ], [ %2, %0 ]
ret i32 %8
}
/* Variables and functions */
float LittleFloat(float l) { return l; }


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

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

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

LLVM IR (-O2):
define float @LittleFloat(float returned %0) {
ret float %0
}
/* Type definitions */
struct mloop_idle {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mloop__ref_any(struct mloop_idle *);
__attribute__((visibility("default"))) void
mloop_idle_ref(struct mloop_idle *self) {
  mloop__ref_any(self);
}


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

x86 assembly (clang, -O2):
<mloop_idle_ref>:
jmp    1030 <mloop__ref_any@plt>

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

LLVM IR (-O2):
%struct.mloop_idle = type { i32 }
define void @mloop_idle_ref(%struct.mloop_idle* %0) {
%2 = tail call i32 @mloop__ref_any(%struct.mloop_idle* %0)
ret void
}
void arteLock(void) {}


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

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

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

LLVM IR (-O2):
define void @arteLock() {
ret void
}
/* Variables and functions */
int add(int, int);
int main(void) { return add(20, 22); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%edi
mov    $0x16,%esi
call   1030 <add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x14,%edi
mov    $0x16,%esi
jmp    1030 <add@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @add(i32 20, i32 22)
ret i32 %1
}
void main() {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_sys_cfg_max_sta_num_usage(void) {
  printf("\nUsage : sys_cfg_max_sta_num [STA_NUM]\n");
  printf("\nIf STA_NUM is provided, a 'set' is performed, else a 'get' is "
         "performed.");
  printf("\nSTA_NUM should be greater than zero and less than or equal to %d\n",
         10);
  return;
}


x86 assembly (clang, -O0):
<print_sys_cfg_max_sta_num_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf3b(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_sys_cfg_max_sta_num_usage>:
push   %rax
lea    0xf65(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf08(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"\0AUsage : sys_cfg_max_sta_num [STA_NUM]\0A\00"
@.str.1 = [74 x i8] c"\0AIf STA_NUM is provided, a 'set' is performed, else a 'get' is performed.\00"
@.str.2 = [67 x i8] c"\0ASTA_NUM should be greater than zero and less than or equal to %d\0A\00"
define void @print_sys_cfg_max_sta_num_usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0), i32 10)
ret void
}

LLVM IR (-O2):
@.str.1 = [74 x i8] c"\0AIf STA_NUM is provided, a 'set' is performed, else a 'get' is performed.\00"
@.str.2 = [67 x i8] c"\0ASTA_NUM should be greater than zero and less than or equal to %d\0A\00"
@str = [39 x i8] c"\0AUsage : sys_cfg_max_sta_num [STA_NUM]\00"
define void @print_sys_cfg_max_sta_num_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.2, i64 0, i64 0), i32 10)
ret void
}
int NumberIsInt(double Number) { return Number == (int)Number; }


x86 assembly (clang, -O0):
<NumberIsInt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumberIsInt>:
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
cmpeqsd %xmm0,%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @NumberIsInt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
%7 = fcmp oeq double %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @NumberIsInt(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fcmp oeq double %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
int do_753() { return 753; }


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

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

LLVM IR (-O0):
define i32 @do_753() {
ret i32 753
}

LLVM IR (-O2):
define i32 @do_753() {
ret i32 753
}
void scif_putchar(unsigned char foo) {
  *(volatile unsigned int *)0xa05f8040 =
      ~(*(volatile unsigned int *)0xa05f8040 & 0x00ffffff);
  while (!(*(volatile unsigned short *)0xffe80010 & 0x20))
    ;
  *(volatile unsigned char *)0xffe8000c = foo;
  *(volatile unsigned short *)0xffe80010 &= 0xff9f;
}


x86 assembly (clang, -O0):
<scif_putchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xa05f8040,%eax
mov    (%rax),%ecx
and    $0xffffff,%ecx
xor    $0xffffffff,%ecx
mov    $0xa05f8040,%eax
mov    %ecx,(%rax)
mov    $0xffe80010,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1144 <scif_putchar+0x44>
jmp    1149 <scif_putchar+0x49>
jmp    1121 <scif_putchar+0x21>
mov    -0x1(%rbp),%cl
mov    $0xffe8000c,%eax
mov    %cl,(%rax)
mov    $0xffe80010,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0xff9f,%eax
mov    %ax,%cx
mov    $0xffe80010,%eax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scif_putchar>:
mov    $0xffe80010,%eax
mov    -0x5f887fd0(%rax),%ecx
not    %ecx
or     $0xff000000,%ecx
mov    %ecx,-0x5f887fd0(%rax)
nopl   0x0(%rax)
movzwl (%rax),%ecx
test   $0x20,%cl
je     1120 <scif_putchar+0x20>
mov    %dil,-0x4(%rax)
andw   $0xff9f,(%rax)
ret

LLVM IR (-O0):
define void @scif_putchar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load volatile i32, i32* inttoptr (i64 2690613312 to i32*)
%4 = and i32 %3, 16777215
%5 = xor i32 %4, -1
store volatile i32 %5, i32* inttoptr (i64 2690613312 to i32*)
br label %6
6: ; preds = %12, %1
%7 = load volatile i16, i16* inttoptr (i64 4293394448 to i16*)
%8 = zext i16 %7 to i32
%9 = and i32 %8, 32
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %13
12: ; preds = %6
br label %6
13: ; preds = %6
%14 = load i8, i8* %2
store volatile i8 %14, i8* inttoptr (i64 4293394444 to i8*)
%15 = load volatile i16, i16* inttoptr (i64 4293394448 to i16*)
%16 = zext i16 %15 to i32
%17 = and i32 %16, 65439
%18 = trunc i32 %17 to i16
store volatile i16 %18, i16* inttoptr (i64 4293394448 to i16*)
ret void
}

LLVM IR (-O2):
define void @scif_putchar(i8 zeroext %0) {
%2 = load volatile i32, i32* inttoptr (i64 2690613312 to i32*)
%3 = and i32 %2, 16777215
%4 = xor i32 %3, -1
store volatile i32 %4, i32* inttoptr (i64 2690613312 to i32*)
br label %5
5: ; preds = %5, %1
%6 = load volatile i16, i16* inttoptr (i64 4293394448 to i16*)
%7 = and i16 %6, 32
%8 = icmp eq i16 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
store volatile i8 %0, i8* inttoptr (i64 4293394444 to i8*)
%10 = load volatile i16, i16* inttoptr (i64 4293394448 to i16*)
%11 = and i16 %10, -97
store volatile i16 %11, i16* inttoptr (i64 4293394448 to i16*)
ret void
}
int do_205() { return 205; }


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

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

LLVM IR (-O0):
define i32 @do_205() {
ret i32 205
}

LLVM IR (-O2):
define i32 @do_205() {
ret i32 205
}
/* Variables and functions */
int /*<<< orphan*/ isspace(int /*<<< orphan*/);
int LineIsBlank(char *line) {
  char *pstr;
  pstr = line;
  while (*pstr) {
    if (!isspace(*pstr++))
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<LineIsBlank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <LineIsBlank+0x52>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    115d <LineIsBlank+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1169 <LineIsBlank+0x59>
jmp    1124 <LineIsBlank+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LineIsBlank>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
test   %edi,%edi
je     1138 <LineIsBlank+0x28>
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %eax,%eax
jne    1120 <LineIsBlank+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @LineIsBlank(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = sext i8 %4 to i32
%9 = tail call i32 @isspace(i32 %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %2
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}
__attribute__((warning("call to default read_r"))) long
_undef_read_r(struct _reent *r, int fd, char *ptr, int len) {
  return len;
}


x86 assembly (clang, -O0):
<_undef_read_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_undef_read_r>:
movslq %ecx,%rax
ret

LLVM IR (-O0):
%struct._reent = type opaque
define i64 @_undef_read_r(%struct._reent* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct._reent*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct._reent* %0, %struct._reent** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct._reent = type opaque
define i64 @_undef_read_r(%struct._reent* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = sext i32 %3 to i64
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ free(char *);
void stop_pwm(int pwm) {
  char *path;
  FILE *fptr;
  asprintf(&path, "/sys/class/pwm/pwmchip0/pwm%d/enable", pwm);
  fptr = fopen(path, "w");
  fprintf(fptr, "0");
  fclose(fptr);
  free(path);
}


x86 assembly (clang, -O0):
<stop_pwm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    -0x10(%rbp),%rdi
lea    0xe97(%rip),%rsi
call   1060 <asprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_pwm>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%edx
lea    0xea2(%rip),%rsi
lea    0x8(%rsp),%rdi
call   1060 <asprintf@plt>
mov    0x8(%rsp),%rdi
lea    0xeb1(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
mov    $0x30,%edi
mov    %rax,%rsi
call   1050 <fputc@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"/sys/class/pwm/pwmchip0/pwm%d/enable\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [2 x i8] c"0\00"
define void @stop_pwm(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %4
%9 = load i32*, i32** %4
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32*, i32** %4
%12 = call i32 @fclose(i32* %11)
%13 = load i8*, i8** %3
%14 = call i32 @free(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"/sys/class/pwm/pwmchip0/pwm%d/enable\00"
@.str.1 = [2 x i8] c"w\00"
define void @stop_pwm(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @fputc(i32 48, i32* %6)
%8 = call i32 @fclose(i32* %6)
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help(void) {
  printf("Usage: %s [OPTION] group file ...\n\nOptions:\n    -R, "
         "--recursive\t\tchange group of files recursively\n    -v, "
         "--verbose\t\toutput a diagnostic for every file processed\n    -d, "
         "--no-dereference\t\t\n    -h, --help\t\tdisplay this help\n    -V, "
         "--version\tdisplay version information\n\nReport bugs to "
         "<bulliver@gmail.com>\n",
         "chgrp");
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0x1016(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [308 x i8] c"Usage: %s [OPTION] group file ...\0A\0AOptions:\0A -R, --recursive\09\09change group of files recursively\0A -v, --verbose\09\09output a diagnostic for every file processed\0A -d, --no-dereference\09\09\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [6 x i8] c"chgrp\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([308 x i8], [308 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [308 x i8] c"Usage: %s [OPTION] group file ...\0A\0AOptions:\0A -R, --recursive\09\09change group of files recursively\0A -v, --verbose\09\09output a diagnostic for every file processed\0A -d, --no-dereference\09\09\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [6 x i8] c"chgrp\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([308 x i8], [308 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int good_coordinates(int row, int col) {
  return row >= 0 && col >= 0 && row < 8 && col < 8;
}


x86 assembly (clang, -O0):
<good_coordinates>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jl     1141 <good_coordinates+0x41>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     1141 <good_coordinates+0x41>
xor    %eax,%eax
cmpl   $0x8,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jge    1141 <good_coordinates+0x41>
cmpl   $0x8,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<good_coordinates>:
mov    %esi,%eax
or     %edi,%eax
setns  %al
cmp    $0x8,%edi
setl   %cl
and    %al,%cl
cmp    $0x8,%esi
setl   %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @good_coordinates(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 = icmp sge i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 8
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 8
br label %16
16: ; preds = %13, %10, %7, %2
%17 = phi i1 [ false, %10 ], [ false, %7 ], [ false, %2 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @good_coordinates(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp sgt i32 %3, -1
%5 = icmp slt i32 %0, 8
%6 = and i1 %5, %4
%7 = icmp slt i32 %1, 8
%8 = and i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
int yg3(int x __attribute((blah)), int y __attribute((blah))) {}


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

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

LLVM IR (-O0):
define i32 @yg3(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* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @yg3(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void showHelp(void) {
  printf(
      "Usage: %s [OPTION]... [FILE]...\n\n    Remove (unlink) the "
      "FILE(s).\n\nOptions:\n    -f, --force\t\t not implemented yet\n    -r, "
      "-R, --recursive  not implemented yet\n    -i, --interactive\t prompt "
      "before every removal\n    -v, --verbose\t explain what is being done\n  "
      "  -h, --help\t\t display this help and exit\n    -V, --version\t "
      "display version information\n\nReport bugs to <bulliver@gmail.com>\n",
      "rm");
}


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

x86 assembly (clang, -O2):
<showHelp>:
lea    0xee9(%rip),%rdi
lea    0x1063(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [385 x i8] c"Usage: %s [OPTION]... [FILE]...\0A\0A Remove (unlink) the FILE(s).\0A\0AOptions:\0A -f, --force\09\09 not implemented yet\0A -r, -R, --recursive not implemented yet\0A -i, --interactive\09 prompt before every removal\0A -v, --verbose\09 explain what is being done\0A -h, --help\09\09 display this help and exit\0A -V, --version\09 display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [3 x i8] c"rm\00"
define void @showHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([385 x i8], [385 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [385 x i8] c"Usage: %s [OPTION]... [FILE]...\0A\0A Remove (unlink) the FILE(s).\0A\0AOptions:\0A -f, --force\09\09 not implemented yet\0A -r, -R, --recursive not implemented yet\0A -i, --interactive\09 prompt before every removal\0A -v, --verbose\09 explain what is being done\0A -h, --help\09\09 display this help and exit\0A -V, --version\09 display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [3 x i8] c"rm\00"
define void @showHelp() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([385 x i8], [385 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ taC(int /*<<< orphan*/);
int main() {
  taC(stdin);
  return 0;
}


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

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

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdin
%3 = call i32 @taC(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @taC(i32 %1)
ret i32 0
}
int integer(double value) { return value; }


x86 assembly (clang, -O0):
<integer>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<integer>:
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @integer(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @integer(double %0) {
%2 = fptosi double %0 to i32
ret i32 %2
}
/* Variables and functions */
unsigned int stb_bitreverse8(unsigned char n) {
  n = ((n & 0xAA) >> 1) + ((n & 0x55) << 1);
  n = ((n & 0xCC) >> 2) + ((n & 0x33) << 2);
  return (unsigned char)((n >> 4) + (n << 4));
}


x86 assembly (clang, -O0):
<stb_bitreverse8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xaa,%eax
sar    $0x1,%eax
movzbl -0x1(%rbp),%ecx
and    $0x55,%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xcc,%eax
sar    $0x2,%eax
movzbl -0x1(%rbp),%ecx
and    $0x33,%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x4,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_bitreverse8>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @stb_bitreverse8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 170
%6 = ashr i32 %5, 1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = and i32 %8, 85
%10 = shl i32 %9, 1
%11 = add nsw i32 %6, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = and i32 %14, 204
%16 = ashr i32 %15, 2
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = and i32 %18, 51
%20 = shl i32 %19, 2
%21 = add nsw i32 %16, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %2
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = ashr i32 %24, 4
%26 = load i8, i8* %2
%27 = zext i8 %26 to i32
%28 = shl i32 %27, 4
%29 = add nsw i32 %25, %28
%30 = trunc i32 %29 to i8
%31 = zext i8 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @stb_bitreverse8(i8 zeroext %0) {
%2 = tail call i8 @llvm.bitreverse.i8(i8 %0)
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void err_sys(const char *x) {
  perror(x);
  exit(1);
}


x86 assembly (clang, -O0):
<err_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_sys>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @err_sys(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @err_sys(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void timeInit() {}


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

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

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

LLVM IR (-O2):
define void @timeInit() {
ret void
}
/* Variables and functions */
char *strtok(char *, char const *);
char *_glp_xstrtok(char *s1, const char *s2) { return strtok(s1, s2); }


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

x86 assembly (clang, -O2):
<_glp_xstrtok>:
jmp    1030 <strtok@plt>

LLVM IR (-O0):
define i8* @_glp_xstrtok(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 i8* @strtok(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @_glp_xstrtok(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strtok(i8* %0, i8* %1)
ret i8* %3
}
int numaNodeCount(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @numaNodeCount() {
ret i32 1
}
/* Variables and functions */
int random(int /*<<< orphan*/, int);
int GetRandomEliteTrait() { return random(0, 21 - 1); }


x86 assembly (clang, -O0):
<GetRandomEliteTrait>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x14,%esi
call   1030 <random@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRandomEliteTrait>:
xor    %edi,%edi
mov    $0x14,%esi
jmp    1030 <random@plt>

LLVM IR (-O0):
define i32 @GetRandomEliteTrait() {
%1 = call i32 @random(i32 0, i32 20)
ret i32 %1
}

LLVM IR (-O2):
define i32 @GetRandomEliteTrait() {
%1 = tail call i32 @random(i32 0, i32 20)
ret i32 %1
}
int int_cmp(int x1, int x2) {
  if (x1 < x2) {
    return -1;
  } else if (x1 > x2) {
    return +1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<int_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1122 <int_cmp+0x22>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <int_cmp+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113a <int_cmp+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <int_cmp+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_cmp>:
xor    %ecx,%ecx
cmp    %esi,%edi
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @int_cmp(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = icmp sgt i32 %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
double tosReal_mul(double x, double y) { return x * y; }


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

x86 assembly (clang, -O2):
<tosReal_mul>:
mulsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @tosReal_mul(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __msgwrite(int sock, void *data, size_t cnt) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__msgwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__msgwrite>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__msgwrite(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__msgwrite(i32 %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, float *);
float get_time(char *str) {
  float time = 0.0f;
  sscanf(str, "%f", &time);
  return time;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xee0(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define float @get_time(i8* %0) {
%2 = alloca i8*
%3 = alloca float
store i8* %0, i8** %2
store float 0.000000e+00, float* %3
%4 = load i8*, i8** %2
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define float @get_time(i8* nocapture %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%5 = load float, float* %2
ret float %5
}
int main() {
  double a = 2.5;
  double b;
  b = 3.6;
  return (int)(a + b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xef5(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 2.500000e+00, double* %2
store double 3.600000e+00, double* %3
%4 = load double, double* %2
%5 = load double, double* %3
%6 = fadd double %4, %5
%7 = fptosi double %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 6
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void I2C2_EV_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @I2C2_EV_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @I2C2_EV_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
void dropbox_queue_event_textfile(char *name, char *path) {}


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

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

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

LLVM IR (-O2):
define void @dropbox_queue_event_textfile(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void ble_rsp_attributes_user_write_response(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @ble_rsp_attributes_user_write_response(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int get_line(char *line, FILE *fp) {
  if (*line == '\0') {
    if (fgets(line, 1024, fp) == NULL) {
      return -1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    115d <get_line+0x4d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x400,%esi
call   1030 <fgets@plt>
cmp    $0x0,%rax
jne    1158 <get_line+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <get_line+0x54>
jmp    115d <get_line+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_line>:
push   %rax
cmpb   $0x0,(%rdi)
jne    1128 <get_line+0x18>
mov    %rsi,%rdx
mov    $0x400,%esi
call   1030 <fgets@plt>
test   %rax,%rax
je     112c <get_line+0x1c>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_line(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i32*, i32** %5
%13 = call i32* @fgets(i8* %11, i32 1024, i32* %12)
%14 = icmp eq i32* %13, null
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 -1, i32* %3
br label %18
16: ; preds = %10
br label %17
17: ; preds = %16, %2
store i32 0, i32* %3
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @get_line(i8* %0, i32* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32* @fgets(i8* %0, i32 1024, i32* %1)
%7 = icmp eq i32* %6, null
br i1 %7, label %9, label %8
8: ; preds = %5, %2
br label %9
9: ; preds = %5, %8
%10 = phi i32 [ 0, %8 ], [ -1, %5 ]
ret i32 %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int rotr(int, int);
uint32_t s0(uint32_t x) { return rotr(x, 7) ^ rotr(x, 18) ^ (x >> 3); }


x86 assembly (clang, -O0):
<s0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x7,%esi
call   1030 <rotr@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x12,%esi
call   1030 <rotr@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x3,%ecx
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s0>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x7,%esi
call   1030 <rotr@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x12,%esi
call   1030 <rotr@plt>
sar    $0x3,%ebx
xor    %ebp,%ebx
xor    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @s0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @rotr(i32 %3, i32 7)
%5 = load i32, i32* %2
%6 = call i32 @rotr(i32 %5, i32 18)
%7 = xor i32 %4, %6
%8 = load i32, i32* %2
%9 = ashr i32 %8, 3
%10 = xor i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @s0(i32 %0) {
%2 = tail call i32 @rotr(i32 %0, i32 7)
%3 = tail call i32 @rotr(i32 %0, i32 18)
%4 = ashr i32 %0, 3
%5 = xor i32 %2, %4
%6 = xor i32 %5, %3
ret i32 %6
}
float Sleef_coshf_u10(float x) { return __builtin_coshf(x); }


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

x86 assembly (clang, -O2):
<Sleef_coshf_u10>:
jmp    1030 <coshf@plt>

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

LLVM IR (-O2):
define float @Sleef_coshf_u10(float %0) {
%2 = tail call float @coshf(float %0)
ret float %2
}
char dolower(const char c) {
  if (c >= 'A' && c <= 'Z')
    return c + 'a' - 'A';
  return c;
}


x86 assembly (clang, -O0):
<dolower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1136 <dolower+0x36>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1136 <dolower+0x36>
movsbl -0x2(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    113c <dolower+0x3c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dolower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @dolower(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 97
%15 = sub nsw i32 %14, 65
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %19
17: ; preds = %7, %1
%18 = load i8, i8* %3
store i8 %18, i8* %2
br label %19
19: ; preds = %17, %11
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @dolower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
void adis16201_uninitialize_ring(struct iio_ring_buffer *ring) {}


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define void @adis16201_uninitialize_ring(%struct.iio_ring_buffer* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ sem_wait(int /*<<< orphan*/ *);
void down(sem_t *sem) { sem_wait(sem); }


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

x86 assembly (clang, -O2):
<down>:
jmp    1030 <sem_wait@plt>

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

LLVM IR (-O2):
define void @down(i32* %0) {
%2 = tail call i32 @sem_wait(i32* %0)
ret void
}