xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strchr(const char *p, int ch) {
  for (;; ++p) {
    if (*p == (char)ch)
      return ((char *)p);
    if (!*p)
      return ((char *)NULL);
  }
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    112d <strchr+0x2d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <strchr+0x5d>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1147 <strchr+0x47>
movq   $0x0,-0x8(%rbp)
jmp    115d <strchr+0x5d>
jmp    114c <strchr+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %12, %8, %2
%18 = phi i8* [ %0, %2 ], [ null, %8 ], [ %13, %12 ]
ret i8* %18
}
void rpi_uart_flush_tx(void) {}


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

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

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

LLVM IR (-O2):
define void @rpi_uart_flush_tx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void putch(int fd, char ch) { write(fd, &ch, 1); }


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @putch(i32 %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @write(i32 %0, i8* %3, i32 1)
ret void
}
/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int wr_test(char const *, int, int, int, int);
int test_wr_long_trunc(const char *file) {
  return wr_test(file, 1024, 5, O_CREAT | O_TRUNC, 0777);
}


x86 assembly (clang, -O0):
<test_wr_long_trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
or     (%rax),%ecx
mov    $0x400,%esi
mov    $0x5,%edx
mov    $0x1ff,%r8d
call   1030 <wr_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_wr_long_trunc>:
mov    0x2ee1(%rip),%rax
mov    0x2ed2(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    $0x400,%esi
mov    $0x5,%edx
mov    $0x1ff,%r8d
jmp    1030 <wr_test@plt>

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @test_wr_long_trunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_CREAT
%5 = load i32, i32* @O_TRUNC
%6 = or i32 %4, %5
%7 = call i32 @wr_test(i8* %3, i32 1024, i32 5, i32 %6, i32 511)
ret i32 %7
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @test_wr_long_trunc(i8* %0) {
%2 = load i32, i32* @O_CREAT
%3 = load i32, i32* @O_TRUNC
%4 = or i32 %3, %2
%5 = tail call i32 @wr_test(i8* %0, i32 1024, i32 5, i32 %4, i32 511)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
double baz(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  if (baz("") != 1.0)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
call   1040 <baz@plt>
movsd  0xead(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1168 <main+0x38>
jp     1168 <main+0x38>
jmp    116f <main+0x3f>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
call   1040 <baz@plt>
ucomisd 0xebb(%rip),%xmm0
jne    1149 <main+0x19>
jnp    1150 <main+0x20>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @baz(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = fcmp une double %2, 1.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call double @baz(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = fcmp une double %1, 1.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
void putfoo(foop) struct foo *foop;
{}


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

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

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

LLVM IR (-O2):
%struct.foo = type opaque
define void @putfoo(%struct.foo* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void _abort(void) { raise(SIGABRT); }


x86 assembly (clang, -O0):
<_abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_abort>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <raise@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @_abort() {
%1 = load i32, i32* @SIGABRT
%2 = call i32 @raise(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @_abort() {
%1 = load i32, i32* @SIGABRT
%2 = tail call i32 @raise(i32 %1)
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
void timer_correct(double *timestamp) {
  struct timeval time;
  double million = 1e6;
  gettimeofday(&time, 0);
  *timestamp = 0.5 * (*timestamp + time.tv_sec + time.tv_usec / million);
}


x86 assembly (clang, -O0):
<timer_correct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xee4(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
addsd  %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_correct>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  (%rbx),%xmm0
addsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  0xec7(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  0xec3(%rip),%xmm1
movsd  %xmm1,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define void @timer_correct(double* %0) {
%2 = alloca double*
%3 = alloca %struct.timeval
%4 = alloca double
store double* %0, double** %2
store double 1.000000e+06, double* %4
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32 0)
%6 = load double*, double** %2
%7 = load double, double* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%9 = load double, double* %8
%10 = fadd double %7, %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%12 = load double, double* %11
%13 = load double, double* %4
%14 = fdiv double %12, %13
%15 = fadd double %10, %14
%16 = fmul double 5.000000e-01, %15
%17 = load double*, double** %2
store double %16, double* %17
ret void
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define void @timer_correct(double* nocapture %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%5 = load double, double* %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%7 = load double, double* %6
%8 = fadd double %5, %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%10 = load double, double* %9
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %8, %11
%13 = fmul double %12, 5.000000e-01
store double %13, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ResumeAudio299(unsigned long);
void resumeaudio(unsigned long id) { ResumeAudio299(id); }


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

x86 assembly (clang, -O2):
<resumeaudio>:
jmp    1030 <ResumeAudio299@plt>

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

LLVM IR (-O2):
define void @resumeaudio(i64 %0) {
%2 = tail call i32 @ResumeAudio299(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PancApp__Boot__booted();
void RealMainP__Boot__booted(void) { PancApp__Boot__booted(); }


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

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

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

LLVM IR (-O2):
define void @RealMainP__Boot__booted() {
%1 = tail call i32 (...) @PancApp__Boot__booted()
ret void
}
void ble_rsp_hardware_spi_transfer(
    const struct ble_msg_hardware_spi_transfer_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_hardware_spi_transfer_rsp_t = type opaque
define void @ble_rsp_hardware_spi_transfer(%struct.ble_msg_hardware_spi_transfer_rsp_t* nocapture %0) {
ret void
}
long sas_file_format_version(long format_code) {
  if ((format_code & 0x010000))
    return 5;
  if ((format_code & 0x020000))
    return 8;
  if ((format_code & (0x001000 | 0x002000)))
    return 80101;
  return 90101;
}


x86 assembly (clang, -O0):
<sas_file_format_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x10000,%rax
cmp    $0x0,%rax
je     1129 <sas_file_format_version+0x29>
movq   $0x5,-0x8(%rbp)
jmp    1173 <sas_file_format_version+0x73>
mov    -0x10(%rbp),%rax
and    $0x20000,%rax
cmp    $0x0,%rax
je     114a <sas_file_format_version+0x4a>
movq   $0x8,-0x8(%rbp)
jmp    1173 <sas_file_format_version+0x73>
mov    -0x10(%rbp),%rax
and    $0x3000,%rax
cmp    $0x0,%rax
je     116b <sas_file_format_version+0x6b>
movq   $0x138e5,-0x8(%rbp)
jmp    1173 <sas_file_format_version+0x73>
movq   $0x15ff5,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sas_file_format_version>:
mov    $0x5,%eax
test   $0x10000,%edi
jne    112e <sas_file_format_version+0x2e>
mov    $0x8,%eax
test   $0x20000,%edi
jne    112e <sas_file_format_version+0x2e>
test   $0x3000,%edi
mov    $0x15ff5,%ecx
mov    $0x138e5,%eax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @sas_file_format_version(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = and i64 %4, 65536
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 5, i64* %2
br label %19
8: ; preds = %1
%9 = load i64, i64* %3
%10 = and i64 %9, 131072
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i64 8, i64* %2
br label %19
13: ; preds = %8
%14 = load i64, i64* %3
%15 = and i64 %14, 12288
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i64 80101, i64* %2
br label %19
18: ; preds = %13
store i64 90101, i64* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i64, i64* %2
ret i64 %20
}

LLVM IR (-O2):
define i64 @sas_file_format_version(i64 %0) {
%2 = and i64 %0, 65536
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = and i64 %0, 131072
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = and i64 %0, 12288
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i64 90101, i64 80101
br label %11
11: ; preds = %7, %4, %1
%12 = phi i64 [ 5, %1 ], [ 8, %4 ], [ %10, %7 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  int number_of_unread_characters;
  fprintf(stderr, "Done.\n");
  return 0 * number_of_unread_characters;
}


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)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
imul   $0x0,-0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"Done.\0A\00"
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
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %6
%10 = mul nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"Done.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double);
void output_values_weight_metric(double main_out_value, double sec_out_value) {
  printf("Your converted value is %g Kilograms, %g grams\n\n", main_out_value,
         sec_out_value);
}


x86 assembly (clang, -O0):
<output_values_weight_metric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [49 x i8] c"Your converted value is %g Kilograms, %g grams\0A\0A\00"
define void @output_values_weight_metric(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 = load double, double* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), double %5, double %6)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"Your converted value is %g Kilograms, %g grams\0A\0A\00"
define void @output_values_weight_metric(double %0, double %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), double %0, double %1)
ret void
}
/* Variables and functions */
float cos(float);
float cosine(float a) {
  float b = cos(a);
  return b;
}


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

x86 assembly (clang, -O2):
<cosine>:
jmp    1030 <cos@plt>

LLVM IR (-O0):
define float @cosine(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call float @cos(float %4)
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @cosine(float %0) {
%2 = tail call float @cos(float %0)
ret float %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ green_mask;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
unsigned long get_XImage_green_mask(void *_p) {
  return (unsigned long)((XImage *)_p)->green_mask;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XImage_green_mask(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
scalar_t__ isascii(int);
scalar_t__ isspace(int);
int utf32_isspace(int c) { return isascii(c) && isspace(c); }


x86 assembly (clang, -O0):
<utf32_isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isascii@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1157 <utf32_isspace+0x37>
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf32_isspace>:
push   %rbx
mov    %edi,%ebx
call   1040 <isascii@plt>
test   %rax,%rax
je     1141 <utf32_isspace+0x21>
mov    %ebx,%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @utf32_isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isascii(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isspace(i32 %7)
%9 = icmp ne 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):
define i32 @utf32_isspace(i32 %0) {
%2 = tail call i64 @isascii(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @isspace(i32 %0)
%6 = icmp ne 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
}
int identImplicit(int in) { return in; }


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

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

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

LLVM IR (-O2):
define i32 @identImplicit(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
long double atan2l(int /*<<< orphan*/, long double);
int /*<<< orphan*/ sqrtl(int);
long double acosl(long double x) { return atan2l(sqrtl((1 + x) * (1 - x)), x); }


x86 assembly (clang, -O0):
<acosl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fld1
fld    %st(1)
fadd   %st(1),%st
fxch   %st(1)
fsubp  %st,%st(2)
fmulp  %st,%st(1)
fnstcw -0x16(%rbp)
movzwl -0x16(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x18(%rbp)
fldcw  -0x18(%rbp)
fistpl -0x14(%rbp)
fldcw  -0x16(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <sqrtl@plt>
mov    %eax,%edi
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <atan2l@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acosl>:
push   %rax
fldt   0x10(%rsp)
fld1
fld    %st(1)
fadd   %st(1),%st
fxch   %st(1)
fsubp  %st,%st(2)
fmulp  %st,%st(1)
fnstcw (%rsp)
movzwl (%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x2(%rsp)
fldcw  0x2(%rsp)
fistpl 0x4(%rsp)
fldcw  (%rsp)
mov    0x4(%rsp),%edi
call   1030 <sqrtl@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <atan2l@plt>

LLVM IR (-O0):
define x86_fp80 @acosl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fadd x86_fp80 0xK3FFF8000000000000000, %3
%5 = load x86_fp80, x86_fp80* %2
%6 = fsub x86_fp80 0xK3FFF8000000000000000, %5
%7 = fmul x86_fp80 %4, %6
%8 = fptosi x86_fp80 %7 to i32
%9 = call i32 @sqrtl(i32 %8)
%10 = load x86_fp80, x86_fp80* %2
%11 = call x86_fp80 @atan2l(i32 %9, x86_fp80 %10)
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @acosl(x86_fp80 %0) {
%2 = fadd x86_fp80 %0, 0xK3FFF8000000000000000
%3 = fsub x86_fp80 0xK3FFF8000000000000000, %0
%4 = fmul x86_fp80 %2, %3
%5 = fptosi x86_fp80 %4 to i32
%6 = tail call i32 @sqrtl(i32 %5)
%7 = tail call x86_fp80 @atan2l(i32 %6, x86_fp80 %0)
ret x86_fp80 %7
}
char *printstate(int s) {
  char *c;
  switch (s) {
  case 0:
    c = "HPM";
    break;
  case 2:
    c = "LPM";
    break;
  default:
    c = "NULL";
    break;
  }
  return c;
}


x86 assembly (clang, -O0):
<printstate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     112b <printstate+0x2b>
jmp    111a <printstate+0x1a>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     113b <printstate+0x3b>
jmp    114b <printstate+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1156 <printstate+0x56>
lea    0xec2(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1156 <printstate+0x56>
lea    0xeb6(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<printstate>:
cmp    $0x2,%edi
lea    0xefa(%rip),%rax
lea    0xef7(%rip),%rcx
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee2(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"HPM\00"
@.str.1 = [4 x i8] c"LPM\00"
@.str.2 = [5 x i8] c"NULL\00"
define i8* @printstate(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %7 [
i32 0, label %5
i32 2, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %3
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"HPM\00"
@.str.1 = [4 x i8] c"LPM\00"
@.str.2 = [5 x i8] c"NULL\00"
define i8* @printstate(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ isinf(double);
int /*<<< orphan*/ unit_error(char *, double, char const *, int);
void assert_inf(double real, char const *caller, int line) {
  if (!isinf(real)) {
    unit_error("%s: %d expected INFINITY, got %0.3e", real, caller, line);
  }
}


x86 assembly (clang, -O0):
<assert_inf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <isinf@plt>
cmp    $0x0,%eax
jne    115f <assert_inf+0x3f>
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xea6(%rip),%rdi
call   1030 <unit_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_inf>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1040 <isinf@plt>
test   %eax,%eax
je     113d <assert_inf+0x1d>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xebc(%rip),%rdi
movsd  (%rsp),%xmm0
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <unit_error@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"%s: %d expected INFINITY, got %0.3e\00"
define void @assert_inf(double %0, i8* %1, i32 %2) {
%4 = alloca double
%5 = alloca i8*
%6 = alloca i32
store double %0, double* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load double, double* %4
%8 = call i32 @isinf(double %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %3
%11 = load double, double* %4
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = call i32 @unit_error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double %11, i8* %12, i32 %13)
br label %15
15: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"%s: %d expected INFINITY, got %0.3e\00"
define void @assert_inf(double %0, i8* %1, i32 %2) {
%4 = tail call i32 @isinf(double %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @unit_error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double %0, i8* %1, i32 %2)
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) { printf("Hi %s\n", argv[0]); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"Hi %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
struct stack_st_OPENSSL_CSTRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
scalar_t__ OPENSSL_sk_set(int /*<<< orphan*/ *, int, void const *);
const char *sk_OPENSSL_CSTRING_set(struct stack_st_OPENSSL_CSTRING *sk, int idx,
                                   const char *ptr) {
  return (const char *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx,
                                      (const void *)ptr);
}


x86 assembly (clang, -O0):
<sk_OPENSSL_CSTRING_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <OPENSSL_sk_set@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sk_OPENSSL_CSTRING_set>:
jmp    1030 <OPENSSL_sk_set@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i8* @sk_OPENSSL_CSTRING_set(%struct.stack_st_OPENSSL_CSTRING* %0, i32 %1, i8* %2) {
%4 = alloca %struct.stack_st_OPENSSL_CSTRING*
%5 = alloca i32
%6 = alloca i8*
store %struct.stack_st_OPENSSL_CSTRING* %0, %struct.stack_st_OPENSSL_CSTRING** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.stack_st_OPENSSL_CSTRING*, %struct.stack_st_OPENSSL_CSTRING** %4
%8 = bitcast %struct.stack_st_OPENSSL_CSTRING* %7 to i32*
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = call i64 @OPENSSL_sk_set(i32* %8, i32 %9, i8* %10)
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i8* @sk_OPENSSL_CSTRING_set(%struct.stack_st_OPENSSL_CSTRING* %0, i32 %1, i8* %2) {
%4 = getelementptr %struct.stack_st_OPENSSL_CSTRING, %struct.stack_st_OPENSSL_CSTRING* %0, i64 0, i32 0
%5 = tail call i64 @OPENSSL_sk_set(i32* %4, i32 %1, i8* %2)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_printf(int /*<<< orphan*/ *, char *, unsigned char);
void hex_prin(BIO *out, unsigned char *buf, int len) {
  int i;
  for (i = 0; i < len; i++)
    BIO_printf(out, "%02X ", buf[i]);
}


x86 assembly (clang, -O0):
<hex_prin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1160 <hex_prin+0x50>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
lea    0xeb7(%rip),%rsi
movzbl (%rax,%rcx,1),%edx
call   1030 <BIO_printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <hex_prin+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_prin>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    1149 <hex_prin+0x39>
mov    %rsi,%r14
mov    %rdi,%r12
mov    %edx,%r13d
xor    %ebx,%ebx
lea    0xed1(%rip),%r15
nop
movzbl (%r14,%rbx,1),%edx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <BIO_printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <hex_prin+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%02X \00"
define void @hex_prin(i32* %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @BIO_printf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 zeroext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
/* Variables and functions */
long __ocml_round_f64(double);
long int lround(double x) { return __ocml_round_f64(x); }


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

x86 assembly (clang, -O2):
<lround>:
jmp    1030 <__ocml_round_f64@plt>

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

LLVM IR (-O2):
define i64 @lround(double %0) {
%2 = tail call i64 @__ocml_round_f64(double %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ hook(char *);
int /*<<< orphan*/ notFound();
void run(void) {
  hook("run() called inside missing-import.");
  notFound();
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <hook@plt>
mov    $0x0,%al
call   1030 <notFound@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <hook@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <notFound@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"run() called inside missing-import.\00"
define void @run() {
%1 = call i32 @hook(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @notFound()
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"run() called inside missing-import.\00"
define void @run() {
%1 = tail call i32 @hook(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @notFound()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int GetQueryNum(FILE *fp) {
  int ch, number_of_lines = 0;
  do {
    ch = fgetc(fp);
    if (ch == '\n')
      number_of_lines++;
  } while (ch != EOF);
  rewind(fp);
  return number_of_lines;
}


x86 assembly (clang, -O0):
<GetQueryNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jne    1152 <GetQueryNum+0x32>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1157 <GetQueryNum+0x37>
mov    -0xc(%rbp),%eax
mov    0x2e87(%rip),%rcx
cmp    (%rcx),%eax
jne    1133 <GetQueryNum+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetQueryNum>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %ebx,%ebx
mov    0x2eb7(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <fgetc@plt>
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
cmp    (%r15),%eax
jne    1140 <GetQueryNum+0x20>
mov    %r14,%rdi
call   1030 <rewind@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @GetQueryNum(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %7, %2 ]
%4 = tail call i32 @fgetc(i32* %0)
%5 = icmp eq i32 %4, 10
%6 = zext i1 %5 to i32
%7 = add nuw nsw i32 %3, %6
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %4, %8
br i1 %9, label %10, label %2
10: ; preds = %2
%11 = tail call i32 @rewind(i32* %0)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ displayDesciption();
int main() { displayDesciption(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <displayDesciption@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @displayDesciption()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @displayDesciption()
ret i32 0
}
unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
                           unsigned long pc, unsigned long *ra) {
  return 0;
}


x86 assembly (clang, -O0):
<unwind_stack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define i64 @unwind_stack(%struct.task_struct* %0, i64* %1, i64 %2, i64* %3) {
%5 = alloca %struct.task_struct*
%6 = alloca i64*
%7 = alloca i64
%8 = alloca i64*
store %struct.task_struct* %0, %struct.task_struct** %5
store i64* %1, i64** %6
store i64 %2, i64* %7
store i64* %3, i64** %8
ret i64 0
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define i64 @unwind_stack(%struct.task_struct* nocapture readnone %0, i64* nocapture readnone %1, i64 %2, i64* nocapture readnone %3) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ _PC_PATH_MAX;
int pathconf(char *, int /*<<< orphan*/);
int pathmax(void) {
  static int pathmax = 0;
  if (pathmax == 0) {
    pathmax = pathconf("/", _PC_PATH_MAX);
    pathmax = (pathmax <= 0) ? 1024 : pathmax + 1;
  }
  return pathmax;
}


x86 assembly (clang, -O0):
<pathmax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f0d(%rip)
jne    116f <pathmax+0x5f>
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    0xecb(%rip),%rdi
call   1030 <pathconf@plt>
mov    %eax,0x2eec(%rip)
cmpl   $0x0,0x2ee5(%rip)
jg     115a <pathmax+0x4a>
mov    $0x400,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <pathmax+0x56>
mov    0x2ecc(%rip),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,0x2ebd(%rip)
mov    0x2eb7(%rip),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathmax>:
push   %rax
mov    0x2f15(%rip),%eax
test   %eax,%eax
je     111d <pathmax+0xd>
pop    %rcx
ret
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
lea    0xed3(%rip),%rdi
call   1030 <pathconf@plt>
lea    0x1(%rax),%ecx
test   %eax,%eax
mov    $0x400,%eax
cmovg  %ecx,%eax
mov    %eax,0x2ee7(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@pathmax.pathmax = internal global i32 0
@.str = [2 x i8] c"/\00"
@_PC_PATH_MAX = global i32 0
define i32 @pathmax() {
%1 = load i32, i32* @pathmax.pathmax
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %14
3: ; preds = %0
%4 = load i32, i32* @_PC_PATH_MAX
%5 = call i32 @pathconf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* @pathmax.pathmax
%6 = load i32, i32* @pathmax.pathmax
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
br label %12
9: ; preds = %3
%10 = load i32, i32* @pathmax.pathmax
%11 = add nsw i32 %10, 1
br label %12
12: ; preds = %9, %8
%13 = phi i32 [ 1024, %8 ], [ %11, %9 ]
store i32 %13, i32* @pathmax.pathmax
br label %14
14: ; preds = %12, %0
%15 = load i32, i32* @pathmax.pathmax
ret i32 %15
}

LLVM IR (-O2):
@pathmax.pathmax = internal unnamed_addr global i32 0
@.str = [2 x i8] c"/\00"
@_PC_PATH_MAX = global i32 0
define i32 @pathmax() {
%1 = load i32, i32* @pathmax.pathmax
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = load i32, i32* @_PC_PATH_MAX
%5 = tail call i32 @pathconf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp slt i32 %5, 1
%7 = add nsw i32 %5, 1
%8 = select i1 %6, i32 1024, i32 %7
store i32 %8, i32* @pathmax.pathmax
br label %9
9: ; preds = %3, %0
%10 = phi i32 [ %8, %3 ], [ %1, %0 ]
ret i32 %10
}
/* Variables and functions */
double floor(double);
double fint(double x) { return (x >= 0.0) ? floor(x) : -floor(-x); }


x86 assembly (clang, -O0):
<fint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1143 <fint+0x33>
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1180 <fint+0x70>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <floor@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fint>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    1132 <fint+0x22>
push   %rax
xorpd  0xedd(%rip),%xmm0
call   1030 <floor@plt>
xorpd  0xed0(%rip),%xmm0
pop    %rax
ret
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @fint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = call double @llvm.floor.f64(double %6)
br label %13
8: ; preds = %1
%9 = load double, double* %2
%10 = fneg double %9
%11 = call double @llvm.floor.f64(double %10)
%12 = fneg double %11
br label %13
13: ; preds = %8, %5
%14 = phi double [ %7, %5 ], [ %12, %8 ]
ret double %14
}

LLVM IR (-O2):
define double @fint(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double @llvm.floor.f64(double %0)
br label %9
5: ; preds = %1
%6 = fneg double %0
%7 = tail call double @llvm.floor.f64(double %6)
%8 = fneg double %7
br label %9
9: ; preds = %5, %3
%10 = phi double [ %4, %3 ], [ %8, %5 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ ActuatorCommandHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void ActuatorCommandUpdated() { UAVObjUpdated(ActuatorCommandHandle()); }


x86 assembly (clang, -O0):
<ActuatorCommandUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ActuatorCommandHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ActuatorCommandUpdated>:
push   %rax
xor    %eax,%eax
call   1040 <ActuatorCommandHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @ActuatorCommandUpdated() {
%1 = call i32 (...) @ActuatorCommandHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @ActuatorCommandUpdated() {
%1 = tail call i32 (...) @ActuatorCommandHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
void TOSH_MAKE_PW6_OUTPUT() { ; }


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

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

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

LLVM IR (-O2):
define void @TOSH_MAKE_PW6_OUTPUT() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main() {
  setuid(0);
  system("/home/backup_manager/scripts/backup.pl");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xec3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"/home/backup_manager/scripts/backup.pl\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setuid(i32 0)
%3 = call i32 @system(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"/home/backup_manager/scripts/backup.pl\00"
define i32 @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @system(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void serv_power_sleep() {
  while (1) {
  };
}


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

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

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

LLVM IR (-O2):
define void @serv_power_sleep() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void ml_print_vec2(float vec[2]) {
  for (int i = 0; i < 2; i++) {
    printf("%f ", vec[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<ml_print_vec2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    115a <ml_print_vec2+0x4a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xebb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ml_print_vec2+0x13>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ml_print_vec2>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeca(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f \00"
define void @ml_print_vec2(float* nocapture %0) {
%2 = load float, float* %0
%3 = fpext float %2 to double
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %3)
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fpext float %6 to double
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %7)
%9 = tail call i32 @putchar(i32 10)
ret void
}