xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void schar_put(signed char number, FILE *stream) {
  if (number > (signed char)9) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
    schar_put(number / (signed char)10, stream);
#pragma GCC diagnostic pop
  }
  fputc('0' + (char)(number % (signed char)10), stream);
}


x86 assembly (clang, -O0):
<schar_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jle    1157 <schar_put+0x37>
movsbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <schar_put@plt>
movsbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movsbl %al,%eax
add    $0x30,%eax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<schar_put>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0xa,%bpl
jl     1143 <schar_put+0x23>
movzbl %bpl,%eax
imul   $0xcd,%eax,%edi
shr    $0xb,%edi
mov    %rbx,%rsi
call   1040 <schar_put@plt>
movsbl %bpl,%eax
imul   $0x67,%eax,%eax
movzwl %ax,%ecx
shr    $0xa,%eax
shr    $0xf,%ecx
add    %al,%cl
movzbl %cl,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %al,%bpl
add    $0x30,%bpl
movsbl %bpl,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @schar_put(i8 signext %0, i32* %1) {
%3 = alloca i8
%4 = alloca i32*
store i8 %0, i8* %3
store i32* %1, i32** %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sgt i32 %6, 9
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = sdiv i32 %10, 10
%12 = trunc i32 %11 to i8
%13 = load i32*, i32** %4
br label %14
14: ; preds = %8, %2
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = srem i32 %16, 10
%18 = trunc i32 %17 to i8
%19 = sext i8 %18 to i32
%20 = add nsw i32 48, %19
%21 = trunc i32 %20 to i8
%22 = load i32*, i32** %4
%23 = call i32 @fputc(i8 signext %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @schar_put(i8 signext %0, i32* nocapture %1) {
%3 = icmp sgt i8 %0, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = udiv i8 %0, 10
tail call void @schar_put(i8 signext %5, i32* %1)
br label %6
6: ; preds = %4, %2
%7 = srem i8 %0, 10
%8 = add nsw i8 %7, 48
%9 = tail call i32 @fputc(i8 signext %8, i32* %1)
ret void
}
void free_definitions(void) { return; }


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

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

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

LLVM IR (-O2):
define void @free_definitions() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void sig_handler(const int sig) {
  exit(-1);
  return;
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @sig_handler(i32 %0) {
%2 = tail call i32 @exit(i32 -1)
unreachable
}
void _RecvTokenWithValue(long *val) {}


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

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

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

LLVM IR (-O2):
define void @_RecvTokenWithValue(i64* nocapture %0) {
ret void
}
void copyLine(char to[], char from[]) {
  int i;
  for (i = 0; (to[i] = from[i]) != '\0'; ++i)
    ;
}


x86 assembly (clang, -O0):
<copyLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1148 <copyLine+0x48>
jmp    113a <copyLine+0x3a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <copyLine+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyLine>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copyLine+0x10>
ret

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

LLVM IR (-O2):
define void @copyLine(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void serial_help_devs() {
  printf("The tty serial driver doesn't support this command.\n");
}


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

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

LLVM IR (-O0):
@.str = [53 x i8] c"The tty serial driver doesn't support this command.\0A\00"
define void @serial_help_devs() {
%1 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [52 x i8] c"The tty serial driver doesn't support this command.\00"
define void @serial_help_devs() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __flsl(unsigned long);
__attribute__((always_)) int __flsll(long long value) {
  unsigned long high = (value >> 32);
  unsigned long low = (value >> 0);
  if (high) {
    return (32 + __flsl(high));
  } else if (low) {
    return (__flsl(low));
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<__flsll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x20,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x0,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1153 <__flsll+0x43>
mov    -0x18(%rbp),%rdi
call   1030 <__flsl@plt>
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <__flsll+0x66>
cmpq   $0x0,-0x20(%rbp)
je     116f <__flsll+0x5f>
mov    -0x20(%rbp),%rdi
call   1030 <__flsl@plt>
mov    %eax,-0x4(%rbp)
jmp    1176 <__flsll+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__flsll>:
mov    %rdi,%rax
shr    $0x20,%rax
jne    1123 <__flsll+0x13>
test   %rdi,%rdi
je     1135 <__flsll+0x25>
jmp    1030 <__flsl@plt>
push   %rax
sar    $0x20,%rdi
call   1030 <__flsl@plt>
add    $0x20,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @__flsll(i64 %0) {
%2 = icmp ult i64 %0, 4294967296
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = ashr i64 %0, 32
%5 = tail call i32 @__flsl(i64 %4)
%6 = add nsw i32 %5, 32
br label %11
7: ; preds = %1
%8 = icmp eq i64 %0, 0
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @__flsl(i64 %0)
br label %11
11: ; preds = %7, %9, %3
%12 = phi i32 [ %6, %3 ], [ %10, %9 ], [ 0, %7 ]
ret i32 %12
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
void set_XButtonEvent_y(void *_p, int _v) { ((XButtonEvent *)_p)->y = (int)_v; }


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

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

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

LLVM IR (-O2):
define void @set_XButtonEvent_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int test_imm_4Dint8_mem(signed char *val) {
  return ((*val) & (0x4D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Dint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 77
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ GLsizei;

/* Variables and functions */
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
void myreshape(GLsizei w, GLsizei h) {
  glViewport(0, 0, w, h);
  glFlush();
}


x86 assembly (clang, -O0):
<myreshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1040 <glViewport@plt>
mov    $0x0,%al
call   1030 <glFlush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myreshape>:
push   %rax
mov    %esi,%ecx
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <glViewport@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glFlush@plt>

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

LLVM IR (-O2):
define void @myreshape(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = tail call i32 (...) @glFlush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cc32xx_binary_file_read(char *, char **, size_t *, int *);
void ext_status_read(char **buffer, size_t *buffer_size,
                     bool *needs_deallocation) {
  cc32xx_binary_file_read("kaa_status.bin", buffer, buffer_size,
                          needs_deallocation);
}


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

x86 assembly (clang, -O2):
<ext_status_read>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee0(%rip),%rdi
jmp    1030 <cc32xx_binary_file_read@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"kaa_status.bin\00"
define void @ext_status_read(i8** %0, i64* %1, i32* %2) {
%4 = alloca i8**
%5 = alloca i64*
%6 = alloca i32*
store i8** %0, i8*** %4
store i64* %1, i64** %5
store i32* %2, i32** %6
%7 = load i8**, i8*** %4
%8 = load i64*, i64** %5
%9 = load i32*, i32** %6
%10 = call i32 @cc32xx_binary_file_read(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %7, i64* %8, i32* %9)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"kaa_status.bin\00"
define void @ext_status_read(i8** %0, i64* %1, i32* %2) {
%4 = tail call i32 @cc32xx_binary_file_read(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %0, i64* %1, i32* %2)
ret void
}
/* Variables and functions */
int *my_malloc(int);
void af1_b() { int *p = my_malloc(12); }


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

x86 assembly (clang, -O2):
<af1_b>:
mov    $0xc,%edi
jmp    1030 <my_malloc@plt>

LLVM IR (-O0):
define void @af1_b() {
%1 = alloca i32*
%2 = call i32* @my_malloc(i32 12)
store i32* %2, i32** %1
ret void
}

LLVM IR (-O2):
define void @af1_b() {
%1 = tail call i32* @my_malloc(i32 12)
ret void
}
/* Variables and functions */
float cos(float);
float de_jongs(float, float);
float sqrt(int);
float griewangk(float x1, float x2) {
  float valor = de_jongs(x1, x2);
  return (valor / 4000.0) - (cos(x1) * cos(x2 / sqrt(2))) + 1;
}


x86 assembly (clang, -O0):
<griewangk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <de_jongs@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <cos@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
mov    $0x2,%edi
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
divss  %xmm1,%xmm0
call   1040 <cos@plt>
movss  -0x1c(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
mulss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  0xe3b(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<griewangk>:
sub    $0x18,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
call   1030 <de_jongs@plt>
cvtss2sd %xmm0,%xmm0
divsd  0xeaf(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movss  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movss  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1050 <sqrt@plt>
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1040 <cos@plt>
mulss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
addsd  0xe68(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @griewangk(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 = call float @de_jongs(float %6, float %7)
store float %8, float* %5
%9 = load float, float* %5
%10 = fpext float %9 to double
%11 = fdiv double %10, 4.000000e+03
%12 = load float, float* %3
%13 = call float @cos(float %12)
%14 = load float, float* %4
%15 = call float @sqrt(i32 2)
%16 = fdiv float %14, %15
%17 = call float @cos(float %16)
%18 = fmul float %13, %17
%19 = fpext float %18 to double
%20 = fsub double %11, %19
%21 = fadd double %20, 1.000000e+00
%22 = fptrunc double %21 to float
ret float %22
}

LLVM IR (-O2):
define float @griewangk(float %0, float %1) {
%3 = tail call float @de_jongs(float %0, float %1)
%4 = fpext float %3 to double
%5 = fdiv double %4, 4.000000e+03
%6 = tail call float @cos(float %0)
%7 = tail call float @sqrt(i32 2)
%8 = fdiv float %1, %7
%9 = tail call float @cos(float %8)
%10 = fmul float %6, %9
%11 = fpext float %10 to double
%12 = fsub double %5, %11
%13 = fadd double %12, 1.000000e+00
%14 = fptrunc double %13 to float
ret float %14
}
char *internal_backend_name(void) { return "none"; }


x86 assembly (clang, -O0):
<internal_backend_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_backend_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"none\00"
define i8* @internal_backend_name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"none\00"
define i8* @internal_backend_name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
f_get_my_resident_time__(int *wu, int *wh, int *ws) {
  char *hostname;
  *wu = 0;
  *wh = 1800;
  *ws = 1800;
}


x86 assembly (clang, -O0):
<f_get_my_resident_time__>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x708,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x708,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_get_my_resident_time__>:
movl   $0x0,(%rdi)
movl   $0x708,(%rsi)
movl   $0x708,(%rdx)
ret

LLVM IR (-O0):
define i32 @f_get_my_resident_time__(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%9 = load i32*, i32** %5
store i32 0, i32* %9
%10 = load i32*, i32** %6
store i32 1800, i32* %10
%11 = load i32*, i32** %7
store i32 1800, i32* %11
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
define i32 @f_get_my_resident_time__(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
store i32 0, i32* %0
store i32 1800, i32* %1
store i32 1800, i32* %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ create_command(int, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ send_command();
int wait_for_ack(int, int);
int camera_light_freq(int freq) {
  create_command(0x13, freq, 0, 0, 0);
  send_command();
  int result = wait_for_ack(100000, 0x13);
  printf("camera_light_freq %d result=%d\n", 491, result);
  return result;
}


x86 assembly (clang, -O0):
<camera_light_freq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x13,%edi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1060 <create_command@plt>
mov    $0x0,%al
call   1050 <send_command@plt>
mov    $0x186a0,%edi
mov    $0x13,%esi
call   1040 <wait_for_ack@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
lea    0xe7c(%rip),%rdi
mov    $0x1eb,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<camera_light_freq>:
push   %rbx
mov    %edi,%esi
mov    $0x13,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1060 <create_command@plt>
xor    %eax,%eax
call   1050 <send_command@plt>
mov    $0x186a0,%edi
mov    $0x13,%esi
call   1040 <wait_for_ack@plt>
mov    %eax,%ebx
lea    0xe8d(%rip),%rdi
mov    $0x1eb,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"camera_light_freq %d result=%d\0A\00"
define i32 @camera_light_freq(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @create_command(i32 19, i32 %4, i32 0, i32 0, i32 0)
%6 = call i32 (...) @send_command()
%7 = call i32 @wait_for_ack(i32 100000, i32 19)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 491, i32 %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [32 x i8] c"camera_light_freq %d result=%d\0A\00"
define i32 @camera_light_freq(i32 %0) {
%2 = tail call i32 @create_command(i32 19, i32 %0, i32 0, i32 0, i32 0)
%3 = tail call i32 (...) @send_command()
%4 = tail call i32 @wait_for_ack(i32 100000, i32 19)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 491, i32 %4)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void pack_add_flt(uint8_t *buffer, int byteNr, float value) {
  *(buffer + byteNr + 3) = *(((uint8_t *)(&value)) + 3);
  *(buffer + byteNr + 2) = *(((uint8_t *)(&value)) + 2);
  *(buffer + byteNr + 1) = *(((uint8_t *)(&value)) + 1);
  *(buffer + byteNr) = *((uint8_t *)(&value));
}


x86 assembly (clang, -O0):
<pack_add_flt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,0xc(%rax,%rcx,4)
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,0x8(%rax,%rcx,4)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,0x4(%rax,%rcx,4)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_add_flt>:
movslq %esi,%rax
movss  %xmm0,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @pack_add_flt(i32* %0, i32 %1, float %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca float
store i32* %0, i32** %4
store i32 %1, i32* %5
store float %2, float* %6
%7 = bitcast float* %6 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 3
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = getelementptr inbounds i32, i32* %13, i64 3
store i32 %9, i32* %14
%15 = bitcast float* %6 to i32*
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = getelementptr inbounds i32, i32* %21, i64 2
store i32 %17, i32* %22
%23 = bitcast float* %6 to i32*
%24 = getelementptr inbounds i32, i32* %23, i64 1
%25 = load i32, i32* %24
%26 = load i32*, i32** %4
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
%30 = getelementptr inbounds i32, i32* %29, i64 1
store i32 %25, i32* %30
%31 = bitcast float* %6 to i32*
%32 = load i32, i32* %31
%33 = load i32*, i32** %4
%34 = load i32, i32* %5
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %33, i64 %35
store i32 %32, i32* %36
ret void
}

LLVM IR (-O2):
define void @pack_add_flt(i32* nocapture writeonly %0, i32 %1, float %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = bitcast i32* %5 to float*
store float %2, float* %6
ret void
}
int fun508() { return 508; }


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

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

LLVM IR (-O0):
define i32 @fun508() {
ret i32 508
}

LLVM IR (-O2):
define i32 @fun508() {
ret i32 508
}
/* Variables and functions */
int U_PMR_NODATAREC_print(char const *);
int U_PMR_RESETWORLDTRANSFORM_print(const char *contents) {
  return (U_PMR_NODATAREC_print(contents));
}


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

x86 assembly (clang, -O2):
<U_PMR_RESETWORLDTRANSFORM_print>:
jmp    1030 <U_PMR_NODATAREC_print@plt>

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

LLVM IR (-O2):
define i32 @U_PMR_RESETWORLDTRANSFORM_print(i8* %0) {
%2 = tail call i32 @U_PMR_NODATAREC_print(i8* %0)
ret i32 %2
}
int tpm_close_v03(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tpm_close_v03() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ killCmdWindow();
void killAllWindows() { killCmdWindow(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ Machine_Check(int, char *);
void set_byte(int32_t id, int32_t addr, int32_t value) {
  Machine_Check(0x00000008 | 0x00000002, "Disk: illegal byte register access");
}


x86 assembly (clang, -O0):
<set_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xa,%edi
lea    0xed3(%rip),%rsi
call   1030 <Machine_Check@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"Disk: illegal byte register access\00"
define void @set_byte(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 = call i32 @Machine_Check(i32 10, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Disk: illegal byte register access\00"
define void @set_byte(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @Machine_Check(i32 10, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int checker_read_double(int /*<<< orphan*/, char const *, int, double *);
int checker_read_in_double(const char *name, int eof_error_flag,
                           double *p_val) {
  return checker_read_double(0, name, eof_error_flag, p_val);
}


x86 assembly (clang, -O0):
<checker_read_in_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %edi,%edi
call   1030 <checker_read_double@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checker_read_in_double>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <checker_read_double@plt>

LLVM IR (-O0):
define i32 @checker_read_in_double(i8* %0, i32 %1, double* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca double*
store i8* %0, i8** %4
store i32 %1, i32* %5
store double* %2, double** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load double*, double** %6
%10 = call i32 @checker_read_double(i32 0, i8* %7, i32 %8, double* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @checker_read_in_double(i8* %0, i32 %1, double* %2) {
%4 = tail call i32 @checker_read_double(i32 0, i8* %0, i32 %1, double* %2)
ret i32 %4
}
/* Variables and functions */
bool fspath_listdir(const char path[], char **array) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @fspath_listdir(i8* nocapture readnone %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int dystans = 100;
  printf("Przebyłeś %d mil.\n", dystans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"Przeby\C5\82e\C5\9B %d mil.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Przeby\C5\82e\C5\9B %d mil.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
void cleanup_futex_sems(int num) { return; }


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

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

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

LLVM IR (-O2):
define void @cleanup_futex_sems(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t apic_prepare_ipi_init(void) { return 0 | (1 << 14) | (5 << 8); }


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

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

LLVM IR (-O0):
define i32 @apic_prepare_ipi_init() {
ret i32 17664
}

LLVM IR (-O2):
define i32 @apic_prepare_ipi_init() {
ret i32 17664
}
/* Variables and functions */
long rand();
long lrand(void) { return rand(); }


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

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

LLVM IR (-O0):
define i64 @lrand() {
%1 = call i64 (...) @rand()
ret i64 %1
}

LLVM IR (-O2):
define i64 @lrand() {
%1 = tail call i64 (...) @rand()
ret i64 %1
}
/* Variables and functions */
double pow(float, double);
float sqrt(float);
float g(float t) {
  return sqrt(t) - pow(3.1415927 / 2.0, 2.25) * pow(t, 0.75) / 2.25;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <sqrt@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  0xec8(%rip),%xmm0
movsd  0xeb0(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movsd  0xea1(%rip),%xmm1
call   1030 <pow@plt>
movsd  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm1
movsd  0xe7b(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
sub    $0x18,%rsp
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
movss  %xmm0,0x4(%rsp)
jb     1138 <g+0x18>
sqrtss %xmm0,%xmm0
jmp    113d <g+0x1d>
call   1040 <sqrt@plt>
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
movss  0xeb1(%rip),%xmm0
movsd  0xeb1(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xea6(%rip),%xmm1
movss  0x4(%rsp),%xmm0
call   1030 <pow@plt>
mulsd  0x8(%rsp),%xmm0
divsd  0xe85(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @g(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sqrt(float %3)
%5 = fpext float %4 to double
%6 = call double @pow(float 0x3FF921FB60000000, double 2.250000e+00)
%7 = load float, float* %2
%8 = call double @pow(float %7, double 7.500000e-01)
%9 = fmul double %6, %8
%10 = fdiv double %9, 2.250000e+00
%11 = fsub double %5, %10
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
define float @g(float %0) {
%2 = tail call float @sqrt(float %0)
%3 = fpext float %2 to double
%4 = tail call double @pow(float 0x3FF921FB60000000, double 2.250000e+00)
%5 = tail call double @pow(float %0, double 7.500000e-01)
%6 = fmul double %4, %5
%7 = fdiv double %6, 2.250000e+00
%8 = fsub double %3, %7
%9 = fptrunc double %8 to float
ret float %9
}
int d_lt_mm2(double *a1, double *a2) { return !(((*a1) < (*a2))); }


x86 assembly (clang, -O0):
<d_lt_mm2>:
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),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_lt_mm2>:
movsd  (%rsi),%xmm0
xor    %eax,%eax
ucomisd (%rdi),%xmm0
setbe  %al
ret

LLVM IR (-O0):
define i32 @d_lt_mm2(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* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp olt double %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @d_lt_mm2(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp uge double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) {
  int i;
  i = vsnprintf(buf, size, fmt, args);
  return (i >= size) ? (size - 1) : i;
}


x86 assembly (clang, -O0):
<vscnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <vsnprintf@plt>
mov    %eax,-0x20(%rbp)
movslq -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     115d <vscnprintf+0x4d>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1165 <vscnprintf+0x55>
movslq -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vscnprintf>:
push   %rbx
mov    %rsi,%rbx
call   1030 <vsnprintf@plt>
cltq
lea    -0x1(%rbx),%ecx
cmp    %rbx,%rax
cmovae %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @vscnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
%6 = sext i32 %5 to i64
%7 = icmp ult i64 %6, %1
%8 = add i64 %1, 4294967295
%9 = select i1 %7, i64 %6, i64 %8
%10 = trunc i64 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int mvwscanw(int /*<<< orphan*/ *, int, int, char *, int *);
int i_mvwscanw(WINDOW *win, int y, int x, char *fmt, int *i) {
  return (mvwscanw(win, y, x, fmt, i));
}


x86 assembly (clang, -O0):
<i_mvwscanw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <mvwscanw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_mvwscanw>:
jmp    1030 <mvwscanw@plt>

LLVM IR (-O0):
define i32 @i_mvwscanw(i32* %0, i32 %1, i32 %2, i8* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i32*, i32** %10
%16 = call i32 @mvwscanw(i32* %11, i32 %12, i32 %13, i8* %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @i_mvwscanw(i32* %0, i32 %1, i32 %2, i8* %3, i32* %4) {
%6 = tail call i32 @mvwscanw(i32* %0, i32 %1, i32 %2, i8* %3, i32* %4)
ret i32 %6
}
/* Type definitions */
struct timespec {
  unsigned long tv_sec;
  unsigned long tv_nsec;
};

/* Variables and functions */
struct timespec usec_to_timespec(unsigned long usec) {
  struct timespec ts;
  ts.tv_sec = usec / 1000000;
  ts.tv_nsec = (usec % 1000000) * 1000;
  return ts;
}


x86 assembly (clang, -O0):
<usec_to_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mul    %rcx
shr    $0x12,%rdx
mov    %rdx,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mul    %rcx
mov    -0x20(%rbp),%rax
shr    $0x12,%rdx
imul   $0xf4240,%rdx,%rcx
sub    %rcx,%rax
imul   $0x3e8,%rax,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<usec_to_timespec>:
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rdi,%rax
mul    %rcx
mov    %rdx,%rax
shr    $0x12,%rax
imul   $0xf4240,%rax,%rcx
sub    %rcx,%rdi
imul   $0x3e8,%rdi,%rdx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define { i64, i64 } @usec_to_timespec(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = udiv i64 %4, 1000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %3
%8 = urem i64 %7, 1000000
%9 = mul i64 %8, 1000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 %9, i64* %10
%11 = bitcast %struct.timespec* %2 to { i64, i64 }*
%12 = load { i64, i64 }, { i64, i64 }* %11
ret { i64, i64 } %12
}

LLVM IR (-O2):
define { i64, i64 } @usec_to_timespec(i64 %0) {
%2 = udiv i64 %0, 1000000
%3 = urem i64 %0, 1000000
%4 = mul nuw nsw i64 %3, 1000
%5 = insertvalue { i64, i64 } poison, i64 %2, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
int test_imm_88int64_lowword_reg(long long val) {
  return ((val) & (0x88 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_88int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x88,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_88int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 136
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ skipspaces(char const *);
__attribute__((nonnull(1))) char *vskipspaces(const char *s) {
  return (char *)skipspaces(s);
}


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

x86 assembly (clang, -O2):
<vskipspaces>:
jmp    1030 <skipspaces@plt>

LLVM IR (-O0):
define i8* @vskipspaces(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @skipspaces(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @vskipspaces(i8* %0) {
%2 = tail call i64 @skipspaces(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void abx500_pinctrl_ab8500_init(struct abx500_pinctrl_soc_data **soc) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.abx500_pinctrl_soc_data = type opaque
define void @abx500_pinctrl_ab8500_init(%struct.abx500_pinctrl_soc_data** nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t op_logical_and(uint32_t a, uint32_t b) { return a && b; }


x86 assembly (clang, -O0):
<op_logical_and>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1123 <op_logical_and+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_logical_and>:
test   %edi,%edi
setne  %al
test   %esi,%esi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @op_logical_and(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @op_logical_and(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void fi_free(const void *p) {
  if (NULL != p)
    free((void *)p);
}


x86 assembly (clang, -O0):
<fi_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1131 <fi_free+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fi_free>:
test   %rdi,%rdi
je     111a <fi_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @fi_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndexedXX1(int);
int /*<<< orphan*/ STA8(int /*<<< orphan*/);
void Op9DM1X1(void) { STA8(AbsoluteIndexedXX1(2)); }


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

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

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

LLVM IR (-O2):
define void @Op9DM1X1() {
%1 = tail call i32 @AbsoluteIndexedXX1(i32 2)
%2 = tail call i32 @STA8(i32 %1)
ret void
}
void rop3_14_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | S;
  stk2 = ~stk2;
  stk1 = T | stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_14_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_14_0_0>:
or     (%rdi),%sil
not    %dl
and    %sil,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_14_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = load i8*, i8** %4
store i8 %30, i8* %31
ret void
}

LLVM IR (-O2):
define void @rop3_14_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %1
%6 = xor i8 %2, -1
%7 = and i8 %5, %6
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SetPos68(unsigned long, unsigned long);
void setpos(unsigned long x, unsigned long y) { SetPos68(x, y); }


x86 assembly (clang, -O0):
<setpos>:
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 <SetPos68@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setpos>:
jmp    1030 <SetPos68@plt>

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

LLVM IR (-O2):
define void @setpos(i64 %0, i64 %1) {
%3 = tail call i32 @SetPos68(i64 %0, i64 %1)
ret void
}
void X509_keyid_set1(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_keyid_set1() {
ret void
}