xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *tslib_version();
void usage(char **argv) {
  printf("%s\n", tslib_version());
  printf("Usage: %s [--idev <device>] [--verbose]\n", argv[0]);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <tslib_version@plt>
mov    %rax,%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <tslib_version@plt>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    (%rbx),%rsi
lea    0xec0(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [41 x i8] c"Usage: %s [--idev <device>] [--verbose]\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i8* (...) @tslib_version()
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8**, i8*** %2
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [41 x i8] c"Usage: %s [--idev <device>] [--verbose]\0A\00"
define void @usage(i8** nocapture %0) {
%2 = tail call i8* (...) @tslib_version()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8*, i8** %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
int my_swap(int *a, int *b) {
  int tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
  return (0);
}


x86 assembly (clang, -O0):
<my_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_swap>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @my_swap(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** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @my_swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret i32 0
}
void udelay(unsigned long usec) {
  unsigned long count = 0;
  unsigned long utime = 200000000 / 1000000 * usec;
  while (++count < utime)
    ;
}


x86 assembly (clang, -O0):
<udelay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
imul   $0xc8,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmp    -0x18(%rbp),%rax
jae    1137 <udelay+0x37>
jmp    111c <udelay+0x1c>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @udelay(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
%5 = load i64, i64* %2
%6 = mul i64 200, %5
store i64 %6, i64* %4
br label %7
7: ; preds = %12, %1
%8 = load i64, i64* %3
%9 = add i64 %8, 1
store i64 %9, i64* %3
%10 = load i64, i64* %4
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %7
br label %7
13: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @udelay(i64 %0) {
ret void
}
int hd20_available(void) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @hd20_available() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *indents(int Num, char *OutStr) {
  int i;
  OutStr[0] = '\0';
  for (i = 0; i < Num; i++) {
    sprintf(OutStr, "%s    ", OutStr);
  }
  return (OutStr);
}


x86 assembly (clang, -O0):
<indents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115b <indents+0x4b>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb8(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <indents+0x1d>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indents>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
movb   $0x0,(%rsi)
test   %edi,%edi
jle    1143 <indents+0x33>
mov    %edi,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <sprintf@plt>
add    $0xffffffff,%ebp
jne    1130 <indents+0x20>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s \00"
define i8* @indents(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 0, i8* %7
store i32 0, i32* %5
br label %8
8: ; preds = %16, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = load i8*, i8** %4
%15 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %12
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %8
19: ; preds = %8
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s \00"
define i8* @indents(i32 %0, i8* returned %1) {
store i8 0, i8* %1
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @sprintf(i8* %1, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret i8* %1
}
void mem_blk_set_uint8_null(void *ext, unsigned long addr, unsigned char val) {}


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

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

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

LLVM IR (-O2):
define void @mem_blk_set_uint8_null(i8* nocapture %0, i64 %1, i8 zeroext %2) {
ret void
}
void sysFlash(char *firmware, int len) {}


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

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

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

LLVM IR (-O2):
define void @sysFlash(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int exp(int);
double freal(double x) { return (-2 + 5 * exp(2) - 2 * x); }


x86 assembly (clang, -O0):
<freal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <exp@plt>
imul   $0x5,%eax,%eax
add    $0xfffffffe,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freal>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <exp@plt>
lea    (%rax,%rax,4),%eax
add    $0xfffffffe,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @freal(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @exp(i32 2)
%4 = mul nsw i32 5, %3
%5 = add nsw i32 -2, %4
%6 = sitofp i32 %5 to double
%7 = load double, double* %2
%8 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %7, double %6)
ret double %8
}

LLVM IR (-O2):
define double @freal(double %0) {
%2 = tail call i32 @exp(i32 2)
%3 = mul nsw i32 %2, 5
%4 = add nsw i32 %3, -2
%5 = sitofp i32 %4 to double
%6 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double %5)
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ setNav;

/* Variables and functions */
int /*<<< orphan*/ SendUBX(int, unsigned char *, int);
void InitUBlox(int fd) {
  unsigned char setNav[] = {
      0xB5, 0x62, 0x06, 0x24, 0x24, 0x00, 0xFF, 0xFF, 0x06, 0x03, 0x00,
      0x00, 0x00, 0x00, 0x10, 0x27, 0x00, 0x00, 0x05, 0x00, 0xFA, 0x00,
      0xFA, 0x00, 0x64, 0x00, 0x2C, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0xDC};
  SendUBX(fd, setNav, sizeof(setNav));
}


x86 assembly (clang, -O0):
<InitUBlox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x2c,%edx
call   1040 <memcpy@plt>
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x2c,%edx
call   1030 <SendUBX@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitUBlox>:
sub    $0x38,%rsp
movups 0xf01(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x2c,%edx
call   1030 <SendUBX@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.InitUBlox.setNav = [44 x i8] c"\B5b\06$$\00\FF\FF\06\03\00\00\00\00\10'\00\00\05\00\FA\00\FA\00d\00,\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\16\DC"
define void @InitUBlox(i32 %0) {
%2 = alloca i32
%3 = alloca [44 x i8]
store i32 %0, i32* %2
%4 = bitcast [44 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [44 x i8], [44 x i8]* %3, i64 0, i64 0
%7 = call i32 @SendUBX(i32 %5, i8* %6, i32 44)
ret void
}

LLVM IR (-O2):
@__const.InitUBlox.setNav = [44 x i8] c"\B5b\06$$\00\FF\FF\06\03\00\00\00\00\10'\00\00\05\00\FA\00\FA\00d\00,\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\16\DC"
define void @InitUBlox(i32 %0) {
%2 = alloca [44 x i8]
%3 = getelementptr inbounds [44 x i8], [44 x i8]* %2, i64 0, i64 0
%4 = call i32 @SendUBX(i32 %0, i8* %3, i32 44)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a_0_55(int, char *);
void a_0_60(void) {
  { a_0_55(((((4)))), "DO?"); }
}


x86 assembly (clang, -O0):
<a_0_60>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
lea    0xee0(%rip),%rsi
call   1030 <a_0_55@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_0_60>:
lea    0xee9(%rip),%rsi
mov    $0x4,%edi
jmp    1030 <a_0_55@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"DO?\00"
define void @a_0_60() {
%1 = call i32 @a_0_55(i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"DO?\00"
define void @a_0_60() {
%1 = tail call i32 @a_0_55(i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *joystick_standard_init() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @joystick_standard_init() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @joystick_standard_init() {
ret i8* null
}
int base64_encoded_len(int len) { return ((len + 2) / 3) * 4; }


x86 assembly (clang, -O0):
<base64_encoded_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_encoded_len>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @base64_encoded_len(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
%5 = sdiv i32 %4, 3
%6 = mul nsw i32 %5, 4
ret i32 %6
}

LLVM IR (-O2):
define i32 @base64_encoded_len(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl nsw i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ikitwin_sleep(long);
void iscreen_sleep(long millisecond) { ikitwin_sleep(millisecond); }


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

x86 assembly (clang, -O2):
<iscreen_sleep>:
jmp    1030 <ikitwin_sleep@plt>

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

LLVM IR (-O2):
define void @iscreen_sleep(i64 %0) {
%2 = tail call i32 @ikitwin_sleep(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cmd_mv_cp(int, char *, int /*<<< orphan*/);
void cmd_mv(int idx, char *par) { cmd_mv_cp(idx, par, 0); }


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

x86 assembly (clang, -O2):
<cmd_mv>:
xor    %edx,%edx
jmp    1030 <cmd_mv_cp@plt>

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

LLVM IR (-O2):
define void @cmd_mv(i32 %0, i8* %1) {
%3 = tail call i32 @cmd_mv_cp(i32 %0, i8* %1, i32 0)
ret void
}
int generic_phy_exit(struct phy *phy) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.phy = type opaque
define i32 @generic_phy_exit(%struct.phy* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
void UARTFIFOLevelGet(unsigned long ulBase, unsigned long *pulTxLevel,
                      unsigned long *pulRxLevel) {
  unsigned long ulTemp;
  DEBUG_ASSERT(UARTBaseValid(ulBase));
  ulTemp = (*((volatile unsigned long *)(ulBase + 0x00000034)));
  *pulTxLevel = ulTemp & 0x00000007;
  *pulRxLevel = ulTemp & 0x00000038;
}


x86 assembly (clang, -O0):
<UARTFIFOLevelGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
and    $0x7,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
and    $0x38,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFIFOLevelGet>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    0x34(%rbx),%rax
mov    %eax,%ecx
and    $0x7,%ecx
mov    %rcx,(%r15)
and    $0x38,%eax
mov    %rax,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @UARTFIFOLevelGet(i64 %0, i64* %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca i64
store i64 %0, i64* %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%8 = load i64, i64* %4
%9 = call i32 @UARTBaseValid(i64 %8)
%10 = call i32 @DEBUG_ASSERT(i32 %9)
%11 = load i64, i64* %4
%12 = add i64 %11, 52
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
store i64 %14, i64* %7
%15 = load i64, i64* %7
%16 = and i64 %15, 7
%17 = load i64*, i64** %5
store i64 %16, i64* %17
%18 = load i64, i64* %7
%19 = and i64 %18, 56
%20 = load i64*, i64** %6
store i64 %19, i64* %20
ret void
}

LLVM IR (-O2):
define void @UARTFIFOLevelGet(i64 %0, i64* nocapture writeonly %1, i64* nocapture writeonly %2) {
%4 = tail call i32 @UARTBaseValid(i64 %0)
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 52
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, 7
store i64 %9, i64* %1
%10 = and i64 %8, 56
store i64 %10, i64* %2
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t WatchdogReloadGet(void) {
  return ((*((volatile unsigned long *)(0x40080000 + 0x00000000))));
}


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

x86 assembly (clang, -O2):
<WatchdogReloadGet>:
mov    0x40080000,%rax
40
ret

LLVM IR (-O0):
define i64 @WatchdogReloadGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074266112 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @WatchdogReloadGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074266112 to i64*)
ret i64 %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t rtp_get_cc(const uint8_t *p_rtp) { return p_rtp[0] & 0xf; }


x86 assembly (clang, -O0):
<rtp_get_cc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_get_cc>:
mov    (%rdi),%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @rtp_get_cc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, 15
ret i32 %6
}

LLVM IR (-O2):
define i32 @rtp_get_cc(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 15
ret i32 %3
}
int _sfcCertificateAuthenticate(void *cert, char **principal, int mode) {
  return 0;
}


x86 assembly (clang, -O0):
<_sfcCertificateAuthenticate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_sfcCertificateAuthenticate(i8* nocapture readnone %0, i8** nocapture readnone %1, i32 %2) {
ret i32 0
}
adrx0reg1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((((double *)10000000)[x0]) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0reg1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movslq -0x1c(%rbp),%rcx
mov    $0x989680,%eax
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1145 <adrx0reg1+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <adrx0reg1+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0reg1>:
movslq %edi,%rcx
xor    %eax,%eax
ucomisd 0x989680(,%rcx,8),%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @adrx0reg1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load i32, i32* %10
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %15
%17 = load double, double* %16
%18 = load double, double* %9
%19 = fcmp ole double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @adrx0reg1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %7
%9 = load double, double* %8
%10 = fcmp ole double %9, %1
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello, World.\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int testB(x) const int x;
{
  int i;
  if ((i = getb()) == x)
    return 1;
  ungetb(i);
  return 0;
}


x86 assembly (clang, -O0):
<testB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getb@plt>
mov    %eax,-0xc(%rbp)
cmp    -0x8(%rbp),%eax
jne    114a <testB+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    115b <testB+0x3b>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1040 <ungetb@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testB>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getb@plt>
mov    $0x1,%ecx
cmp    %ebx,%eax
je     113e <testB+0x1e>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <ungetb@plt>
xor    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @testB(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 (...) @getb()
store i32 %5, i32* %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* %4
%11 = call i32 (i32, ...) bitcast (i32 (...)* @ungetb to i32 (i32, ...)*)(i32 %10)
store i32 0, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @testB(i32 %0) {
%2 = tail call i32 (...) @getb()
%3 = icmp eq i32 %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @ungetb to i32 (i32, ...)*)(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int solvemefirst(void) {
  int num1, num2;
  scanf("%d %d", &num1, &num2);
  printf("%d", num1 + num2);
  return 0;
}


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

x86 assembly (clang, -O2):
<solvemefirst>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @solvemefirst() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
unsigned int bm_byte_order(unsigned int col) { return col; }


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

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

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

LLVM IR (-O2):
define i32 @bm_byte_order(i32 returned %0) {
ret i32 %0
}
void grid_clear(int sudoku[9][9]) {
  int v;
  int h;
  int pos;
  pos = 82;
  while (pos--) {
    v = pos / 9;
    h = pos % 9;
    sudoku[v][h] = 0;
  }
}


x86 assembly (clang, -O0):
<grid_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x52,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     115e <grid_clear+0x5e>
mov    -0x14(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    110f <grid_clear+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<grid_clear>:
mov    $0x4e,%eax
xorps  %xmm0,%xmm0
nopl   0x0(%rax,%rax,1)
movups %xmm0,(%rdi,%rax,4)
movups %xmm0,-0x10(%rdi,%rax,4)
add    $0xfffffffffffffff8,%rax
cmp    $0xfffffffe,%eax
jne    1110 <grid_clear+0x10>
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @grid_clear([9 x i32]* %0) {
%2 = alloca [9 x i32]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store [9 x i32]* %0, [9 x i32]** %2
store i32 82, i32* %5
br label %6
6: ; preds = %10, %1
%7 = load i32, i32* %5
%8 = add nsw i32 %7, -1
store i32 %8, i32* %5
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i32, i32* %5
%12 = sdiv i32 %11, 9
store i32 %12, i32* %3
%13 = load i32, i32* %5
%14 = srem i32 %13, 9
store i32 %14, i32* %4
%15 = load [9 x i32]*, [9 x i32]** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [9 x i32], [9 x i32]* %15, i64 %17
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [9 x i32], [9 x i32]* %18, i64 0, i64 %20
store i32 0, i32* %21
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @grid_clear([9 x i32]* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %20, %2 ]
%4 = sub nuw nsw i32 81, %3
%5 = udiv i32 %4, 9
%6 = urem i32 %4, 9
%7 = zext i32 %5 to i64
%8 = zext i32 %6 to i64
%9 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %7, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 -3
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %11
%12 = sub nsw i32 77, %3
%13 = udiv i32 %12, 9
%14 = urem i32 %12, 9
%15 = zext i32 %13 to i64
%16 = zext i32 %14 to i64
%17 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 %15, i64 %16
%18 = getelementptr inbounds i32, i32* %17, i64 -3
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> zeroinitializer, <4 x i32>* %19
%20 = add nuw nsw i32 %3, 8
%21 = icmp eq i32 %20, 80
br i1 %21, label %22, label %2
22: ; preds = %2
%23 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 0, i64 1
store i32 0, i32* %23
%24 = getelementptr inbounds [9 x i32], [9 x i32]* %0, i64 0, i64 0
store i32 0, i32* %24
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int main(void) {
  long int x = 3147483647;
  unsigned long int y = 3147483647;
  printf("signed long: %d\n", x);
  printf("unsigned long: %u\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xbb9ac9ff,%eax
mov    %rax,-0x10(%rbp)
mov    $0xbb9ac9ff,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"signed long: %d\0A\00"
@.str.1 = [19 x i8] c"unsigned long: %u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 3147483647)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i64 3147483647)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void nmstermio_move_cursor(int y, int x) { printf("\033[%i;%iH", y, x); }


x86 assembly (clang, -O0):
<nmstermio_move_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmstermio_move_cursor>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%i;%iH\00"
define void @nmstermio_move_cursor(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 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%i;%iH\00"
define void @nmstermio_move_cursor(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
double strtod_i8n(char const *, int /*<<< orphan*/ *);
double atof_i8n(const char *str) { return strtod_i8n(str, NULL); }


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

x86 assembly (clang, -O2):
<atof_i8n>:
xor    %esi,%esi
jmp    1030 <strtod_i8n@plt>

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

LLVM IR (-O2):
define double @atof_i8n(i8* %0) {
%2 = tail call double @strtod_i8n(i8* %0, i32* null)
ret double %2
}
double exponent(double a, double ex) {
  double result = a;
  for (int i = 1; i < ex; ++i)
    result = result * a;
  return result;
}


x86 assembly (clang, -O0):
<exponent>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1150 <exponent+0x50>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111f <exponent+0x1f>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponent>:
ucomisd 0xef8(%rip),%xmm1
jbe    1139 <exponent+0x39>
mov    $0x2,%eax
movapd %xmm0,%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm3,%xmm3
cvtsi2sd %eax,%xmm3
mulsd  %xmm0,%xmm2
add    $0x1,%eax
ucomisd %xmm3,%xmm1
ja     1120 <exponent+0x20>
movapd %xmm2,%xmm0
ret
movaps %xmm0,%xmm2
movaps %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @exponent(double %0, double %1) {
%3 = fcmp ogt double %1, 1.000000e+00
br i1 %3, label %6, label %4
4: ; preds = %6, %2
%5 = phi double [ %0, %2 ], [ %9, %6 ]
ret double %5
6: ; preds = %2, %6
%7 = phi i32 [ %10, %6 ], [ 1, %2 ]
%8 = phi double [ %9, %6 ], [ %0, %2 ]
%9 = fmul double %8, %0
%10 = add nuw nsw i32 %7, 1
%11 = sitofp i32 %10 to double
%12 = fcmp olt double %11, %1
br i1 %12, label %6, label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int _mm_comige_sd(int /*<<< orphan*/, int /*<<< orphan*/);
int test_mm_comige_sd(__m128d A, __m128d B) { return _mm_comige_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_comige_sd>:
jmp    1030 <_mm_comige_sd@plt>

LLVM IR (-O0):
define i32 @test_mm_comige_sd(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 @_mm_comige_sd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_comige_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_comige_sd(i32 %0, i32 %1)
ret i32 %3
}
__typeof__(isprint((void *)1)) test_isprint_45(void) {
  return isprint((void *)1);
}


x86 assembly (clang, -O0):
<test_isprint_45>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
mov    %eax,%edi
call   1030 <isprint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isprint_45>:
mov    $0x1,%edi
jmp    1030 <isprint@plt>

LLVM IR (-O0):
define i32 @test_isprint_45() {
%1 = call i32 @isprint(i32 ptrtoint (i8* inttoptr (i64 1 to i8*) to i32))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_isprint_45() {
%1 = tail call i32 @isprint(i32 1)
ret i32 %1
}
/* Variables and functions */
scalar_t__ toupper(char);
char *uppercase(char *str) {
  int i = 0;
  do {
    str[i] = (char)toupper(str[i]);
  } while (str[i++] != '\0');
  return str;
}


x86 assembly (clang, -O0):
<uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1123 <uppercase+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uppercase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <uppercase+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @uppercase(i8* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %8, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = tail call i64 @toupper(i8 signext %5)
%7 = trunc i64 %6 to i8
store i8 %7, i8* %4
%8 = add nuw i64 %3, 1
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %2
10: ; preds = %2
ret i8* %0
}
/* Variables and functions */
void pthread_exit(int /*<<< orphan*/ *);
void ltfs_thread_exit_detached(void) { return pthread_exit(NULL); }


x86 assembly (clang, -O0):
<ltfs_thread_exit_detached>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ltfs_thread_exit_detached() {
tail call void @pthread_exit(i32* null)
ret void
}
/* Type definitions */
struct cxl_ioctl_start_work {
  int /*<<< orphan*/ num_interrupts;
};
typedef int /*<<< orphan*/ __s16;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int cxl_work_get_num_irqs(struct cxl_ioctl_start_work *work, __s16 *valp) {
  if (work == NULL) {
    errno = EINVAL;
    return -1;
  }
  *valp = work->num_interrupts;
  return 0;
}


x86 assembly (clang, -O0):
<cxl_work_get_num_irqs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1135 <cxl_work_get_num_irqs+0x35>
mov    0x2eba(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <cxl_work_get_num_irqs+0x48>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cxl_work_get_num_irqs>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %cl
jne    1118 <cxl_work_get_num_irqs+0x18>
mov    0x2ec7(%rip),%rdi
mov    0x2ec8(%rip),%rsi
mov    %cl,%al
neg    %eax
mov    (%rdi),%ecx
mov    %ecx,(%rsi)
ret

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

LLVM IR (-O2):
%struct.cxl_ioctl_start_work = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @cxl_work_get_num_irqs(%struct.cxl_ioctl_start_work* %0, i32* nocapture writeonly %1) {
%3 = icmp eq %struct.cxl_ioctl_start_work* %0, null
%4 = getelementptr inbounds %struct.cxl_ioctl_start_work, %struct.cxl_ioctl_start_work* %0, i64 0, i32 0
%5 = select i1 %3, i32* @EINVAL, i32* %4
%6 = select i1 %3, i32* @errno, i32* %1
%7 = sext i1 %3 to i32
%8 = load i32, i32* %5
store i32 %8, i32* %6
ret i32 %7
}
/* Variables and functions */
double EvalPoly(double *, int, double);
double Obliquity(double T) {
  double u;
  static double OblPoly[11] = {84381.448, -4680.93, -1.55,  1999.25,
                               -51.38,    -249.67,  -39.05, 7.12,
                               27.87,     5.79,     2.45};
  u = T / 100;
  return EvalPoly(OblPoly, 10, u) * ((3.14159265358979323846 / 180) / 3600);
}


x86 assembly (clang, -O0):
<Obliquity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0x2ef1(%rip),%rdi
mov    $0xa,%esi
call   1030 <EvalPoly@plt>
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Obliquity>:
push   %rax
divsd  0xee7(%rip),%xmm0
lea    0x2f10(%rip),%rdi
mov    $0xa,%esi
call   1030 <EvalPoly@plt>
mulsd  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@Obliquity.OblPoly = internal global [11 x double] [double 0x40F499D72B020C4A, double -4.680930e+03, double -1.550000e+00, double 1.999250e+03, double -5.138000e+01, double -2.496700e+02, double -3.905000e+01, double 7.120000e+00, double 2.787000e+01, double 5.790000e+00, double 2.450000e+00]
define double @Obliquity(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 1.000000e+02
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @EvalPoly(double* getelementptr inbounds ([11 x double], [11 x double]* @Obliquity.OblPoly, i64 0, i64 0), i32 10, double %6)
%8 = fmul double %7, 0x3ED455A5B2FF8F9D
ret double %8
}

LLVM IR (-O2):
@Obliquity.OblPoly = internal global [11 x double] [double 0x40F499D72B020C4A, double -4.680930e+03, double -1.550000e+00, double 1.999250e+03, double -5.138000e+01, double -2.496700e+02, double -3.905000e+01, double 7.120000e+00, double 2.787000e+01, double 5.790000e+00, double 2.450000e+00]
define double @Obliquity(double %0) {
%2 = fdiv double %0, 1.000000e+02
%3 = tail call double @EvalPoly(double* getelementptr inbounds ([11 x double], [11 x double]* @Obliquity.OblPoly, i64 0, i64 0), i32 10, double %2)
%4 = fmul double %3, 0x3ED455A5B2FF8F9D
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ recurser_void1(int /*<<< orphan*/);
int main() {
  recurser_void1(0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <recurser_void1@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <recurser_void1@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @recurser_void1(i32 0)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @recurser_void1(i32 0)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int array[], int length) {
  int i;
  for (i = 0; i < length; i++)
    printf("%3d ", array[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%3d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%3d \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}