xunge/DecIR huggingface dataset:
outasm(ptr) char *ptr;
{
  while (outbyte(raise(*ptr++)))
    ;
}


x86 assembly (clang, -O0):
<outasm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <raise@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <outbyte@plt>
cmp    $0x0,%eax
je     115c <outasm+0x3c>
jmp    112c <outasm+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outasm>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
add    $0x1,%rbx
xor    %eax,%eax
call   1030 <raise@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <outbyte@plt>
test   %eax,%eax
jne    1130 <outasm+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @outasm(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @raise to i32 (i32, ...)*)(i32 %6)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @outbyte to i32 (i32, ...)*)(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %2
10: ; preds = %2
ret i32 undef
}
void althrd_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @althrd_deinit() {
ret void
}
int ffs(int i) {
  int count = 1;
  if (i == 0)
    return 0;
  while ((i & 1) != 1) {
    i >>= 1;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1124 <ffs+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1155 <ffs+0x55>
jmp    1129 <ffs+0x29>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
je     114f <ffs+0x4f>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <ffs+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
test   %edi,%edi
je     112e <ffs+0x2e>
mov    $0x1,%eax
test   $0x1,%dil
jne    112d <ffs+0x2d>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
test   $0x2,%dil
mov    %ecx,%edi
je     1120 <ffs+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = phi i32 [ %9, %6 ], [ %0, %3 ]
%9 = ashr i32 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ SysCtlDelay(int);
void _EEPROMSectorMaskSet(uint32_t ui32Address) {
  uint32_t ui32Mask;
  ui32Mask = ~(1 << (ui32Address >> 7));
  SysCtlDelay(10);
  (*((volatile uint32_t *)(0x400FD0FC))) = 3;
  SysCtlDelay(10);
  (*((volatile uint32_t *)(0x400AE2C0))) = ui32Mask;
  SysCtlDelay(10);
  (*((volatile uint32_t *)(0x400FD0FC))) = 0;
  SysCtlDelay(10);
}


x86 assembly (clang, -O0):
<_EEPROMSectorMaskSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    $0x400fd0fc,%eax
movl   $0x3,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    -0x8(%rbp),%ecx
mov    $0x400ae2c0,%eax
mov    %ecx,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    $0x400fd0fc,%eax
movl   $0x0,(%rax)
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_EEPROMSectorMaskSet>:
push   %rbx
mov    %edi,%ecx
shr    $0x7,%ecx
mov    $0xfffffffe,%ebx
rol    %cl,%ebx
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
movl   $0x3,0x400fd0fc
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
mov    %ebx,0x400ae2c0
mov    $0xa,%edi
call   1030 <SysCtlDelay@plt>
movl   $0x0,0x400fd0fc
mov    $0xa,%edi
pop    %rbx
jmp    1030 <SysCtlDelay@plt>

LLVM IR (-O0):
define void @_EEPROMSectorMaskSet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 7
%6 = shl i32 1, %5
%7 = xor i32 %6, -1
store i32 %7, i32* %3
%8 = call i32 @SysCtlDelay(i32 10)
store volatile i32 3, i32* inttoptr (i64 1074778364 to i32*)
%9 = call i32 @SysCtlDelay(i32 10)
%10 = load i32, i32* %3
store volatile i32 %10, i32* inttoptr (i64 1074455232 to i32*)
%11 = call i32 @SysCtlDelay(i32 10)
store volatile i32 0, i32* inttoptr (i64 1074778364 to i32*)
%12 = call i32 @SysCtlDelay(i32 10)
ret void
}

LLVM IR (-O2):
define void @_EEPROMSectorMaskSet(i32 %0) {
%2 = ashr i32 %0, 7
%3 = shl nuw i32 1, %2
%4 = xor i32 %3, -1
%5 = tail call i32 @SysCtlDelay(i32 10)
store volatile i32 3, i32* inttoptr (i64 1074778364 to i32*)
%6 = tail call i32 @SysCtlDelay(i32 10)
store volatile i32 %4, i32* inttoptr (i64 1074455232 to i32*)
%7 = tail call i32 @SysCtlDelay(i32 10)
store volatile i32 0, i32* inttoptr (i64 1074778364 to i32*)
%8 = tail call i32 @SysCtlDelay(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ansi_escape(char *);
void term_cursor_toggle(int show) {
  if (show) {
    ansi_escape("?25h");
  } else {
    ansi_escape("?25l");
  }
}


x86 assembly (clang, -O0):
<term_cursor_toggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <term_cursor_toggle+0x26>
lea    0xed4(%rip),%rdi
call   1030 <ansi_escape@plt>
jmp    1142 <term_cursor_toggle+0x32>
lea    0xec8(%rip),%rdi
call   1030 <ansi_escape@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_cursor_toggle>:
test   %edi,%edi
lea    0xeec(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <ansi_escape@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"?25h\00"
@.str.1 = [5 x i8] c"?25l\00"
define void @term_cursor_toggle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @ansi_escape(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @ansi_escape(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"?25h\00"
@.str.1 = [5 x i8] c"?25l\00"
define void @term_cursor_toggle(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @ansi_escape(i8* %3)
ret void
}
void Default_Handler(void) {
  while (1) {
    ;
  }
}


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

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

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

LLVM IR (-O2):
define void @Default_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void do_print_ssl(void) {
  printf("SSL: %s\n", cubesql_sslversion());
  printf("SSL num: %X\n\n", (unsigned int)cubesql_sslversion_num());
}


x86 assembly (clang, -O0):
<do_print_ssl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <cubesql_sslversion@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <cubesql_sslversion_num@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_print_ssl>:
push   %rax
xor    %eax,%eax
call   1030 <cubesql_sslversion@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <cubesql_sslversion_num@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"SSL: %s\0A\00"
@.str.1 = [14 x i8] c"SSL num: %X\0A\0A\00"
define void @do_print_ssl() {
%1 = call i32 (...) @cubesql_sslversion()
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @cubesql_sslversion_num()
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"SSL: %s\0A\00"
@.str.1 = [14 x i8] c"SSL num: %X\0A\0A\00"
define void @do_print_ssl() {
%1 = tail call i32 (...) @cubesql_sslversion()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @cubesql_sslversion_num()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int __u16;

/* Variables and functions */
int hea_u16_bit(int);
int hea_test_u16_bit(__u16 v, int b) { return !!(v & hea_u16_bit(b)); }


x86 assembly (clang, -O0):
<hea_test_u16_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <hea_u16_bit@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hea_test_u16_bit>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <hea_u16_bit@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hea_test_u16_bit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @hea_u16_bit(i32 %6)
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @hea_test_u16_bit(i32 %0, i32 %1) {
%3 = tail call i32 @hea_u16_bit(i32 %1)
%4 = and i32 %3, %0
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int lstat(const char *file_name, struct stat *buf) {
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<lstat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec4(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lstat>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@ENOENT = global i32 0
@errno = global i32 0
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @ENOENT
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@ENOENT = global i32 0
@errno = global i32 0
define i32 @lstat(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1) {
%3 = load i32, i32* @ENOENT
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ beep_shutdown();
void keyer_shutdown(void) { beep_shutdown(); }


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

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

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

LLVM IR (-O2):
define void @keyer_shutdown() {
%1 = tail call i32 (...) @beep_shutdown()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *a, int b) {
  assert(0);
}


x86 assembly (clang, -O0):
<pthread_mutexattr_setprioceiling>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pthread_mutexattr_setprioceiling(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 @assert(i32 0)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @pthread_mutexattr_setprioceiling(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ mat3d_rotateAxisVec_new(double *, double, double const *);
int /*<<< orphan*/ mat4d_from_mat3d(double *, double *);
void mat4d_rotateAxisVec_new(double result[16], double degrees,
                             const double axis[3]) {
  double tmpMat[9];
  mat3d_rotateAxisVec_new(tmpMat, degrees, axis);
  mat4d_from_mat3d(result, tmpMat);
}


x86 assembly (clang, -O0):
<mat4d_rotateAxisVec_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
call   1040 <mat3d_rotateAxisVec_new@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <mat4d_from_mat3d@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat4d_rotateAxisVec_new>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <mat3d_rotateAxisVec_new@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <mat4d_from_mat3d@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mat4d_rotateAxisVec_new(double* %0, double %1, double* %2) {
%4 = alloca double*
%5 = alloca double
%6 = alloca double*
%7 = alloca [9 x double]
store double* %0, double** %4
store double %1, double* %5
store double* %2, double** %6
%8 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%9 = load double, double* %5
%10 = load double*, double** %6
%11 = call i32 @mat3d_rotateAxisVec_new(double* %8, double %9, double* %10)
%12 = load double*, double** %4
%13 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%14 = call i32 @mat4d_from_mat3d(double* %12, double* %13)
ret void
}

LLVM IR (-O2):
define void @mat4d_rotateAxisVec_new(double* %0, double %1, double* %2) {
%4 = alloca [9 x double]
%5 = bitcast [9 x double]* %4 to i8*
%6 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 0
%7 = call i32 @mat3d_rotateAxisVec_new(double* %6, double %1, double* %2)
%8 = call i32 @mat4d_from_mat3d(double* %0, double* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __no_gpio_code_for_this_architecture__();
int gpio_get(int gpio) {
  __no_gpio_code_for_this_architecture__();
  return -1;
}


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

x86 assembly (clang, -O2):
<gpio_get>:
push   %rax
xor    %eax,%eax
call   1030 <__no_gpio_code_for_this_architecture__@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gpio_get(i32 %0) {
%2 = tail call i32 (...) @__no_gpio_code_for_this_architecture__()
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void gcc_print(int value, int type) {
  if (type == -2) {
    printf("%d\n", value);
  } else if (type == -1) {
    printf("#<void>\n");
  } else {
    printf("#<procedure>\n");
  }
}


x86 assembly (clang, -O0):
<gcc_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xfffffffe,-0x8(%rbp)
jne    113e <gcc_print+0x2e>
mov    -0x4(%rbp),%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116e <gcc_print+0x5e>
cmpl   $0xffffffff,-0x8(%rbp)
jne    115b <gcc_print+0x4b>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1169 <gcc_print+0x59>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116e <gcc_print+0x5e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcc_print>:
cmp    $0xffffffff,%esi
je     113c <gcc_print+0x1c>
cmp    $0xfffffffe,%esi
jne    1148 <gcc_print+0x28>
mov    %edi,%eax
lea    0xecd(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xece(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xeb5(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [9 x i8] c"#<void>\0A\00"
@.str.2 = [14 x i8] c"#<procedure>\0A\00"
define void @gcc_print(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 = icmp eq i32 %5, -2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %18
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %17
15: ; preds = %10
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
br label %18
18: ; preds = %17, %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@str = [13 x i8] c"#<procedure>\00"
@str.3 = [8 x i8] c"#<void>\00"
define void @gcc_print(i32 %0, i32 %1) {
switch i32 %1, label %7 [
i32 -2, label %3
i32 -1, label %5
]
3: ; preds = %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %9
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.3, i64 0, i64 0))
br label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %5, %7, %3
ret void
}
void gtk_tree_path_down() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_path_down() {
ret void
}
int test_imm_C1uint16_mem(unsigned short *val) {
  return ((*val) & (0xC1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C1uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 193
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void get_subdirname(void) { printf("power"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"power\00"
define void @get_subdirname() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int errno;
int errno_geterrno(void) { return errno; }


x86 assembly (clang, -O0):
<errno_geterrno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errno_geterrno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @errno_geterrno() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @errno_geterrno() {
%1 = load i32, i32* @errno
ret i32 %1
}
int is_left_bracket_char(char c) { return (c == '['); }


x86 assembly (clang, -O0):
<is_left_bracket_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x5b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_left_bracket_char>:
xor    %eax,%eax
cmp    $0x5b,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_left_bracket_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 91
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_left_bracket_char(i8 signext %0) {
%2 = icmp eq i8 %0, 91
%3 = zext i1 %2 to i32
ret i32 %3
}
void sth(unsigned short *p, unsigned short x) { p[15] = x; }


x86 assembly (clang, -O0):
<sth>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,0x1e(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sth>:
mov    %si,0x1e(%rdi)
ret

LLVM IR (-O0):
define void @sth(i16* %0, i16 zeroext %1) {
%3 = alloca i16*
%4 = alloca i16
store i16* %0, i16** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i16*, i16** %3
%7 = getelementptr inbounds i16, i16* %6, i64 15
store i16 %5, i16* %7
ret void
}

LLVM IR (-O2):
define void @sth(i16* nocapture writeonly %0, i16 zeroext %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 15
store i16 %1, i16* %3
ret void
}
char loCase(const char c) { return ('A' <= c && c <= 'Z') ? c - 'A' + 'a' : c; }


x86 assembly (clang, -O0):
<loCase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     113a <loCase+0x3a>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     113a <loCase+0x3a>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <loCase+0x41>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @loCase(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
}
struct kobject *kobject_get(struct kobject *x) {
  struct kobject *a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.kobject = type opaque
define %struct.kobject* @kobject_get(%struct.kobject* %0) {
%2 = alloca %struct.kobject*
%3 = alloca %struct.kobject*
store %struct.kobject* %0, %struct.kobject** %2
%4 = load %struct.kobject*, %struct.kobject** %3
ret %struct.kobject* %4
}

LLVM IR (-O2):
%struct.kobject = type opaque
define noalias %struct.kobject* @kobject_get(%struct.kobject* nocapture readnone %0) {
ret %struct.kobject* undef
}
unsigned long asm_bts(unsigned long *f, unsigned long i) {
  unsigned long ret;
  asm("btsq %2, %1 \n"
      "sbbq %0, %0"
      : "=r"(ret)
      : "m"(*f), "r"(i));
  return ret;
}


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

x86 assembly (clang, -O2):
<asm_bts>:
bts    %rsi,(%rdi)
sbb    %rax,%rax
ret

LLVM IR (-O0):
define i64 @asm_bts(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%6 = load i64*, i64** %3
%7 = load i64, i64* %4
%8 = call i64 asm "btsq $2, $1 \0Asbbq $0, $0", "=r,*m,r,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @asm_bts(i64* %0, i64 %1) {
%3 = tail call i64 asm "btsq $2, $1 \0Asbbq $0, $0", "=r,*m,r,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
char *strchr(char *, char);
void MwChomp(char *p) {
  if ((p = strchr(p, '\n')))
    *p = '\0';
}


x86 assembly (clang, -O0):
<MwChomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     113f <MwChomp+0x2f>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MwChomp>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <MwChomp+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @MwChomp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strchr(i8* %3, i8 signext 10)
store i8* %4, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i8*, i8** %2
store i8 0, i8* %7
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @MwChomp(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *);
int /*<<< orphan*/ scanf(char *, char *);
size_t strlen(char *);
void ui__getString(char *s, const char *message) {
  printf(message);
  scanf("%s", s);
  s[strlen(s)] = '\0';
  return;
}


x86 assembly (clang, -O0):
<ui__getString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui__getString>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @ui__getString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %3
%11 = call i64 @strlen(i8* %10)
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @ui__getString(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) %1)
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret void
}
/* Variables and functions */
int add(int, int);
int div(int, int);
int mul(int, int);
int /*<<< orphan*/ printf(char *, int, int, int, int);
int sub(int, int);
int main() {
  int a = add(3, 5);
  int b = sub(3, 5);
  int c = mul(3, 5);
  int d = div(3, 5);
  printf("Results <- %i - %i - %i - %i ->", a, b, c, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <add@plt>
mov    %eax,-0x8(%rbp)
mov    $0x3,%edi
mov    $0x5,%esi
call   1070 <sub@plt>
mov    %eax,-0xc(%rbp)
mov    $0x3,%edi
mov    $0x5,%esi
call   1060 <mul@plt>
mov    %eax,-0x10(%rbp)
mov    $0x3,%edi
mov    $0x5,%esi
call   1050 <div@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xe45(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <add@plt>
mov    %eax,%r14d
mov    $0x3,%edi
mov    $0x5,%esi
call   1070 <sub@plt>
mov    %eax,%ebp
mov    $0x3,%edi
mov    $0x5,%esi
call   1060 <mul@plt>
mov    %eax,%ebx
mov    $0x3,%edi
mov    $0x5,%esi
call   1050 <div@plt>
lea    0xe62(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Results <- %i - %i - %i - %i ->\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @add(i32 3, i32 5)
store i32 %6, i32* %2
%7 = call i32 @sub(i32 3, i32 5)
store i32 %7, i32* %3
%8 = call i32 @mul(i32 3, i32 5)
store i32 %8, i32* %4
%9 = call i32 @div(i32 3, i32 5)
store i32 %9, i32* %5
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"Results <- %i - %i - %i - %i ->\00"
define i32 @main() {
%1 = tail call i32 @add(i32 3, i32 5)
%2 = tail call i32 @sub(i32 3, i32 5)
%3 = tail call i32 @mul(i32 3, i32 5)
%4 = tail call i32 @div(i32 3, i32 5)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4)
ret i32 0
}
int foo18() { return 18; }


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

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

LLVM IR (-O0):
define i32 @foo18() {
ret i32 18
}

LLVM IR (-O2):
define i32 @foo18() {
ret i32 18
}
void G_WriteLevel(const char *filename) {}


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

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

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

LLVM IR (-O2):
define void @G_WriteLevel(i8* nocapture %0) {
ret void
}
int __ev_ri1_changed() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__ev_ri1_changed() {
ret i32 0
}
int do_981() { return 981; }


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

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

LLVM IR (-O0):
define i32 @do_981() {
ret i32 981
}

LLVM IR (-O2):
define i32 @do_981() {
ret i32 981
}
/* Variables and functions */
int /*<<< orphan*/ update_queen(size_t, unsigned int **, size_t, size_t, int);
void remove_queen(size_t x, unsigned board[x][x], size_t px, size_t py) {
  update_queen(x, board, px, py, -1);
}


x86 assembly (clang, -O0):
<remove_queen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xffffffff,%r8d
call   1030 <update_queen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_queen>:
mov    $0xffffffff,%r8d
jmp    1030 <update_queen@plt>

LLVM IR (-O0):
define void @remove_queen(i64 %0, i32* %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i32* %1, i32** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %5
%11 = load i64, i64* %5
%12 = load i32*, i32** %6
%13 = bitcast i32* %12 to i32**
%14 = load i64, i64* %7
%15 = load i64, i64* %8
%16 = call i32 @update_queen(i64 %11, i32** %13, i64 %14, i64 %15, i32 -1)
ret void
}

LLVM IR (-O2):
define void @remove_queen(i64 %0, i32* %1, i64 %2, i64 %3) {
%5 = bitcast i32* %1 to i32**
%6 = tail call i32 @update_queen(i64 %0, i32** %5, i64 %2, i64 %3, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_status(char **, int);
int run(char **);
void rmmod(char *name) {
  char *args[] = {"/sbin/rmmod", name, NULL};
  int status;
  status = run(args);
  check_status(args, status);
}


x86 assembly (clang, -O0):
<rmmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <run@plt>
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <check_status@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmmod>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rax
mov    %rax,(%rsp)
mov    %rdi,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <run@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <check_status@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/sbin/rmmod\00"
define void @rmmod(i8* %0) {
%2 = alloca i8*
%3 = alloca [3 x i8*]
%4 = alloca i32
store i8* %0, i8** %2
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %2
store i8* %7, i8** %6
%8 = getelementptr inbounds i8*, i8** %6, i64 1
store i8* null, i8** %8
%9 = getelementptr inbounds [3 x i8*], [3 x i8*]* %3, i64 0, i64 0
%10 = call i32 @run(i8** %9)
store i32 %10, i32* %4
%11 = getelementptr inbounds [3 x i8*], [3 x i8*]* %3, i64 0, i64 0
%12 = load i32, i32* %4
%13 = call i32 @check_status(i8** %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"/sbin/rmmod\00"
define void @rmmod(i8* %0) {
%2 = alloca [3 x i8*]
%3 = bitcast [3 x i8*]* %2 to i8*
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 1
store i8* %0, i8** %5
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 2
store i8* null, i8** %6
%7 = call i32 @run(i8** %4)
%8 = call i32 @check_status(i8** %4, i32 %7)
ret void
}
/* Variables and functions */
char *strdup(char *);
char *safedup(char *in) {
  char *p = strdup(in);
  return (p == NULL) ? "<null>" : p;
}


x86 assembly (clang, -O0):
<safedup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <safedup+0x34>
lea    0xec5(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    114c <safedup+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safedup>:
push   %rax
call   1030 <strdup@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"<null>\00"
define i8* @safedup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndexedXX0(int);
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
void Op9DM1X0(void) { STA8(AbsoluteIndexedXX0(2)); }


x86 assembly (clang, -O0):
<Op9DM1X0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <AbsoluteIndexedXX0@plt>
mov    %eax,%edi
call   1040 <STA8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op9DM1X0>:
push   %rax
mov    $0x2,%edi
call   1030 <AbsoluteIndexedXX0@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <STA8@plt>

LLVM IR (-O0):
define void @Op9DM1X0() {
%1 = call i32 @AbsoluteIndexedXX0(i32 2)
%2 = call i32 @STA8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op9DM1X0() {
%1 = tail call i32 @AbsoluteIndexedXX0(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void _usage(char *cmd) {
  fprintf(stderr,
          "%s <BD base dir> [-s <seconds>]\n"
          "   List the titles and title info of a BD\n"
          "   -s #    - Filter out titles shorter than # seconds\n"
          "   -a      - List all titles\n"
          "   -h      - This message\n",
          cmd);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [184 x i8] c"%s <BD base dir> [-s <seconds>]\0A List the titles and title info of a BD\0A -s # - Filter out titles shorter than # seconds\0A -a - List all titles\0A -h - This message\0A\00"
@EXIT_FAILURE = global i32 0
define void @_usage(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 ([184 x i8], [184 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [184 x i8] c"%s <BD base dir> [-s <seconds>]\0A List the titles and title info of a BD\0A -s # - Filter out titles shorter than # seconds\0A -a - List all titles\0A -h - This message\0A\00"
@EXIT_FAILURE = global i32 0
define void @_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ atof(char *);
scalar_t__ getline(char *, int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  char line[200];
  while (getline(line, 200) != 0) {
    printf("%lf\n", atof(line));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
mov    $0xc8,%esi
call   1050 <getline@plt>
cmp    $0x0,%rax
je     117c <main+0x4c>
lea    -0xd0(%rbp),%rdi
call   1030 <atof@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
mov    %rsp,%rdi
mov    $0xc8,%esi
call   1050 <getline@plt>
test   %rax,%rax
je     1184 <main+0x54>
mov    %rsp,%rbx
lea    0xeaa(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <atof@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1050 <getline@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%5 = call i64 @getline(i8* %4, i32 200)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%9 = call i32 @atof(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i64 @getline(i8* %2, i32 200)
%4 = icmp eq i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0, %5
%6 = call i32 @atof(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i64 @getline(i8* %2, i32 200)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %0
ret i32 0
}
int g(int x) { return x + sizeof(x); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
lea    0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = add i64 %4, 4
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = add i32 %0, 4
ret i32 %2
}
int setTTyStat(int fd, void *sg, int sz) { return -1; }


x86 assembly (clang, -O0):
<setTTyStat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @setTTyStat(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @setTTyStat(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
int main() {
  char c;
  printf("Enter character: ");
  c = getchar();
  printf("Character entered:       ");
  putchar(c);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
movsbl %bl,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter character: \00"
@.str.1 = [26 x i8] c"Character entered: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8, i8* %2
%7 = call i32 @putchar(i8 signext %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter character: \00"
@.str.1 = [26 x i8] c"Character entered: \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @getchar()
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @putchar(i8 signext %2)
ret i32 0
}
void _irq_rtc(void) {}


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

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

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

LLVM IR (-O2):
define void @_irq_rtc() {
ret void
}
void HAL_wait(void) {
  __asm volatile("nop");
  __asm volatile("nop");
}


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

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

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

LLVM IR (-O2):
define void @HAL_wait() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}