xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
__attribute__((always_, unused)) uint16_t ya_byteswap_u16(uint16_t v) {
  return ((v & 0xFF) << 8) | ((v & 0xFF00) >> 8);
}


x86 assembly (clang, -O0):
<ya_byteswap_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ya_byteswap_u16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @ya_byteswap_u16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ya_byteswap_u16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
void RTAvlrGCPtrRangeRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrGCPtrRangeRemove() {
ret void
}
int intLoc(int num, int arr[], int len) {
  int i;
  int loc = 0;
  for (i = 0; i < len; i++) {
    if (*(arr + i) == num) {
      break;
    } else {
      loc++;
    }
  }
  return loc;
}


x86 assembly (clang, -O0):
<intLoc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115d <intLoc+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x4(%rbp),%eax
jne    1141 <intLoc+0x41>
jmp    115d <intLoc+0x5d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114f <intLoc+0x4f>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111c <intLoc+0x1c>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intLoc>:
test   %edx,%edx
jle    1121 <intLoc+0x21>
mov    %edx,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmp    %edi,(%rsi,%rax,4)
je     1120 <intLoc+0x20>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <intLoc+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @intLoc(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %0
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ 0, %3 ], [ %16, %15 ], [ %2, %12 ]
ret i32 %18
}
float calc_power_i(float volt, float current) {
  float effect;
  effect = volt * current;
  return effect;
}


x86 assembly (clang, -O0):
<calc_power_i>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_power_i>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @calc_power_i(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fmul float %6, %7
store float %8, float* %5
%9 = load float, float* %5
ret float %9
}

LLVM IR (-O2):
define float @calc_power_i(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegReadWord(int /*<<< orphan*/, int);
uint16_t wiznetGetSocketTXWritePointer(uint8_t socket) {
  return wiznetRegReadWord(socket, (0x0000 + 0x0024));
}


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

x86 assembly (clang, -O2):
<wiznetGetSocketTXWritePointer>:
mov    $0x24,%esi
jmp    1030 <wiznetRegReadWord@plt>

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

LLVM IR (-O2):
define i32 @wiznetGetSocketTXWritePointer(i32 %0) {
%2 = tail call i32 @wiznetRegReadWord(i32 %0, i32 36)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Pl_M_Create_Shell_Command(char *);
int Pl_M_Spawn(int /*<<< orphan*/);
int Pl_M_Shell(char *cmd) { return Pl_M_Spawn(Pl_M_Create_Shell_Command(cmd)); }


x86 assembly (clang, -O0):
<Pl_M_Shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Pl_M_Create_Shell_Command@plt>
mov    %eax,%edi
call   1040 <Pl_M_Spawn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pl_M_Shell>:
push   %rax
call   1030 <Pl_M_Create_Shell_Command@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <Pl_M_Spawn@plt>

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

LLVM IR (-O2):
define i32 @Pl_M_Shell(i8* %0) {
%2 = tail call i32 @Pl_M_Create_Shell_Command(i8* %0)
%3 = tail call i32 @Pl_M_Spawn(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x1c() {
  Assert_real((isxdigit(28) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              145, ("isxdigit should be 0 for 0x1c"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x1c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x91,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x1c>:
push   %rax
mov    $0x1c,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x91,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x1c\00"
define void @t_isxdigit_0x1c() {
%1 = call i64 @isxdigit(i32 28)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 145, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x1c\00"
define void @t_isxdigit_0x1c() {
%1 = tail call i64 @isxdigit(i32 28)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 145, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testPrintError(char *, int, int);
int /*<<< orphan*/ test_failed();
void testCompareInt(int i1, int i2, int *pRc) {
  if (*pRc == 0 && i1 != i2) {
    testPrintError("testCompareInt: %d != %d\n", i1, i2);
    *pRc = 1;
    test_failed();
  }
}


x86 assembly (clang, -O0):
<testCompareInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    116e <testCompareInt+0x4e>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     116e <testCompareInt+0x4e>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea8(%rip),%rdi
call   1030 <testPrintError@plt>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    $0x0,%al
call   1040 <test_failed@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testCompareInt>:
push   %rbx
mov    %rdx,%rbx
mov    %esi,%edx
cmp    %esi,%edi
je     114b <testCompareInt+0x2b>
cmpl   $0x0,(%rbx)
jne    114b <testCompareInt+0x2b>
mov    %edi,%esi
lea    0xec8(%rip),%rdi
call   1030 <testPrintError@plt>
movl   $0x1,(%rbx)
xor    %eax,%eax
pop    %rbx
jmp    1040 <test_failed@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [26 x i8] c"testCompareInt: %d != %d\0A\00"
define void @testCompareInt(i32 %0, i32 %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
%6 = icmp eq i32 %0, %1
%7 = or i1 %6, %5
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = tail call i32 @testPrintError(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
store i32 1, i32* %2
%10 = tail call i32 (...) @test_failed()
br label %11
11: ; preds = %8, %3
ret void
}
unsigned getval_272() { return 3523793305U; }


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

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

LLVM IR (-O0):
define i32 @getval_272() {
ret i32 -771173991
}

LLVM IR (-O2):
define i32 @getval_272() {
ret i32 -771173991
}
/* Variables and functions */
int errno;
int fail(int _errno) {
  errno = _errno;
  return -1;
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ecf(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail>:
mov    0x2ed9(%rip),%rax
mov    %edi,(%rax)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @fail(i32 %0) {
store i32 %0, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ tss_t;
typedef int /*<<< orphan*/ tss_dtor_t;

/* Variables and functions */
int pthread_key_create(int /*<<< orphan*/ *, int /*<<< orphan*/);
int thrd_error;
int thrd_success;
int tss_create(tss_t *key, tss_dtor_t dtor) {
  switch (pthread_key_create(key, dtor)) {
  case 0:
    return thrd_success;
  default:
    return thrd_error;
  }
}


x86 assembly (clang, -O0):
<tss_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <pthread_key_create@plt>
test   %eax,%eax
jne    1149 <tss_create+0x39>
jmp    1138 <tss_create+0x28>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <tss_create+0x45>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tss_create>:
push   %rax
call   1030 <pthread_key_create@plt>
test   %eax,%eax
jne    1123 <tss_create+0x13>
mov    0x2ec7(%rip),%rax
jmp    112a <tss_create+0x1a>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@thrd_success = global i32 0
@thrd_error = global i32 0
define i32 @tss_create(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = load i32, i32* %5
%8 = call i32 @pthread_key_create(i32* %6, i32 %7)
switch i32 %8, label %11 [
i32 0, label %9
]
9: ; preds = %2
%10 = load i32, i32* @thrd_success
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* @thrd_error
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@thrd_success = global i32 0
@thrd_error = global i32 0
define i32 @tss_create(i32* %0, i32 %1) {
%3 = tail call i32 @pthread_key_create(i32* %0, i32 %1)
%4 = icmp eq i32 %3, 0
%5 = load i32, i32* @thrd_success
%6 = load i32, i32* @thrd_error
%7 = select i1 %4, i32 %5, i32 %6
ret i32 %7
}
void XtCvtIntToPixel() {}


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

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

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

LLVM IR (-O2):
define void @XtCvtIntToPixel() {
ret void
}
double vec3_dot(const double u[3], const double v[3]) {
  return u[0] * v[0] + u[1] * v[1] + u[2] * v[2];
}


x86 assembly (clang, -O0):
<vec3_dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_dot>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @vec3_dot(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @vec3_dot(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
unsigned char __startrek_read_nxtway_gs_mode();
int /*<<< orphan*/ ecrobot_status_monitor(char *);
int /*<<< orphan*/ write_mode_on_lcd(unsigned char);
void OSEK_Task_Background(void) {
  unsigned char m;
  unsigned char tmp;
  {
    tmp = __startrek_read_nxtway_gs_mode();
    m = tmp;
    ecrobot_status_monitor("NXTway-GS");
    write_mode_on_lcd(m);
    return;
  }
}


x86 assembly (clang, -O0):
<OSEK_Task_Background>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <__startrek_read_nxtway_gs_mode@plt>
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
lea    0xeb1(%rip),%rdi
call   1050 <ecrobot_status_monitor@plt>
movzbl -0x1(%rbp),%edi
call   1030 <write_mode_on_lcd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSEK_Task_Background>:
push   %rbx
xor    %eax,%eax
call   1040 <__startrek_read_nxtway_gs_mode@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rdi
call   1050 <ecrobot_status_monitor@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <write_mode_on_lcd@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"NXTway-GS\00"
define void @OSEK_Task_Background() {
%1 = alloca i8
%2 = alloca i8
%3 = call zeroext i8 (...) @__startrek_read_nxtway_gs_mode()
store i8 %3, i8* %2
%4 = load i8, i8* %2
store i8 %4, i8* %1
%5 = call i32 @ecrobot_status_monitor(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = load i8, i8* %1
%7 = call i32 @write_mode_on_lcd(i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"NXTway-GS\00"
define void @OSEK_Task_Background() {
%1 = tail call zeroext i8 (...) @__startrek_read_nxtway_gs_mode()
%2 = tail call i32 @ecrobot_status_monitor(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write_mode_on_lcd(i8 zeroext %1)
ret void
}
int egsy_gcm_csr_hashout2_set(unsigned int dev_id,
                              union egsy_gcm_csr_hashout2_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.egsy_gcm_csr_hashout2_u = type opaque
define i32 @egsy_gcm_csr_hashout2_set(i32 %0, %union.egsy_gcm_csr_hashout2_u* %1) {
%3 = alloca i32
%4 = alloca %union.egsy_gcm_csr_hashout2_u*
store i32 %0, i32* %3
store %union.egsy_gcm_csr_hashout2_u* %1, %union.egsy_gcm_csr_hashout2_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.egsy_gcm_csr_hashout2_u = type opaque
define i32 @egsy_gcm_csr_hashout2_set(i32 %0, %union.egsy_gcm_csr_hashout2_u* nocapture readnone %1) {
ret i32 1
}
int check_wager_amount(double wager, double balance) {
  int is_valid = 0;
  if ((wager > 0) && (balance >= wager)) {
    is_valid = 1;
  }
  return is_valid;
}


x86 assembly (clang, -O0):
<check_wager_amount>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    113e <check_wager_amount+0x3e>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     113e <check_wager_amount+0x3e>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_wager_amount>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
seta   %al
ucomisd %xmm0,%xmm1
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @check_wager_amount(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
store double %1, double* %4
store i32 0, i32* %5
%6 = load double, double* %3
%7 = fcmp ogt double %6, 0.000000e+00
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fcmp oge double %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %5
br label %13
13: ; preds = %12, %8, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @check_wager_amount(double %0, double %1) {
%3 = fcmp ogt double %0, 0.000000e+00
%4 = fcmp oge double %1, %0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_PUBKEY;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_PUBKEY_it;
X509_PUBKEY *d2i_X509_PUBKEY(X509_PUBKEY **a, const unsigned char **in,
                             long len) {
  return (X509_PUBKEY *)ASN1_item_d2i((ASN1_VALUE **)a, in, len,
                                      &X509_PUBKEY_it);
}


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

x86 assembly (clang, -O2):
<d2i_X509_PUBKEY>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@X509_PUBKEY_it = global i32 0
define i32* @d2i_X509_PUBKEY(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @X509_PUBKEY_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@X509_PUBKEY_it = global i32 0
define i32* @d2i_X509_PUBKEY(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @X509_PUBKEY_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
unsigned int RAND_MAX;
unsigned int rand();
unsigned rand2(unsigned n) {
  unsigned r;
  while ((r = (rand() / (RAND_MAX / n))) >= n)
    ;
  return r;
}


x86 assembly (clang, -O0):
<rand2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0xc(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
xor    %edx,%edx
divl   -0x4(%rbp)
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
cmp    -0x4(%rbp),%eax
jb     114d <rand2+0x3d>
jmp    111b <rand2+0xb>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand2>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecb(%rip),%r14
nopl   (%rax)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
mov    (%r14),%eax
xor    %edx,%edx
div    %ebx
mov    %eax,%esi
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
cmp    %ebx,%eax
jae    1120 <rand2+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @rand2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %12, %1
%5 = call i32 (...) @rand()
%6 = load i32, i32* @RAND_MAX
%7 = load i32, i32* %2
%8 = udiv i32 %6, %7
%9 = udiv i32 %5, %8
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = icmp uge i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %4
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @rand2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (...) @rand()
%4 = load i32, i32* @RAND_MAX
%5 = udiv i32 %4, %0
%6 = udiv i32 %3, %5
%7 = icmp ult i32 %6, %0
br i1 %7, label %8, label %2
8: ; preds = %2
ret i32 %6
}
void DrawVlineBmp(unsigned short *buffer, int x, int y, int dx, int dy,
                  unsigned short color) {
  int i, j, idx;
  for (j = y; j < y + dy; j++) {
    idx = x + j * 640;
    buffer[idx] = color;
  }
}


x86 assembly (clang, -O0):
<DrawVlineBmp>:
push   %rbp
mov    %rsp,%rbp
mov    %r9w,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    -0x18(%rbp),%ecx
cmp    %ecx,%eax
jge    1161 <DrawVlineBmp+0x61>
mov    -0xc(%rbp),%eax
imul   $0x280,-0x24(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x1a(%rbp),%dx
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1123 <DrawVlineBmp+0x23>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawVlineBmp>:
test   %r8d,%r8d
jle    1134 <DrawVlineBmp+0x34>
add    %edx,%r8d
movslq %edx,%rax
movslq %esi,%rdx
movslq %r8d,%rcx
lea    (%rax,%rax,4),%rsi
shl    $0x7,%rsi
add    %rdx,%rsi
lea    (%rdi,%rsi,2),%rdx
mov    %r9w,(%rdx)
add    $0x1,%rax
add    $0x500,%rdx
cmp    %rcx,%rax
jl     1120 <DrawVlineBmp+0x20>
ret

LLVM IR (-O0):
define void @DrawVlineBmp(i16* %0, i32 %1, i32 %2, i32 %3, i32 %4, i16 zeroext %5) {
%7 = alloca i16*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i16* %0, i16** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i16 %5, i16* %12
%16 = load i32, i32* %9
store i32 %16, i32* %14
br label %17
17: ; preds = %33, %6
%18 = load i32, i32* %14
%19 = load i32, i32* %9
%20 = load i32, i32* %11
%21 = add nsw i32 %19, %20
%22 = icmp slt i32 %18, %21
br i1 %22, label %23, label %36
23: ; preds = %17
%24 = load i32, i32* %8
%25 = load i32, i32* %14
%26 = mul nsw i32 %25, 640
%27 = add nsw i32 %24, %26
store i32 %27, i32* %15
%28 = load i16, i16* %12
%29 = load i16*, i16** %7
%30 = load i32, i32* %15
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i16, i16* %29, i64 %31
store i16 %28, i16* %32
br label %33
33: ; preds = %23
%34 = load i32, i32* %14
%35 = add nsw i32 %34, 1
store i32 %35, i32* %14
br label %17
36: ; preds = %17
ret void
}

LLVM IR (-O2):
define void @DrawVlineBmp(i16* nocapture writeonly %0, i32 %1, i32 %2, i32 %3, i32 %4, i16 zeroext %5) {
%7 = icmp sgt i32 %4, 0
br i1 %7, label %8, label %20
8: ; preds = %6
%9 = add nsw i32 %4, %2
%10 = sext i32 %2 to i64
%11 = sext i32 %1 to i64
%12 = sext i32 %9 to i64
br label %13
13: ; preds = %8, %13
%14 = phi i64 [ %10, %8 ], [ %18, %13 ]
%15 = mul nsw i64 %14, 640
%16 = add nsw i64 %15, %11
%17 = getelementptr inbounds i16, i16* %0, i64 %16
store i16 %5, i16* %17
%18 = add nsw i64 %14, 1
%19 = icmp slt i64 %18, %12
br i1 %19, label %13, label %20
20: ; preds = %13, %6
ret void
}
/* Variables and functions */
int _add_cflag_validator(char const *, int (*)(char const *, double));
int _add_cflag_validator_double(const char *name,
                                int (*validate_fn)(const char *, double)) {
  return _add_cflag_validator(name, validate_fn);
}


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

x86 assembly (clang, -O2):
<_add_cflag_validator_double>:
jmp    1030 <_add_cflag_validator@plt>

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

LLVM IR (-O2):
define i32 @_add_cflag_validator_double(i8* %0, i32 (i8*, double)* %1) {
%3 = tail call i32 @_add_cflag_validator(i8* %0, i32 (i8*, double)* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void shell_prompt(void) { printf("[kernel@os]# "); }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"[kernel@os]# \00"
define void @shell_prompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
float finn_vec3_dot(float *lhs, float *rhs) {
  return (lhs[0] * rhs[0]) + (lhs[1] * rhs[1]) + (lhs[2] * rhs[2]);
}


x86 assembly (clang, -O0):
<finn_vec3_dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<finn_vec3_dot>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @finn_vec3_dot(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
ret float %25
}

LLVM IR (-O2):
define float @finn_vec3_dot(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int get();
int /*<<< orphan*/ init();
int main(int argc, char **argv) {
  int tmp = 5;
  init();
  tmp = get();
  assert(tmp == 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1050 <get@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1050 <get@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
%7 = call i32 (...) @init()
%8 = call i32 (...) @get()
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 5
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @get()
%5 = icmp eq i32 %4, 5
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret i32 0
}
/* Variables and functions */
int html_tabledata(int, int, int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ sprintf(char *, char *, double);
int html_writetabledata(char *format, double value) {
  char buf[64];
  sprintf(buf, format, value);
  return html_tabledata((1), 1, 1, 0, buf);
}


x86 assembly (clang, -O0):
<html_writetabledata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movsd  -0x10(%rbp),%xmm0
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%r8
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <html_tabledata@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_writetabledata>:
push   %rbx
sub    $0x40,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
call   1030 <html_tabledata@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @html_writetabledata(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca [64 x i8]
store i8* %0, i8** %3
store double %1, double* %4
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load double, double* %4
%9 = call i32 @sprintf(i8* %6, i8* %7, double %8)
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%11 = call i32 @html_tabledata(i32 1, i32 1, i32 1, i32 0, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @html_writetabledata(i8* nocapture %0, double %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, double %1)
%6 = call i32 @html_tabledata(i32 1, i32 1, i32 1, i32 0, i8* %4)
ret i32 %6
}
/* Variables and functions */
int check(char *str) { return str != NULL; }


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @check(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @check(i8* readnone %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo(int bar) {
  printf("%d\n", bar);
  return;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @foo(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_call_auth_context() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_call_auth_context>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_call_auth_context>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_auth_context() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_auth_context() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
void test_open_streams(void) {}


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

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

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

LLVM IR (-O2):
define void @test_open_streams() {
ret void
}
void reinstall_sigvec(sig, new) int sig;
void (*new)();
{ (void)signal(sig, new); }


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

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

LLVM IR (-O0):
define void @reinstall_sigvec(i32 %0, void (...)* %1) {
%3 = alloca i32
%4 = alloca void (...)*
store i32 %0, i32* %3
store void (...)* %1, void (...)** %4
%5 = load i32, i32* %3
%6 = load void (...)*, void (...)** %4
%7 = call i32 (i32, void (...)*, ...) bitcast (i32 (...)* @signal to i32 (i32, void (...)*, ...)*)(i32 %5, void (...)* %6)
ret void
}

LLVM IR (-O2):
define void @reinstall_sigvec(i32 %0, void (...)* %1) {
%3 = tail call i32 (i32, void (...)*, ...) bitcast (i32 (...)* @signal to i32 (i32, void (...)*, ...)*)(i32 %0, void (...)* %1)
ret void
}
/* Variables and functions */
long __syscall(int, long, int, int /*<<< orphan*/, int);
long lseek(int filedes, long offset, int whence) {
  return __syscall(filedes, offset, whence, 0, 0x405);
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
mov    $0x405,%r8d
call   1030 <__syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
xor    %ecx,%ecx
mov    $0x405,%r8d
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
define i64 @lseek(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i64 @__syscall(i32 %7, i64 %8, i32 %9, i32 0, i32 1029)
ret i64 %10
}

LLVM IR (-O2):
define i64 @lseek(i32 %0, i64 %1, i32 %2) {
%4 = tail call i64 @__syscall(i32 %0, i64 %1, i32 %2, i32 0, i32 1029)
ret i64 %4
}
/* Variables and functions */
scalar_t__ point(char *);
scalar_t__ strcmp(char *, char *);
int vspen(char *s) {
  return (point(s) && (strcmp((char *)(s), (char *)("\\^")) == 0));
}


x86 assembly (clang, -O0):
<vspen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <point@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1161 <vspen+0x41>
mov    -0x8(%rbp),%rdi
lea    0xeae(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vspen>:
push   %rbx
mov    %rdi,%rbx
call   1040 <point@plt>
test   %rax,%rax
je     114a <vspen+0x2a>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\\^\00"
define i32 @vspen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @point(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"\\^\00"
define i32 @vspen(i8* %0) {
%2 = tail call i64 @point(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int nvme_pcicfg_map_bar(void *pci_handle, int bar, int read_only, void **addr) {
  *addr = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<nvme_pcicfg_map_bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvme_pcicfg_map_bar>:
movq   $0x0,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @nvme_pcicfg_map_bar(i8* %0, i32 %1, i32 %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8**
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i8**, i8*** %8
store i8* null, i8** %9
ret i32 0
}

LLVM IR (-O2):
define i32 @nvme_pcicfg_map_bar(i8* nocapture readnone %0, i32 %1, i32 %2, i8** nocapture writeonly %3) {
store i8* null, i8** %3
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ test_compare();
uint32_t test_compare_h() {
  uint32_t success = 0;
  success = test_compare();
  if (success != 0) {
    return success;
  }
  return success;
}


x86 assembly (clang, -O0):
<test_compare_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_compare@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1143 <test_compare_h+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114b <test_compare_h+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @test_compare_h() {
%1 = tail call i64 (...) @test_compare()
ret i64 %1
}
int fn6(int a, int b) {
  int tem1 = b ^ a;
  int tem2 = a & b;
  return tem1 | tem2;
}


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

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

LLVM IR (-O0):
define i32 @fn6(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = xor i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = and i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = or i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn6(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("HolaMundo"); }


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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"HolaMundo\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
void ion_cmd_telnet(char *cmd) { printw("\n\rtelnet command\n\r\n\r"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0A\0Dtelnet command\0A\0D\0A\0D\00"
define void @ion_cmd_telnet(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printw(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0A\0Dtelnet command\0A\0D\0A\0D\00"
define void @ion_cmd_telnet(i8* nocapture readnone %0) {
%2 = tail call i32 @printw(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
float _mm_cvtss_f32(int /*<<< orphan*/);
float test_mm_cvtss_f32(__m128 A) { return _mm_cvtss_f32(A); }


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

x86 assembly (clang, -O2):
<test_mm_cvtss_f32>:
jmp    1030 <_mm_cvtss_f32@plt>

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

LLVM IR (-O2):
define float @test_mm_cvtss_f32(i32 %0) {
%2 = tail call float @_mm_cvtss_f32(i32 %0)
ret float %2
}