xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
int main() {
  int pid;
  if ((pid = fork()) < 0)
    printf("fork error\n");
  else if (pid == 0)
    _exit(0);
  sleep(2);
  system("ps -o pid,ppid,state,tty,command");
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <fork@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1183 <main+0x33>
lea    0xe87(%rip),%rdi
call   1050 <printf@plt>
jmp    1199 <main+0x49>
cmpl   $0x0,-0x8(%rbp)
jne    1194 <main+0x44>
xor    %edi,%edi
call   1030 <_exit@plt>
jmp    1199 <main+0x49>
mov    $0x2,%edi
call   1060 <sleep@plt>
lea    0xe62(%rip),%rdi
call   1040 <system@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <fork@plt>
test   %eax,%eax
jns    116a <main+0x1a>
lea    0xebe(%rip),%rdi
call   1040 <puts@plt>
jmp    1173 <main+0x23>
jne    1173 <main+0x23>
xor    %edi,%edi
call   1030 <_exit@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
lea    0xe7c(%rip),%rdi
call   1050 <system@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"fork error\0A\00"
@.str.1 = [33 x i8] c"ps -o pid,ppid,state,tty,command\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @fork()
store i32 %3, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @_exit(i32 0)
unreachable
12: ; preds = %7
br label %13
13: ; preds = %12, %5
%14 = call i32 @sleep(i32 2)
%15 = call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [33 x i8] c"ps -o pid,ppid,state,tty,command\00"
@str = [11 x i8] c"fork error\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = icmp eq i32 %1, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @_exit(i32 0)
unreachable
9: ; preds = %5, %3
%10 = tail call i32 @sleep(i32 2)
%11 = tail call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 @_exit(i32 0)
unreachable
}
void av_get_time_base_q() {}


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

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

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

LLVM IR (-O2):
define void @av_get_time_base_q() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ attribute;

/* Variables and functions */
int get_sysfs_uint(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int get_DiskType(char *scsi) {
  char attribute[256];
  memset(attribute, 0, sizeof(attribute));
  snprintf(attribute, sizeof(attribute) - 1,
           "/sys/class/scsi_device/%s/device/type", scsi);
  return (get_sysfs_uint(attribute));
}


x86 assembly (clang, -O0):
<get_DiskType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0xff,%esi
lea    0xe97(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x110(%rbp),%rdi
call   1050 <get_sysfs_uint@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_DiskType>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
lea    0xeaa(%rip),%rdx
mov    %r14,%rdi
mov    $0xff,%esi
mov    %rbx,%rcx
call   1030 <snprintf@plt>
mov    %r14,%rdi
call   1050 <get_sysfs_uint@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [38 x i8] c"/sys/class/scsi_device/%s/device/type\00"
define i32 @get_DiskType(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 256)
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @snprintf(i8* %6, i32 255, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%10 = call i32 @get_sysfs_uint(i8* %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [38 x i8] c"/sys/class/scsi_device/%s/device/type\00"
define i32 @get_DiskType(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 256)
%5 = call i32 @snprintf(i8* %3, i32 255, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = call i32 @get_sysfs_uint(i8* %3)
ret i32 %6
}
/* Variables and functions */
double bar(double);
double foo(double d) { return bar(d); }


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

x86 assembly (clang, -O2):
<foo>:
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define double @foo(double %0) {
%2 = tail call double @bar(double %0)
ret double %2
}
int a_gcd(int a, int b) {
  int c;
  if (b < 0)
    b = -b;
  if (b > a) {
    c = a;
    a = b;
    b = c;
  }
  for (; b; b = c) {
    c = a % b;
    a = b;
  }
  return a;
}


x86 assembly (clang, -O0):
<a_gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111c <a_gcd+0x1c>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    113a <a_gcd+0x3a>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113f <a_gcd+0x3f>
cmpl   $0x0,-0x8(%rbp)
je     1164 <a_gcd+0x64>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113f <a_gcd+0x3f>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_gcd>:
mov    %esi,%edx
neg    %edx
cmovs  %esi,%edx
cmp    %edi,%edx
mov    %edi,%eax
cmovg  %edx,%eax
cmovg  %edi,%edx
test   %edx,%edx
je     112d <a_gcd+0x2d>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1120 <a_gcd+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @a_gcd(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%4 = icmp sgt i32 %3, %0
%5 = select i1 %4, i32 %3, i32 %0
%6 = select i1 %4, i32 %0, i32 %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %8
%9 = phi i32 [ %11, %8 ], [ %6, %2 ]
%10 = phi i32 [ %9, %8 ], [ %5, %2 ]
%11 = srem i32 %10, %9
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %2
%14 = phi i32 [ %5, %2 ], [ %9, %8 ]
ret i32 %14
}
/* Variables and functions */
int my_strcpy(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char a[15];
  char *b = "This is a test";
  int l;
  l = my_strcpy(a, b);
  printf("%i chars copied\n", l);
  printf("%s\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x13(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <my_strcpy@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x13(%rbp),%rsi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rsi
lea    0x1(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <my_strcpy@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"This is a test\00"
@.str.1 = [17 x i8] c"%i chars copied\0A\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%6 = load i8*, i8** %3
%7 = call i32 @my_strcpy(i8* %5, i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"This is a test\00"
@.str.1 = [17 x i8] c"%i chars copied\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @my_strcpy(i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int is_vswap_mode(void) { return (access("/proc/vz/vswap", F_OK) == 0); }


x86 assembly (clang, -O0):
<is_vswap_mode>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <access@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_vswap_mode>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/proc/vz/vswap\00"
@F_OK = global i32 0
define i32 @is_vswap_mode() {
%1 = load i32, i32* @F_OK
%2 = call i64 @access(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@.str = [15 x i8] c"/proc/vz/vswap\00"
@F_OK = global i32 0
define i32 @is_vswap_mode() {
%1 = load i32, i32* @F_OK
%2 = tail call i64 @access(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int bar(int, int);
int foo(int a, int b) { return bar(b, a); }


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

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i32 @foo(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 = load i32, i32* %3
%7 = call i32 @bar(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = tail call i32 @bar(i32 %1, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned long, unsigned long,
                           unsigned long, unsigned long);
const char *IPlongtostr(unsigned long IP) {
  static char buf[16];
  sprintf(buf, "%lu.%lu.%lu.%lu", (IP >> 24), (IP >> 16) & 255, (IP >> 8) & 255,
          IP & 255);
  return buf;
}


x86 assembly (clang, -O0):
<IPlongtostr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x18,%rdx
mov    -0x8(%rbp),%rcx
shr    $0x10,%rcx
and    $0xff,%rcx
mov    -0x8(%rbp),%r8
shr    $0x8,%r8
and    $0xff,%r8
mov    -0x8(%rbp),%r9
and    $0xff,%r9
lea    0x2eec(%rip),%rdi
lea    0xea5(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ed9(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IPlongtostr>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rdx
mov    %edx,%eax
movzbl %dh,%ebp
movzbl %dl,%r9d
shr    $0x18,%rdx
shr    $0x10,%eax
movzbl %al,%ecx
lea    0x2f10(%rip),%rbx
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
mov    %rbp,%r8
call   1030 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@IPlongtostr.buf = internal global [16 x i8] zeroinitializer
@.str = [16 x i8] c"%lu.%lu.%lu.%lu\00"
define i8* @IPlongtostr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 24
%5 = load i64, i64* %2
%6 = lshr i64 %5, 16
%7 = and i64 %6, 255
%8 = load i64, i64* %2
%9 = lshr i64 %8, 8
%10 = and i64 %9, 255
%11 = load i64, i64* %2
%12 = and i64 %11, 255
%13 = call i32 @sprintf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @IPlongtostr.buf, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %7, i64 %10, i64 %12)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @IPlongtostr.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@IPlongtostr.buf = internal global [16 x i8] zeroinitializer
@.str = [16 x i8] c"%lu.%lu.%lu.%lu\00"
define i8* @IPlongtostr(i64 %0) {
%2 = lshr i64 %0, 24
%3 = lshr i64 %0, 16
%4 = and i64 %3, 255
%5 = lshr i64 %0, 8
%6 = and i64 %5, 255
%7 = and i64 %0, 255
%8 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @IPlongtostr.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %2, i64 %4, i64 %6, i64 %7)
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @IPlongtostr.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
void _makeNonBlocking(int fd) {
  fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<_makeNonBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %eax,%edx
mov    0x2e99(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_makeNonBlocking>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebc(%rip),%rax
mov    (%rax),%ebp
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    0x2eb3(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @_makeNonBlocking(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* %2
%6 = load i32, i32* @F_GETFL
%7 = call i32 (i32, i32, ...) @fcntl(i32 %5, i32 %6)
%8 = load i32, i32* @O_NONBLOCK
%9 = or i32 %7, %8
%10 = call i32 (i32, i32, ...) @fcntl(i32 %3, i32 %4, i32 %9)
ret void
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @_makeNonBlocking(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @F_GETFL
%4 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %3)
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %4
%7 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2, i32 %6)
ret void
}
int equal_default(const void *a, const void *b) { return a == b; }


x86 assembly (clang, -O0):
<equal_default>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_default>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @equal_default(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 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @equal_default(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ factors(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int x;
  printf("Enter the value of x:\n");
  scanf("%d", &x);
  factors(x);
}


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

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

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [22 x i8] c"Enter the value of x:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @factors(i32 %5)
ret i32 0
}
float deg2radf(float x) { return x * 1.7453292519943295e-2f; }


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

x86 assembly (clang, -O2):
<deg2radf>:
mulss  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define float @deg2radf(float %0) {
%2 = fmul float %0, 0x3F91DF46A0000000
ret float %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int is_valid_channel(uint8_t channel_num) {
  if ((channel_num <= 0x0B) || (channel_num >= 0x0E && channel_num <= 0x0F)) {
    return 0;
  } else {
    return (-1);
  }
}


x86 assembly (clang, -O0):
<is_valid_channel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xb,-0x8(%rbp)
jle    1125 <is_valid_channel+0x25>
cmpl   $0xe,-0x8(%rbp)
jl     1131 <is_valid_channel+0x31>
cmpl   $0xf,-0x8(%rbp)
jg     1131 <is_valid_channel+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1138 <is_valid_channel+0x38>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_channel>:
cmp    $0xc,%edi
setge  %al
and    $0xfffffffe,%edi
cmp    $0xe,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @is_valid_channel(i32 %0) {
%2 = icmp sgt i32 %0, 11
%3 = and i32 %0, -2
%4 = icmp ne i32 %3, 14
%5 = and i1 %2, %4
%6 = sext i1 %5 to i32
ret i32 %6
}
unsigned int mem_hash(ptr) void **ptr;
{
  unsigned long lp = (unsigned long)ptr;
  return (lp % 509);
}


x86 assembly (clang, -O0):
<mem_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x1fd,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_hash>:
movabs $0x10182436517a3753,%rcx
24 18 10
mov    %rdi,%rax
mul    %rcx
shr    $0x5,%rdx
imul   $0x1fd,%edx,%eax
sub    %eax,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @mem_hash(i8** %0) {
%2 = alloca i8**
%3 = alloca i64
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = ptrtoint i8** %4 to i64
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = urem i64 %6, 509
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @mem_hash(i8** %0) {
%2 = ptrtoint i8** %0 to i64
%3 = urem i64 %2, 509
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
char *malloc(int);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
char *getCurrentTimeString() {
  char *tBuff = malloc(sizeof(char) * 100);
  time_t currentTime = time(0);
  strftime(tBuff, 100, "%Y-%m-%d %H:%M:%S", localtime(&currentTime));
  return tBuff;
}


x86 assembly (clang, -O0):
<getCurrentTimeString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%ecx
mov    $0x64,%esi
lea    0xe7d(%rip),%rdx
call   1060 <strftime@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrentTimeString>:
push   %rbx
sub    $0x10,%rsp
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe92(%rip),%rdx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    %eax,%ecx
call   1060 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @getCurrentTimeString() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i8* @malloc(i32 100)
store i8* %3, i8** %1
%4 = call i32 @time(i32 0)
store i32 %4, i32* %2
%5 = load i8*, i8** %1
%6 = call i32 @localtime(i32* %2)
%7 = call i32 @strftime(i8* %5, i32 100, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @getCurrentTimeString() {
%1 = alloca i32
%2 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @time(i32 0)
store i32 %4, i32* %1
%5 = call i32 @localtime(i32* %1)
%6 = call i32 @strftime(i8* %2, i32 100, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i8* %2
}
void foo624(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo624(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_53(int /*<<< orphan*/);
int gen_53() { handle_53(0); }


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

x86 assembly (clang, -O2):
<gen_53>:
xor    %edi,%edi
jmp    1030 <handle_53@plt>

LLVM IR (-O0):
define i32 @gen_53() {
%1 = alloca i32
%2 = call i32 @handle_53(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_53() {
%1 = tail call i32 @handle_53(i32 0)
ret i32 undef
}
int chex2i(char c) {
  if (c >= 'a')
    return (c - 'a' + 10);
  else if (c >= 'A')
    return (c - 'A' + 10);
  return (c - '0');
}


x86 assembly (clang, -O0):
<chex2i>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <chex2i+0x29>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <chex2i+0x57>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <chex2i+0x48>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <chex2i+0x57>
jmp    114d <chex2i+0x4d>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chex2i>:
cmp    $0x41,%dil
mov    $0xffffffc9,%eax
mov    $0xffffffd0,%ecx
cmovge %eax,%ecx
cmp    $0x61,%dil
mov    $0xffffffa9,%eax
cmovl  %ecx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @chex2i(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp sgt i8 %0, 96
%4 = icmp sgt i8 %0, 64
%5 = select i1 %4, i32 -55, i32 -48
%6 = select i1 %3, i32 -87, i32 %5
%7 = add nsw i32 %6, %2
ret i32 %7
}
int is_in_bound(int *arr, int size, int *ptr) {
  if (arr > ptr || (arr + size - 1) < ptr) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
ja     113a <is_in_bound+0x3a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0xfffffffffffffffc,%rax
cmp    -0x20(%rbp),%rax
jae    1146 <is_in_bound+0x46>
movl   $0x0,-0x4(%rbp)
jmp    114d <is_in_bound+0x4d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
cmp    %rdx,%rdi
setbe  %al
movslq %esi,%rcx
lea    (%rdi,%rcx,4),%rcx
add    $0xfffffffffffffffc,%rcx
cmp    %rdx,%rcx
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_in_bound(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** %7
%10 = icmp ugt i32* %8, %9
br i1 %10, label %19, label %11
11: ; preds = %3
%12 = load i32*, i32** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = getelementptr inbounds i32, i32* %15, i64 -1
%17 = load i32*, i32** %7
%18 = icmp ult i32* %16, %17
br i1 %18, label %19, label %20
19: ; preds = %11, %3
store i32 0, i32* %4
br label %21
20: ; preds = %11
store i32 1, i32* %4
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = icmp ule i32* %0, %2
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = getelementptr inbounds i32, i32* %6, i64 -1
%8 = icmp uge i32* %7, %2
%9 = select i1 %4, i1 %8, i1 false
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_foo() { printf("from bar\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"from bar\0A\00"
define void @print_foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"from bar\00"
define void @print_foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
int test_and(int a, int b, int c) {
  if (a < b && b > c)
    return 5;
  else
    return 4;
}


x86 assembly (clang, -O0):
<test_and>:
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    1131 <test_and+0x31>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1131 <test_and+0x31>
movl   $0x5,-0x4(%rbp)
jmp    1138 <test_and+0x38>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and>:
cmp    %esi,%edi
setl   %al
cmp    %edx,%esi
setg   %cl
and    %al,%cl
movzbl %cl,%eax
or     $0x4,%eax
ret

LLVM IR (-O0):
define i32 @test_and(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 %16
11: ; preds = %3
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 5, i32* %4
br label %17
16: ; preds = %11, %3
store i32 4, i32* %4
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @test_and(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %1, %2
%6 = and i1 %4, %5
%7 = select i1 %6, i32 5, i32 4
ret i32 %7
}
long lflip(long x) {
  union {
    char b[4];
    long l;
  } in, out;
  in.l = x;
  out.b[0] = in.b[3];
  out.b[1] = in.b[2];
  out.b[2] = in.b[1];
  out.b[3] = in.b[0];
  return out.l;
}


x86 assembly (clang, -O0):
<lflip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0xd(%rbp),%al
mov    %al,-0x18(%rbp)
mov    -0xe(%rbp),%al
mov    %al,-0x17(%rbp)
mov    -0xf(%rbp),%al
mov    %al,-0x16(%rbp)
mov    -0x10(%rbp),%al
mov    %al,-0x15(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i64 }
define i64 @lflip(i64 %0) {
%2 = alloca i64
%3 = alloca %union.anon
%4 = alloca %union.anon
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = bitcast %union.anon* %3 to i64*
store i64 %5, i64* %6
%7 = bitcast %union.anon* %3 to [4 x i8]*
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 3
%9 = load i8, i8* %8
%10 = bitcast %union.anon* %4 to [4 x i8]*
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
store i8 %9, i8* %11
%12 = bitcast %union.anon* %3 to [4 x i8]*
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 2
%14 = load i8, i8* %13
%15 = bitcast %union.anon* %4 to [4 x i8]*
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %15, i64 0, i64 1
store i8 %14, i8* %16
%17 = bitcast %union.anon* %3 to [4 x i8]*
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %17, i64 0, i64 1
%19 = load i8, i8* %18
%20 = bitcast %union.anon* %4 to [4 x i8]*
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %20, i64 0, i64 2
store i8 %19, i8* %21
%22 = bitcast %union.anon* %3 to [4 x i8]*
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %22, i64 0, i64 0
%24 = load i8, i8* %23
%25 = bitcast %union.anon* %4 to [4 x i8]*
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %25, i64 0, i64 3
store i8 %24, i8* %26
%27 = bitcast %union.anon* %4 to i64*
%28 = load i64, i64* %27
ret i64 %28
}

LLVM IR (-O2):
define i64 @lflip(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
char *min_str(char *l, char *r) {
  return ((l < r && l != NULL) || (r == NULL) ? l : r);
}


x86 assembly (clang, -O0):
<min_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1125 <min_str+0x25>
cmpq   $0x0,-0x8(%rbp)
jne    1130 <min_str+0x30>
cmpq   $0x0,-0x10(%rbp)
jne    113d <min_str+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1145 <min_str+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_str>:
cmp    %rsi,%rdi
mov    %rsi,%rax
cmovb  %rdi,%rax
test   %rdi,%rdi
cmove  %rsi,%rax
test   %rsi,%rsi
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i8* @min_str(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 = icmp ult i8* %5, %6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %8, %2
%12 = load i8*, i8** %4
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %11, %8
%15 = load i8*, i8** %3
br label %18
16: ; preds = %11
%17 = load i8*, i8** %4
br label %18
18: ; preds = %16, %14
%19 = phi i8* [ %15, %14 ], [ %17, %16 ]
ret i8* %19
}

LLVM IR (-O2):
define i8* @min_str(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ne i8* %0, null
%5 = and i1 %4, %3
%6 = icmp eq i8* %1, null
%7 = or i1 %6, %5
%8 = select i1 %7, i8* %0, i8* %1
ret i8* %8
}
void fa34(void) {
P0A:
  goto P0A;
  ({
    P01A:
      goto P01A;
      ({
        p012A:
          goto p012A;
          goto a;
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
a:
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa34>:
push   %rbp
mov    %rsp,%rbp
jmp    1104 <fa34+0x4>

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

LLVM IR (-O0):
define void @fa34() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %7, %0
br label %7
8: ; No predecessors!
br label %9
9: ; preds = %9, %8
br label %9
10: ; No predecessors!
br label %11
11: ; preds = %11, %10
br label %11
12: ; preds = %12
br label %12
13: ; preds = %13
br label %13
14: ; No predecessors!
br label %15
15: ; preds = %15, %14
br label %15
16: ; preds = %16
br label %16
17: ; No predecessors!
br label %18
18: ; preds = %18, %17
br label %18
19: ; No predecessors!
br label %20
20: ; preds = %20, %19
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

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


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

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

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

LLVM IR (-O2):
define void @cpuhvfs_get_pause_status_i2c() {
ret void
}
int mksym_i32() { return 0; }


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

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

LLVM IR (-O0):
define i32 @mksym_i32() {
ret i32 0
}

LLVM IR (-O2):
define i32 @mksym_i32() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nrf_802154_request_cca_cfg_update();
void nrf_802154_temperature_changed(void) {
  nrf_802154_request_cca_cfg_update();
}


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

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

LLVM IR (-O0):
define void @nrf_802154_temperature_changed() {
%1 = call i32 (...) @nrf_802154_request_cca_cfg_update()
ret void
}

LLVM IR (-O2):
define void @nrf_802154_temperature_changed() {
%1 = tail call i32 (...) @nrf_802154_request_cca_cfg_update()
ret void
}
/* Variables and functions */
scalar_t__ isalpha(int);
int toupper(int);
int hex2n(char c) {
  int b = toupper((int)c);
  return (isalpha(b) ? (b - 'A' + 10) : (b - '0'));
}


x86 assembly (clang, -O0):
<hex2n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     115d <hex2n+0x3d>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    1166 <hex2n+0x46>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2n>:
push   %rbx
call   1030 <toupper@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <isalpha@plt>
lea    -0x37(%rbx),%ecx
add    $0xffffffd0,%ebx
test   %rax,%rax
cmovne %ecx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hex2n(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 @toupper(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i64 @isalpha(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 65
%13 = add nsw i32 %12, 10
br label %17
14: ; preds = %1
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 48
br label %17
17: ; preds = %14, %10
%18 = phi i32 [ %13, %10 ], [ %16, %14 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @hex2n(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = tail call i32 @toupper(i32 %2)
%4 = tail call i64 @isalpha(i32 %3)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i32 -48, i32 -55
%7 = add nsw i32 %6, %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ CG_Argv(int);
int /*<<< orphan*/ CG_Printf(char *);
int trap_Argc();
int /*<<< orphan*/ trap_SendConsoleCommand(int /*<<< orphan*/);
int /*<<< orphan*/ va(char *, int /*<<< orphan*/);
void CG_vstrUp_f(void) {
  if (trap_Argc() == 5)
    trap_SendConsoleCommand(va("vstr %s;", CG_Argv(2)));
  else
    CG_Printf("[cgnotify]Usage: +vstr [down_vstr] [up_vstr]\n");
}


x86 assembly (clang, -O0):
<CG_vstrUp_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <trap_Argc@plt>
cmp    $0x5,%eax
jne    1188 <CG_vstrUp_f+0x38>
mov    $0x2,%edi
call   1030 <CG_Argv@plt>
mov    %eax,%esi
lea    0xe89(%rip),%rdi
call   1060 <va@plt>
mov    %eax,%edi
call   1070 <trap_SendConsoleCommand@plt>
jmp    1194 <CG_vstrUp_f+0x44>
lea    0xe7a(%rip),%rdi
call   1050 <CG_Printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_vstrUp_f>:
push   %rax
xor    %eax,%eax
call   1040 <trap_Argc@plt>
cmp    $0x5,%eax
jne    117d <CG_vstrUp_f+0x2d>
mov    $0x2,%edi
call   1030 <CG_Argv@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
call   1060 <va@plt>
mov    %eax,%edi
pop    %rax
jmp    1070 <trap_SendConsoleCommand@plt>
lea    0xe85(%rip),%rdi
pop    %rax
jmp    1050 <CG_Printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"vstr %s;\00"
@.str.1 = [46 x i8] c"[cgnotify]Usage: +vstr [down_vstr] [up_vstr]\0A\00"
define void @CG_vstrUp_f() {
%1 = call i32 (...) @trap_Argc()
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 @CG_Argv(i32 2)
%5 = call i32 @va(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @trap_SendConsoleCommand(i32 %5)
br label %9
7: ; preds = %0
%8 = call i32 @CG_Printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"vstr %s;\00"
@.str.1 = [46 x i8] c"[cgnotify]Usage: +vstr [down_vstr] [up_vstr]\0A\00"
define void @CG_vstrUp_f() {
%1 = tail call i32 (...) @trap_Argc()
%2 = icmp eq i32 %1, 5
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @CG_Argv(i32 2)
%5 = tail call i32 @va(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @trap_SendConsoleCommand(i32 %5)
br label %9
7: ; preds = %0
%8 = tail call i32 @CG_Printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}
int kolibri_get_width_bitmap(void *bitmap) {}


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

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

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

LLVM IR (-O2):
define i32 @kolibri_get_width_bitmap(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ pollen_interfaces_Gpio_toggle__E();
void pollen_parts_Led_toggle__E() { pollen_interfaces_Gpio_toggle__E(); }


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

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

LLVM IR (-O0):
define void @pollen_parts_Led_toggle__E() {
%1 = call i32 (...) @pollen_interfaces_Gpio_toggle__E()
ret void
}

LLVM IR (-O2):
define void @pollen_parts_Led_toggle__E() {
%1 = tail call i32 (...) @pollen_interfaces_Gpio_toggle__E()
ret void
}
/* Type definitions */
struct catmc_atomic_signed_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_signed_char *);
void catmc_atomic_signed_char_destroy(
    struct catmc_atomic_signed_char *wrapper) {
  free(wrapper);
}


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

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

LLVM IR (-O2):
%struct.catmc_atomic_signed_char = type { i32 }
define void @catmc_atomic_signed_char_destroy(%struct.catmc_atomic_signed_char* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_signed_char* %0)
ret void
}
main() {
  struct A {
    int i, j;
  };
  struct A x, y = {1, 2};
  x = y;
  return x.i + x.j;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.A = type { i32, i32 }
@__const.main.y = %struct.A { i32 1, i32 2 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.A
%3 = alloca %struct.A
store i32 0, i32* %1
%4 = bitcast %struct.A* %3 to i8*
%5 = bitcast %struct.A* %2 to i8*
%6 = bitcast %struct.A* %3 to i8*
%7 = getelementptr inbounds %struct.A, %struct.A* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.A, %struct.A* %2, i32 0, i32 1
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int opt_store_0(char *arg, void *data) {
  assert(!arg && data);
  *(int *)data = 0;
  return 0;
}


x86 assembly (clang, -O0):
<opt_store_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jne    113b <opt_store_0+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_store_0>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
sete   %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
movl   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @opt_store_0(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 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %4
%15 = bitcast i8* %14 to i32*
store i32 0, i32* %15
ret i32 0
}

LLVM IR (-O2):
define i32 @opt_store_0(i8* readnone %0, i8* writeonly %1) {
%3 = icmp eq i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = bitcast i8* %1 to i32*
store i32 0, i32* %8
ret i32 0
}