xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ set_val(int, unsigned char);
int /*<<< orphan*/ udelay(int);
void write_cmd(unsigned char addr, unsigned short data) {
  set_val(0x7F001008, (addr << 16) | data);
  udelay(1000);
}


x86 assembly (clang, -O0):
<write_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x10,%eax
movzwl -0x4(%rbp),%ecx
or     %ecx,%eax
mov    $0x7f001008,%edi
movzbl %al,%esi
call   1030 <set_val@plt>
mov    $0x3e8,%edi
call   1040 <udelay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_cmd>:
push   %rax
movzbl %sil,%esi
mov    $0x7f001008,%edi
call   1030 <set_val@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1040 <udelay@plt>

LLVM IR (-O0):
define void @write_cmd(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 16
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = or i32 %7, %9
%11 = trunc i32 %10 to i8
%12 = call i32 @set_val(i32 2130710536, i8 zeroext %11)
%13 = call i32 @udelay(i32 1000)
ret void
}

LLVM IR (-O2):
define void @write_cmd(i8 zeroext %0, i16 zeroext %1) {
%3 = trunc i16 %1 to i8
%4 = tail call i32 @set_val(i32 2130710536, i8 zeroext %3)
%5 = tail call i32 @udelay(i32 1000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *, char *, int /*<<< orphan*/);
void int_11(void) { panic("Segment Not Present", "#NP", 0); }


x86 assembly (clang, -O0):
<int_11>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef2(%rip),%rsi
xor    %edx,%edx
call   1030 <panic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_11>:
lea    0xee9(%rip),%rdi
lea    0xef6(%rip),%rsi
xor    %edx,%edx
jmp    1030 <panic@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Segment Not Present\00"
@.str.1 = [4 x i8] c"#NP\00"
define void @int_11() {
%1 = call i32 @panic(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Segment Not Present\00"
@.str.1 = [4 x i8] c"#NP\00"
define void @int_11() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ipc_write(int, int);
void ipc_init(void) { ipc_write(1, 0x06); }


x86 assembly (clang, -O0):
<ipc_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x6,%esi
call   1030 <ipc_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipc_init>:
mov    $0x1,%edi
mov    $0x6,%esi
jmp    1030 <ipc_write@plt>

LLVM IR (-O0):
define void @ipc_init() {
%1 = call i32 @ipc_write(i32 1, i32 6)
ret void
}

LLVM IR (-O2):
define void @ipc_init() {
%1 = tail call i32 @ipc_write(i32 1, i32 6)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void ivory_hw_io_write_u16(uint32_t addr, uint16_t value) {
  *((volatile uint16_t *)addr) = value;
}


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

x86 assembly (clang, -O2):
<ivory_hw_io_write_u16>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @ivory_hw_io_write_u16(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i64, i64* %3
%7 = inttoptr i64 %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @ivory_hw_io_write_u16(i64 %0, i32 %1) {
%3 = inttoptr i64 %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void check_input(int argc) {
  if (argc < 3) {
    printf("Usage: ./fconc infile1 infile2 [outfile (default: focnc.out)]\n");
    exit(EXIT_FAILURE);
  } else if (argc > 4) {
    printf("Usage: ./fconc infile1 infile2 [outfile (default: focnc.out)]\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<check_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    114f <check_input+0x2f>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
cmpl   $0x4,-0x4(%rbp)
jle    1173 <check_input+0x53>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
jmp    1178 <check_input+0x58>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_input>:
push   %rax
cmp    $0x2,%edi
jle    112d <check_input+0xd>
cmp    $0x5,%edi
jae    112d <check_input+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"Usage: ./fconc infile1 infile2 [outfile (default: focnc.out)]\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_input(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 4
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %9
br label %17
17: ; preds = %16
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str.1 = [62 x i8] c"Usage: ./fconc infile1 infile2 [outfile (default: focnc.out)]\00"
define void @check_input(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
%8 = icmp ugt i32 %0, 4
br i1 %8, label %9, label %13
9: ; preds = %7
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.1, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = tail call i32 @exit(i32 %11)
unreachable
13: ; preds = %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void syserror(const char *fx) {
  perror(fx);
  exit(1);
}


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

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

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

LLVM IR (-O2):
define void @syserror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
char *strcpy(char *dest, const char *src) {
  char *destStart = dest;
  while (*src)
    *dest++ = *src++;
  *dest = '\0';
  return destStart;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <strcpy+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
scalar_t__ isspace(char const);
void sbcs_scan_spaces_(const char **p) {
  while (isspace(**p)) {
    (*p)++;
  }
}


x86 assembly (clang, -O0):
<sbcs_scan_spaces_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1148 <sbcs_scan_spaces_+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <sbcs_scan_spaces_+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcs_scan_spaces_>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
movsbl (%rax),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <isspace@plt>
test   %rax,%rax
je     113a <sbcs_scan_spaces_+0x2a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1120 <sbcs_scan_spaces_+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @sbcs_scan_spaces_(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %9, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = call i64 @isspace(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8**, i8*** %2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %10
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @sbcs_scan_spaces_(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i64 @isspace(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = load i8, i8* %8
%10 = tail call i64 @isspace(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushback(unsigned long);
void pbunsigned(unsigned long n) {
  do {
    pushback(n % 10 + '0');
  } while ((n /= 10) > 0);
}


x86 assembly (clang, -O0):
<pbunsigned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rdi
add    $0x30,%rdi
call   1030 <pushback@plt>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
ja     111c <pbunsigned+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbunsigned>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
movabs $0xcccccccccccccccd,%r15
cc cc cc
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rax
mul    %r15
mov    %rdx,%rbx
shr    $0x3,%rbx
lea    (%rbx,%rbx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %r14,%rdi
sub    %rax,%rdi
or     $0x30,%rdi
call   1030 <pushback@plt>
cmp    $0x9,%r14
mov    %rbx,%r14
ja     1130 <pbunsigned+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @pbunsigned(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %8, %1
%4 = load i64, i64* %2
%5 = urem i64 %4, 10
%6 = add i64 %5, 48
%7 = call i32 @pushback(i64 %6)
br label %8
8: ; preds = %3
%9 = load i64, i64* %2
%10 = udiv i64 %9, 10
store i64 %10, i64* %2
%11 = icmp ugt i64 %10, 0
br i1 %11, label %3, label %12
12: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @pbunsigned(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %7, %2 ]
%4 = urem i64 %3, 10
%5 = or i64 %4, 48
%6 = tail call i32 @pushback(i64 %5)
%7 = udiv i64 %3, 10
%8 = icmp ult i64 %3, 10
br i1 %8, label %9, label %2
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void puts_t() {
  char str1[15];
  char str2[15];
  strcpy(str1, "tutorialspoint");
  strcpy(str2, "compileonline");
  puts(str1);
  puts(str2);
}


x86 assembly (clang, -O0):
<puts_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0xf(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x1e(%rbp),%rdi
lea    0xecc(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xf(%rbp),%rdi
call   1040 <puts@plt>
lea    -0x1e(%rbp),%rdi
call   1040 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts_t>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xed2(%rip),%rsi
lea    0x19(%rsp),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
lea    0xecd(%rip),%rsi
lea    0xa(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"tutorialspoint\00"
@.str.1 = [14 x i8] c"compileonline\00"
define void @puts_t() {
%1 = alloca [15 x i8]
%2 = alloca [15 x i8]
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%8 = call i32 @puts(i8* %7)
%9 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%10 = call i32 @puts(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"tutorialspoint\00"
@.str.1 = [14 x i8] c"compileonline\00"
define void @puts_t() {
%1 = alloca [15 x i8]
%2 = alloca [15 x i8]
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @puts(i8* %3)
%8 = call i32 @puts(i8* %4)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
float Ranf(float low, float high) {
  float r = (float)rand();
  return (low + r * (high - low) / (float)RAND_MAX);
}


x86 assembly (clang, -O0):
<Ranf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm1
mov    0x2e96(%rip),%rax
cvtsi2ssq (%rax),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ranf>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm2
mov    0x2eb9(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2ssq (%rax),%xmm1
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm3
subss  %xmm3,%xmm0
mulss  %xmm2,%xmm0
divss  %xmm1,%xmm0
addss  %xmm3,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define float @Ranf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = call i64 (...) @rand()
%7 = sitofp i64 %6 to float
store float %7, float* %5
%8 = load float, float* %3
%9 = load float, float* %5
%10 = load float, float* %4
%11 = load float, float* %3
%12 = fsub float %10, %11
%13 = fmul float %9, %12
%14 = load i64, i64* @RAND_MAX
%15 = sitofp i64 %14 to float
%16 = fdiv float %13, %15
%17 = fadd float %8, %16
ret float %17
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define float @Ranf(float %0, float %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to float
%5 = fsub float %1, %0
%6 = fmul float %5, %4
%7 = load i64, i64* @RAND_MAX
%8 = sitofp i64 %7 to float
%9 = fdiv float %6, %8
%10 = fadd float %9, %0
ret float %10
}
int main() {
  short s = 1;
  long l = 1;
  s -= l;
  return s;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
movswq -0x6(%rbp),%rax
sub    %rcx,%rax
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i64
store i32 0, i32* %1
store i16 1, i16* %2
store i64 1, i64* %3
%4 = load i64, i64* %3
%5 = load i16, i16* %2
%6 = sext i16 %5 to i64
%7 = sub nsw i64 %6, %4
%8 = trunc i64 %7 to i16
store i16 %8, i16* %2
%9 = load i16, i16* %2
%10 = sext i16 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ destroy();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void terminate(int sig) {
  destroy();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <destroy@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<terminate>:
push   %rax
xor    %eax,%eax
call   1030 <destroy@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @terminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @destroy()
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @terminate(i32 %0) {
%2 = tail call i32 (...) @destroy()
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void cpu_boost(unsigned int freq_mhz) {}


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

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

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

LLVM IR (-O2):
define void @cpu_boost(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ REG_UART_BASE(scalar_t__);
__attribute__((always_)) __attribute__((flatten)) uint32_t
UART_INT_ENA(uint32_t i) {
  return (REG_UART_BASE(i) + 0xc);
}


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

x86 assembly (clang, -O2):
<UART_INT_ENA>:
push   %rax
call   1030 <REG_UART_BASE@plt>
add    $0xc,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @UART_INT_ENA(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @REG_UART_BASE(i64 %3)
%5 = add nsw i64 %4, 12
ret i64 %5
}

LLVM IR (-O2):
define i64 @UART_INT_ENA(i64 %0) {
%2 = tail call i64 @REG_UART_BASE(i64 %0)
%3 = add nsw i64 %2, 12
ret i64 %3
}
int test_imm_7Auint8_reg(unsigned char val) {
  return ((val) & (0x7A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Auint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x7a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Auint8_reg>:
test   $0x7a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Auint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 122
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void rathread_yield() { sched_yield(); }


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

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

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

LLVM IR (-O2):
define void @rathread_yield() {
%1 = tail call i32 (...) @sched_yield()
ret void
}
/* Variables and functions */
scalar_t__ ceill(long double);
int /*<<< orphan*/ link_failure_ceill();
void test_ceill(long double ld) {
  if (ceill(ld) != ceill(ld))
    link_failure_ceill();
}


x86 assembly (clang, -O0):
<test_ceill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <ceill@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <ceill@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_ceill+0x43>
mov    $0x0,%al
call   1030 <link_failure_ceill@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ceill>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <ceill@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1040 <ceill@plt>
cmp    %rax,%rbx
jne    1151 <test_ceill+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <link_failure_ceill@plt>

LLVM IR (-O0):
define void @test_ceill(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @ceill(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @ceill(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_ceill()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_ceill(x86_fp80 %0) {
%2 = tail call i64 @ceill(x86_fp80 %0)
%3 = tail call i64 @ceill(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_ceill()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *err_msg) {
  fprintf(stderr, "An error occurred while %s\n", err_msg);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
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    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"An error occurred while %s\0A\00"
define void @error(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 ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"An error occurred while %s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, int);
void ZSTDv06_copy8(void *dst, const void *src) { memcpy(dst, src, 8); }


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

x86 assembly (clang, -O2):
<ZSTDv06_copy8>:
mov    $0x8,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @ZSTDv06_copy8(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 8)
ret void
}
/* Variables and functions */
char *base64_encode_imp(char *, size_t, int);
char *base64_encode_non_padded(char *data, size_t data_size) {
  return base64_encode_imp(data, data_size, false);
}


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

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

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

LLVM IR (-O2):
define i8* @base64_encode_non_padded(i8* %0, i64 %1) {
%3 = tail call i8* @base64_encode_imp(i8* %0, i64 %1, i32 0)
ret i8* %3
}
/* Variables and functions */
int toto();
main() { return toto(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @toto()
ret i32 %1
}
int test_imm_00int16_reg(short val) {
  return ((val) & (-0x00 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_00int16_reg(i16 signext %0) {
ret i32 -40
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_usage_info(char const *);
int /*<<< orphan*/ printf(char *, int);
void exit_error_invalid_arguments(int argc, const char *progname) {
  printf("Error: Invalid number of arguments.\n"
         "    Number of arguments supplied: %d.\n"
         "    Number of arguments expected: 3.\n",
         argc - 1);
  print_usage_info(progname);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<exit_error_invalid_arguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <print_usage_info@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<exit_error_invalid_arguments>:
push   %rbx
mov    %rsi,%rbx
lea    -0x1(%rdi),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <print_usage_info@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [112 x i8] c"Error: Invalid number of arguments.\0A Number of arguments supplied: %d.\0A Number of arguments expected: 3.\0A\00"
@EXIT_FAILURE = global i32 0
define void @exit_error_invalid_arguments(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 = sub nsw i32 %5, 1
%7 = call i32 @printf(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %4
%9 = call i32 @print_usage_info(i8* %8)
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [112 x i8] c"Error: Invalid number of arguments.\0A Number of arguments supplied: %d.\0A Number of arguments expected: 3.\0A\00"
@EXIT_FAILURE = global i32 0
define void @exit_error_invalid_arguments(i32 %0, i8* %1) {
%3 = add nsw i32 %0, -1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @print_usage_info(i8* %1)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
int av_get_volume(void) { return 255; }


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

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

LLVM IR (-O0):
define i32 @av_get_volume() {
ret i32 255
}

LLVM IR (-O2):
define i32 @av_get_volume() {
ret i32 255
}
void *test_anti_range_112(int n) {
  extern void *alloc_anti_range_112(int) __attribute__((alloc_size(1)));
  if ((-0x7fffffff - 1) + 2 <= n && n <= -1)
    n = (-0x7fffffff - 1) + 2 - 1;
  return alloc_anti_range_112(n);
}


x86 assembly (clang, -O0):
<test_anti_range_112>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x80000002,%eax
cmp    -0x4(%rbp),%eax
jg     113a <test_anti_range_112+0x2a>
cmpl   $0xffffffff,-0x4(%rbp)
jg     113a <test_anti_range_112+0x2a>
movl   $0x80000001,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_112@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_112>:
cmp    $0x80000001,%edi
mov    $0x80000001,%eax
cmovae %eax,%edi
jmp    1030 <alloc_anti_range_112@plt>

LLVM IR (-O0):
define i8* @test_anti_range_112(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 -2147483646, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -2147483647, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_112(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_112(i32 %0) {
%2 = icmp ult i32 %0, -2147483647
%3 = select i1 %2, i32 %0, i32 -2147483647
%4 = tail call i8* @alloc_anti_range_112(i32 %3)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ EXTENDED_KEY_USAGE;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ EXTENDED_KEY_USAGE_it;
void EXTENDED_KEY_USAGE_free(EXTENDED_KEY_USAGE *a) {
  ASN1_item_free((ASN1_VALUE *)a, &EXTENDED_KEY_USAGE_it);
}


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

x86 assembly (clang, -O2):
<EXTENDED_KEY_USAGE_free>:
mov    0x2ed1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@EXTENDED_KEY_USAGE_it = global i32 0
define void @EXTENDED_KEY_USAGE_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @EXTENDED_KEY_USAGE_it)
ret void
}
double remapd(double x, double lo1, double hi1, double lo2, double hi2) {
  return (x - lo1) / (hi1 - lo1) * (hi2 - lo2) + lo2;
}


x86 assembly (clang, -O0):
<remapd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<remapd>:
subsd  %xmm1,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
subsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @remapd(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fsub double %11, %12
%14 = load double, double* %8
%15 = load double, double* %7
%16 = fsub double %14, %15
%17 = fdiv double %13, %16
%18 = load double, double* %10
%19 = load double, double* %9
%20 = fsub double %18, %19
%21 = load double, double* %9
%22 = call double @llvm.fmuladd.f64(double %17, double %20, double %21)
ret double %22
}

LLVM IR (-O2):
define double @remapd(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %0, %1
%7 = fsub double %2, %1
%8 = fdiv double %6, %7
%9 = fsub double %4, %3
%10 = tail call double @llvm.fmuladd.f64(double %8, double %9, double %3)
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int rat_mod_generic_set_val_flag_off(const char *argv, uint8_t *data,
                                     uint16_t len) {
  do {
  } while (0);
  if (!argv || !data || len < sizeof(int))
    return -1;
  *((int *)data) = 0;
  return 0;
}


x86 assembly (clang, -O0):
<rat_mod_generic_set_val_flag_off>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
jmp    1114 <rat_mod_generic_set_val_flag_off+0x14>
cmpq   $0x0,-0x10(%rbp)
je     1138 <rat_mod_generic_set_val_flag_off+0x38>
cmpq   $0x0,-0x18(%rbp)
je     1138 <rat_mod_generic_set_val_flag_off+0x38>
movslq -0x1c(%rbp),%rax
cmp    $0x4,%rax
jae    1144 <rat_mod_generic_set_val_flag_off+0x44>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <rat_mod_generic_set_val_flag_off+0x55>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rat_mod_generic_set_val_flag_off>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111c <rat_mod_generic_set_val_flag_off+0x1c>
test   %rsi,%rsi
je     111c <rat_mod_generic_set_val_flag_off+0x1c>
cmp    $0x4,%edx
jb     111c <rat_mod_generic_set_val_flag_off+0x1c>
movl   $0x0,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @rat_mod_generic_set_val_flag_off(i8* readnone %0, i32* writeonly %1, i32 %2) {
%4 = icmp eq i8* %0, null
%5 = icmp eq i32* %1, null
%6 = or i1 %4, %5
%7 = icmp ult i32 %2, 4
%8 = or i1 %6, %7
br i1 %8, label %10, label %9
9: ; preds = %3
store i32 0, i32* %1
br label %10
10: ; preds = %3, %9
%11 = phi i32 [ 0, %9 ], [ -1, %3 ]
ret i32 %11
}
int fn_8(int a, int b, int c) {
  if (a)
    return b;
  else
    return c;
}


x86 assembly (clang, -O0):
<fn_8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1122 <fn_8+0x22>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <fn_8+0x28>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_8>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @fn_8(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 %2, i32 %1
ret i32 %5
}
/* Variables and functions */
int finger_complete_request(char *buffer, size_t len) {
  if (len < 2) {
    return (0);
  }
  if (buffer[len - 1] == 10 && buffer[len - 2] == 13) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<finger_complete_request>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x2,-0x18(%rbp)
jae    1123 <finger_complete_request+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1168 <finger_complete_request+0x68>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1161 <finger_complete_request+0x61>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x2,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xd,%eax
jne    1161 <finger_complete_request+0x61>
movl   $0x1,-0x4(%rbp)
jmp    1168 <finger_complete_request+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<finger_complete_request>:
xor    %eax,%eax
cmp    $0x2,%rsi
jb     111d <finger_complete_request+0x1d>
cmpb   $0xa,-0x1(%rsi,%rdi,1)
jne    111b <finger_complete_request+0x1b>
mov    $0x1,%eax
cmpb   $0xd,-0x2(%rsi,%rdi,1)
je     111d <finger_complete_request+0x1d>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @finger_complete_request(i8* nocapture %0, i64 %1) {
%3 = icmp ult i64 %1, 2
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = add i64 %1, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 10
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = add i64 %1, -2
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 13
br i1 %13, label %15, label %14
14: ; preds = %9, %4
br label %15
15: ; preds = %9, %2, %14
%16 = phi i32 [ 0, %14 ], [ 0, %2 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ FIRCalcHammingWindow(int, double *);
int /*<<< orphan*/ FIRCalcWindow(int, double, double *, double *);
int /*<<< orphan*/ free(double *);
double *malloc(int);
void FIRCalcHamming(int length, double cutoff, double *coeffs) {
  double *window;
  window = malloc(length * sizeof(double));
  FIRCalcHammingWindow(length, window);
  FIRCalcWindow(length, cutoff, coeffs, window);
  free(window);
}


x86 assembly (clang, -O0):
<FIRCalcHamming>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1060 <FIRCalcHammingWindow@plt>
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <FIRCalcWindow@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FIRCalcHamming>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
movsd  %xmm0,0x8(%rsp)
mov    %edi,%r15d
lea    0x0(,%r15,8),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r15d,%edi
mov    %rax,%rsi
call   1060 <FIRCalcHammingWindow@plt>
mov    %r15d,%edi
movsd  0x8(%rsp),%xmm0
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <FIRCalcWindow@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @FIRCalcHamming(i32 %0, double %1, double* %2) {
%4 = shl i32 %0, 3
%5 = tail call double* @malloc(i32 %4)
%6 = tail call i32 @FIRCalcHammingWindow(i32 %0, double* %5)
%7 = tail call i32 @FIRCalcWindow(i32 %0, double %1, double* %2, double* %5)
%8 = tail call i32 @free(double* %5)
ret void
}
int func_add(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<func_add>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @func_add(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @func_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int flash_image(void *, unsigned int, char *);
int flash_splashscreen_image2(void *data, unsigned sz) {
  return flash_image(data, sz, "splashscreen2");
}


x86 assembly (clang, -O0):
<flash_splashscreen_image2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <flash_image@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_splashscreen_image2>:
lea    0xee9(%rip),%rdx
jmp    1030 <flash_image@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"splashscreen2\00"
define i32 @flash_splashscreen_image2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @flash_image(i8* %5, i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [14 x i8] c"splashscreen2\00"
define i32 @flash_splashscreen_image2(i8* %0, i32 %1) {
%3 = tail call i32 @flash_image(i8* %0, i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Type definitions */
struct ap_session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ap_session_terminate(struct ap_session *, int,
                                        int /*<<< orphan*/);
void __terminate_sec(struct ap_session *ses) {
  ap_session_terminate(ses, 6, 0);
}


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

x86 assembly (clang, -O2):
<__terminate_sec>:
mov    $0x6,%esi
xor    %edx,%edx
jmp    1030 <ap_session_terminate@plt>

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

LLVM IR (-O2):
%struct.ap_session = type { i32 }
define void @__terminate_sec(%struct.ap_session* %0) {
%2 = tail call i32 @ap_session_terminate(%struct.ap_session* %0, i32 6, i32 0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long time;
};
typedef TYPE_1__ XButtonPressedEvent;

/* Variables and functions */
void set_XButtonPressedEvent_time(void *_p, unsigned long _v) {
  ((XButtonPressedEvent *)_p)->time = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XButtonPressedEvent_time>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XButtonPressedEvent_time(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonPressedEvent_time(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}