xunge/DecIR huggingface dataset:
/* Variables and functions */
char const *fmt_human(long, int);
scalar_t__ get_swap_info(long *, long *, long *);
const char *swap_used(void) {
  long total, free, cached;
  if (get_swap_info(&total, &free, &cached)) {
    return NULL;
  }
  return fmt_human((total - free - cached) * 1024, 1024);
}


x86 assembly (clang, -O0):
<swap_used>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <get_swap_info@plt>
cmp    $0x0,%rax
je     1150 <swap_used+0x30>
movq   $0x0,-0x8(%rbp)
jmp    116e <swap_used+0x4e>
mov    -0x10(%rbp),%rdi
sub    -0x18(%rbp),%rdi
sub    -0x20(%rbp),%rdi
shl    $0xa,%rdi
mov    $0x400,%esi
call   1030 <fmt_human@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_used>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <get_swap_info@plt>
test   %rax,%rax
je     1142 <swap_used+0x22>
xor    %eax,%eax
add    $0x18,%rsp
ret
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rax
add    (%rsp),%rax
sub    %rax,%rdi
shl    $0xa,%rdi
mov    $0x400,%esi
call   1030 <fmt_human@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i8* @swap_used() {
%1 = alloca i8*
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = call i64 @get_swap_info(i64* %2, i64* %3, i64* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i8* null, i8** %1
br label %16
8: ; preds = %0
%9 = load i64, i64* %2
%10 = load i64, i64* %3
%11 = sub nsw i64 %9, %10
%12 = load i64, i64* %4
%13 = sub nsw i64 %11, %12
%14 = mul nsw i64 %13, 1024
%15 = call i8* @fmt_human(i64 %14, i32 1024)
store i8* %15, i8** %1
br label %16
16: ; preds = %8, %7
%17 = load i8*, i8** %1
ret i8* %17
}

LLVM IR (-O2):
define i8* @swap_used() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
%5 = bitcast i64* %2 to i8*
%6 = bitcast i64* %3 to i8*
%7 = call i64 @get_swap_info(i64* %1, i64* %2, i64* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %0
%10 = load i64, i64* %1
%11 = load i64, i64* %2
%12 = load i64, i64* %3
%13 = add i64 %11, %12
%14 = sub i64 %10, %13
%15 = shl nsw i64 %14, 10
%16 = call i8* @fmt_human(i64 %15, i32 1024)
br label %17
17: ; preds = %0, %9
%18 = phi i8* [ %16, %9 ], [ null, %0 ]
ret i8* %18
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int convertForward(struct node *);
int addForwardOrder(struct node *one, struct node *two) {
  return convertForward(one) + convertForward(two);
}


x86 assembly (clang, -O0):
<addForwardOrder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <convertForward@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <convertForward@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addForwardOrder>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <convertForward@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <convertForward@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @addForwardOrder(%struct.node* %0, %struct.node* %1) {
%3 = alloca %struct.node*
%4 = alloca %struct.node*
store %struct.node* %0, %struct.node** %3
store %struct.node* %1, %struct.node** %4
%5 = load %struct.node*, %struct.node** %3
%6 = call i32 @convertForward(%struct.node* %5)
%7 = load %struct.node*, %struct.node** %4
%8 = call i32 @convertForward(%struct.node* %7)
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @addForwardOrder(%struct.node* %0, %struct.node* %1) {
%3 = tail call i32 @convertForward(%struct.node* %0)
%4 = tail call i32 @convertForward(%struct.node* %1)
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int rand();
int r4n00m_1h4r(void) { return rand() % 255; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff80808081,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x7,%eax
add    %edx,%eax
mov    %eax,%edx
shl    $0x8,%edx
sub    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @r4n00m_1h4r() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 255
ret i32 %2
}

LLVM IR (-O2):
define i32 @r4n00m_1h4r() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 255
ret i32 %2
}
/* Variables and functions */
int ec_resume1(int /*<<< orphan*/);
int ec_resume(void) { return ec_resume1(0); }


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

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

LLVM IR (-O0):
define i32 @ec_resume() {
%1 = call i32 @ec_resume1(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @ec_resume() {
%1 = tail call i32 @ec_resume1(i32 0)
ret i32 %1
}
_Bool QuietLess(float f1, float f2) { return __builtin_isless(f1, f2); }


x86 assembly (clang, -O0):
<QuietLess>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuietLess>:
ucomiss %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define zeroext i1 @QuietLess(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @QuietLess(float %0, float %1) {
%3 = fcmp olt float %0, %1
ret i1 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rrr_L(uint8_t *data) {
  uint8_t temp = data[0];
  temp = (((temp) << 1) | ((temp) >> 7));
  temp ^= data[0];
  temp = (((temp) << 1) | ((temp) >> 7));
  data[0] ^= temp;
}


x86 assembly (clang, -O0):
<rrr_L>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0xc(%rbp),%ecx
sar    $0x7,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0xc(%rbp),%ecx
sar    $0x7,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rrr_L>:
mov    (%rdi),%eax
lea    (%rax,%rax,1),%ecx
mov    %eax,%edx
sar    $0x7,%edx
or     %ecx,%edx
xor    %eax,%edx
lea    (%rdx,%rdx,1),%ecx
sar    $0x7,%edx
or     %ecx,%edx
xor    %eax,%edx
mov    %edx,(%rdi)
ret

LLVM IR (-O0):
define void @rrr_L(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = shl i32 %7, 1
%9 = load i32, i32* %3
%10 = ashr i32 %9, 7
%11 = or i32 %8, %10
store i32 %11, i32* %3
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = load i32, i32* %3
%16 = xor i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = shl i32 %17, 1
%19 = load i32, i32* %3
%20 = ashr i32 %19, 7
%21 = or i32 %18, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = load i32*, i32** %2
%24 = getelementptr inbounds i32, i32* %23, i64 0
%25 = load i32, i32* %24
%26 = xor i32 %25, %22
store i32 %26, i32* %24
ret void
}

LLVM IR (-O2):
define void @rrr_L(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 1
%4 = ashr i32 %2, 7
%5 = or i32 %3, %4
%6 = xor i32 %5, %2
%7 = shl i32 %6, 1
%8 = ashr i32 %6, 7
%9 = or i32 %7, %8
%10 = xor i32 %9, %2
store i32 %10, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int enter_exit_subdir(void) {
  printf("enter_exit_subdir\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"enter_exit_subdir\00"
define i32 @enter_exit_subdir() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned int kolibri_button_get_identifier(void) {
  unsigned int identifier;
  __asm__ __volatile__("int $0x40" : "=a"(identifier) : "a"(17));
  if (identifier != 1)
    return identifier >> 8;
  else
    return identifier;
}


x86 assembly (clang, -O0):
<kolibri_button_get_identifier>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%eax
int    $0x40
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1126 <kolibri_button_get_identifier+0x26>
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x4(%rbp)
jmp    112c <kolibri_button_get_identifier+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kolibri_button_get_identifier>:
mov    $0x11,%eax
int    $0x40
mov    %eax,%ecx
shr    $0x8,%ecx
cmp    $0x1,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @kolibri_button_get_identifier() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 asm sideeffect "int $$0x40", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 17)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = lshr i32 %7, 8
store i32 %8, i32* %1
br label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @kolibri_button_get_identifier() {
%1 = tail call i32 asm sideeffect "int $$0x40", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 17)
%2 = icmp eq i32 %1, 1
%3 = lshr i32 %1, 8
%4 = select i1 %2, i32 1, i32 %3
ret i32 %4
}
void SSMR3PutGCUIntPtr(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3PutGCUIntPtr() {
ret void
}
int is_in_bound(int *arr, int size, int *ptr) {
  while (size > 0) {
    if (ptr == arr + size) {
      return 0;
    }
    size--;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    114f <is_in_bound+0x4f>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jne    1141 <is_in_bound+0x41>
movl   $0x0,-0x4(%rbp)
jmp    1156 <is_in_bound+0x56>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <is_in_bound+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
mov    $0x1,%eax
test   %esi,%esi
jle    1125 <is_in_bound+0x25>
nopl   0x0(%rax)
mov    %esi,%ecx
lea    (%rdi,%rcx,4),%rcx
cmp    %rdx,%rcx
je     1126 <is_in_bound+0x26>
lea    -0x1(%rsi),%ecx
cmp    $0x2,%esi
mov    %ecx,%esi
jge    1110 <is_in_bound+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %8, label %13
5: ; preds = %8
%6 = add nsw i32 %9, -1
%7 = icmp sgt i32 %9, 1
br i1 %7, label %8, label %13
8: ; preds = %3, %5
%9 = phi i32 [ %6, %5 ], [ %1, %3 ]
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = icmp eq i32* %11, %2
br i1 %12, label %13, label %5
13: ; preds = %8, %5, %3
%14 = phi i32 [ 1, %3 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int num;
  scanf("%d", &num);
  printf("%d", num);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ abs(float);
float closest(float a, float b, float c) {
  if (abs(a - b) < abs(a - c))
    return b;
  else
    return c;
}


x86 assembly (clang, -O0):
<closest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
call   1030 <abs@plt>
mov    %rax,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jge    1168 <closest+0x58>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1172 <closest+0x62>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closest>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm2,0x4(%rsp)
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
subss  %xmm1,%xmm0
call   1030 <abs@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
subss  0x4(%rsp),%xmm0
call   1030 <abs@plt>
movss  0xc(%rsp),%xmm0
cmp    %rax,%rbx
jl     1155 <closest+0x45>
movss  0x4(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @closest(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fsub float %8, %9
%11 = call i64 @abs(float %10)
%12 = load float, float* %5
%13 = load float, float* %7
%14 = fsub float %12, %13
%15 = call i64 @abs(float %14)
%16 = icmp slt i64 %11, %15
br i1 %16, label %17, label %19
17: ; preds = %3
%18 = load float, float* %6
store float %18, float* %4
br label %21
19: ; preds = %3
%20 = load float, float* %7
store float %20, float* %4
br label %21
21: ; preds = %19, %17
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @closest(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call i64 @abs(float %4)
%6 = fsub float %0, %2
%7 = tail call i64 @abs(float %6)
%8 = icmp slt i64 %5, %7
%9 = select i1 %8, float %1, float %2
ret float %9
}
/* Variables and functions */
int mkstemp(char *);
int os_mkstemp(char *template) { return (mkstemp(template)); }


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

x86 assembly (clang, -O2):
<os_mkstemp>:
jmp    1030 <mkstemp@plt>

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

LLVM IR (-O2):
define i32 @os_mkstemp(i8* %0) {
%2 = tail call i32 @mkstemp(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
long ReadLong(FILE *fileid) {
  int i;
  long fptr = 0;
  fptr = fgetc(fileid);
  fptr |= (fgetc(fileid) << 8);
  fptr |= (fgetc(fileid) << 16);
  fptr |= (fgetc(fileid) << 24);
  return fptr;
}


x86 assembly (clang, -O0):
<ReadLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
cltq
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x10,%eax
cltq
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
cltq
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadLong>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <fgetc@plt>
mov    %eax,%r14d
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
or     %r14d,%ebp
mov    %r15,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
mov    %r15,%rdi
call   1030 <fgetc@plt>
shl    $0x18,%eax
or     %ebx,%eax
or     %ebp,%eax
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @ReadLong(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i64
store i32* %0, i32** %2
store i64 0, i64* %4
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
%7 = sext i32 %6 to i64
store i64 %7, i64* %4
%8 = load i32*, i32** %2
%9 = call i32 @fgetc(i32* %8)
%10 = shl i32 %9, 8
%11 = sext i32 %10 to i64
%12 = load i64, i64* %4
%13 = or i64 %12, %11
store i64 %13, i64* %4
%14 = load i32*, i32** %2
%15 = call i32 @fgetc(i32* %14)
%16 = shl i32 %15, 16
%17 = sext i32 %16 to i64
%18 = load i64, i64* %4
%19 = or i64 %18, %17
store i64 %19, i64* %4
%20 = load i32*, i32** %2
%21 = call i32 @fgetc(i32* %20)
%22 = shl i32 %21, 24
%23 = sext i32 %22 to i64
%24 = load i64, i64* %4
%25 = or i64 %24, %23
store i64 %25, i64* %4
%26 = load i64, i64* %4
ret i64 %26
}

LLVM IR (-O2):
define i64 @ReadLong(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @fgetc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
%6 = tail call i32 @fgetc(i32* %0)
%7 = shl i32 %6, 16
%8 = or i32 %5, %7
%9 = tail call i32 @fgetc(i32* %0)
%10 = shl i32 %9, 24
%11 = or i32 %8, %10
%12 = sext i32 %11 to i64
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ fdcl();
int /*<<< orphan*/ hidden();
main() {
  fdcl();
  hidden();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fdcl()
%2 = tail call i32 (...) @hidden()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void lily_library_free(void *source) { dlclose(source); }


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

x86 assembly (clang, -O2):
<lily_library_free>:
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define void @lily_library_free(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret void
}
void mk20dx256_gpo_port_c_on(unsigned int pin) {
  *((volatile unsigned int *)0x400FF080) |= (1 << pin);
}


x86 assembly (clang, -O0):
<mk20dx256_gpo_port_c_on>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    $0x400ff080,%ecx
mov    (%rcx),%ecx
or     %eax,%ecx
mov    $0x400ff080,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk20dx256_gpo_port_c_on>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,0x400ff080
ret

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

LLVM IR (-O2):
define void @mk20dx256_gpo_port_c_on(i32 %0) {
%2 = shl nuw i32 1, %0
%3 = load volatile i32, i32* inttoptr (i64 1074786432 to i32*)
%4 = or i32 %3, %2
store volatile i32 %4, i32* inttoptr (i64 1074786432 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void handle_sigchld(int sig) {
  while (waitpid(-1, NULL, WNOHANG) > 0) {
    ;
  }
}


x86 assembly (clang, -O0):
<handle_sigchld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    1141 <handle_sigchld+0x31>
jmp    111b <handle_sigchld+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_sigchld>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <handle_sigchld+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @handle_sigchld(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @handle_sigchld(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_possible_plays_evaluate();
int main() {
  create_possible_plays_evaluate();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @create_possible_plays_evaluate()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ appendCODE(int /*<<< orphan*/);
int /*<<< orphan*/ makeCODEimul(int /*<<< orphan*/ *);
void code_imul() { appendCODE(makeCODEimul(NULL)); }


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

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

LLVM IR (-O0):
define void @code_imul() {
%1 = call i32 @makeCODEimul(i32* null)
%2 = call i32 @appendCODE(i32 %1)
ret void
}

LLVM IR (-O2):
define void @code_imul() {
%1 = tail call i32 @makeCODEimul(i32* null)
%2 = tail call i32 @appendCODE(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help() {
  fprintf(
      stderr,
      "gostsum [-bvt] [-c [file]]| [files]\n"
      "\t-c check message digests (default is generate)\n"
      "\t-v verbose, print file names when checking\n"
      "\t-b read files in binary mode\n"
      "\t-t use test GOST paramset (default is CryptoPro paramset)\n"
      "The input for -c should be the list of message digests and file names\n"
      "that is printed on stdout by this program when it generates digests.\n");
  exit(3);
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [357 x i8] c"gostsum [-bvt] [-c [file]]| [files]\0A\09-c check message digests (default is generate)\0A\09-v verbose, print file names when checking\0A\09-b read files in binary mode\0A\09-t use test GOST paramset (default is CryptoPro paramset)\0AThe input for -c should be the list of message digests and file names\0Athat is printed on stdout by this program when it generates digests.\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([357 x i8], [357 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [357 x i8] c"gostsum [-bvt] [-c [file]]| [files]\0A\09-c check message digests (default is generate)\0A\09-v verbose, print file names when checking\0A\09-b read files in binary mode\0A\09-t use test GOST paramset (default is CryptoPro paramset)\0AThe input for -c should be the list of message digests and file names\0Athat is printed on stdout by this program when it generates digests.\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([357 x i8], [357 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void ft_exit(int code) { exit(code); }


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

x86 assembly (clang, -O2):
<ft_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @ft_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int sg_drop_privileges();
int statgrab_drop_privileges() { return sg_drop_privileges(); }


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

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

LLVM IR (-O0):
define i32 @statgrab_drop_privileges() {
%1 = call i32 (...) @sg_drop_privileges()
ret i32 %1
}

LLVM IR (-O2):
define i32 @statgrab_drop_privileges() {
%1 = tail call i32 (...) @sg_drop_privileges()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ k_error(int /*<<< orphan*/);
int /*<<< orphan*/ sysmsg(int);
void k_txn_error() { k_error(sysmsg(1119)); }


x86 assembly (clang, -O0):
<k_txn_error>:
push   %rbp
mov    %rsp,%rbp
mov    $0x45f,%edi
call   1030 <sysmsg@plt>
mov    %eax,%edi
call   1040 <k_error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_txn_error>:
push   %rax
mov    $0x45f,%edi
call   1030 <sysmsg@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <k_error@plt>

LLVM IR (-O0):
define void @k_txn_error() {
%1 = call i32 @sysmsg(i32 1119)
%2 = call i32 @k_error(i32 %1)
ret void
}

LLVM IR (-O2):
define void @k_txn_error() {
%1 = tail call i32 @sysmsg(i32 1119)
%2 = tail call i32 @k_error(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_Translate_init(void) {
  _hmt_register_covercase("HMM_Translate", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_Translate_init>:
lea    0xee9(%rip),%rdi
lea    0xef0(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"HMM_Translate\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Translate_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"HMM_Translate\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Translate_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void nvidia_bl_init(struct nvidia_par *par) {}


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

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

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

LLVM IR (-O2):
%struct.nvidia_par = type opaque
define void @nvidia_bl_init(%struct.nvidia_par* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ printf(char *);
int main() {
  if (printf("Hello "))
    printf("World");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
cmp    $0x0,%rax
je     1141 <main+0x31>
lea    0xecb(%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
call   1030 <printf@plt>
test   %rax,%rax
je     112e <main+0x1e>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"Hello \00"
@.str.1 = [6 x i8] c"World\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i64 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"Hello \00"
@.str.1 = [6 x i8] c"World\00"
define i32 @main() {
%1 = tail call i64 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i64 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}
int test_imm_05uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x05 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_05uint64_highword_reg>:
movabs $0x500000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_05uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 21474836480
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void imul_m32(unsigned int *m32) {
  put8(0xF7);
  put8(0x2D);
  put32((unsigned int)(m32));
}


x86 assembly (clang, -O0):
<imul_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xf7,%edi
call   1030 <put8@plt>
mov    $0x2d,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imul_m32>:
push   %rbx
mov    %rdi,%rbx
mov    $0xf7,%edi
call   1030 <put8@plt>
mov    $0x2d,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @imul_m32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @put8(i32 247)
%4 = call i32 @put8(i32 45)
%5 = load i32*, i32** %2
%6 = ptrtoint i32* %5 to i32
%7 = call i32 @put32(i32 %6)
ret void
}

LLVM IR (-O2):
define void @imul_m32(i32* %0) {
%2 = tail call i32 @put8(i32 247)
%3 = tail call i32 @put8(i32 45)
%4 = ptrtoint i32* %0 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @put32(i32 %5)
ret void
}
/* Variables and functions */
int log(double);
double db(double x) { return 10 * log(x); }


x86 assembly (clang, -O0):
<db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
imul   $0xa,%eax,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db>:
push   %rax
call   1030 <log@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @db(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @log(double %3)
%5 = mul nsw i32 10, %4
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @db(double %0) {
%2 = tail call i32 @log(double %0)
%3 = mul nsw i32 %2, 10
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void tabletMotionCB(int x, int y) {
  printf("tabletMotionCB: X %d, Y %d\n", x, y);
}


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

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

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

LLVM IR (-O2):
@.str = [28 x i8] c"tabletMotionCB: X %d, Y %d\0A\00"
define void @tabletMotionCB(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
long floorl(long double);
long double ref_map(long, long, long);
long double split_map_check(long dim_in, long dim_out, long pos,
                            long double *ty) {
  long double smp;
  long smp_i;
  smp = ref_map(dim_in, dim_out, pos);
  smp_i = floorl(smp);
  *ty = smp - smp_i;
  return smp_i;
}


x86 assembly (clang, -O0):
<split_map_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <ref_map@plt>
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <floorl@plt>
mov    %rax,-0x38(%rbp)
fldt   -0x30(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x48(%rbp)
fildll -0x48(%rbp)
fsubrp %st,%st(1)
mov    -0x20(%rbp),%rax
fstpt  (%rax)
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
fildll -0x40(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split_map_check>:
push   %rbx
sub    $0x30,%rsp
mov    %rcx,%rbx
call   1030 <ref_map@plt>
fld    %st(0)
fstpt  0x24(%rsp)
fstpt  (%rsp)
call   1040 <floorl@plt>
mov    %rax,0x18(%rsp)
fildll 0x18(%rsp)
fldt   0x24(%rsp)
fsub   %st(1),%st
fstpt  (%rbx)
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define x86_fp80 @split_map_check(i64 %0, i64 %1, i64 %2, x86_fp80* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca x86_fp80*
%9 = alloca x86_fp80
%10 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store x86_fp80* %3, x86_fp80** %8
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = call x86_fp80 @ref_map(i64 %11, i64 %12, i64 %13)
store x86_fp80 %14, x86_fp80* %9
%15 = load x86_fp80, x86_fp80* %9
%16 = call i64 @floorl(x86_fp80 %15)
store i64 %16, i64* %10
%17 = load x86_fp80, x86_fp80* %9
%18 = load i64, i64* %10
%19 = sitofp i64 %18 to x86_fp80
%20 = fsub x86_fp80 %17, %19
%21 = load x86_fp80*, x86_fp80** %8
store x86_fp80 %20, x86_fp80* %21
%22 = load i64, i64* %10
%23 = sitofp i64 %22 to x86_fp80
ret x86_fp80 %23
}

LLVM IR (-O2):
define x86_fp80 @split_map_check(i64 %0, i64 %1, i64 %2, x86_fp80* nocapture writeonly %3) {
%5 = tail call x86_fp80 @ref_map(i64 %0, i64 %1, i64 %2)
%6 = tail call i64 @floorl(x86_fp80 %5)
%7 = sitofp i64 %6 to x86_fp80
%8 = fsub x86_fp80 %5, %7
store x86_fp80 %8, x86_fp80* %3
ret x86_fp80 %7
}
int SerialIsOpen(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @SerialIsOpen() {
ret i32 0
}
int test_imm_DDint16_mem(short *val) {
  return ((*val) & (-0xDD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DDint16_mem>:
movzwl (%rdi),%eax
test   $0xff23,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_DDint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -221
%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_DDint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -221
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct PIN_LCD {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ LCD_Command(int, struct PIN_LCD *);
void LCD_CLS(struct PIN_LCD *PIN_LCD) { LCD_Command(0x01, PIN_LCD); }


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

x86 assembly (clang, -O2):
<LCD_CLS>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <LCD_Command@plt>

LLVM IR (-O0):
%struct.PIN_LCD = type { i32 }
define void @LCD_CLS(%struct.PIN_LCD* %0) {
%2 = alloca %struct.PIN_LCD*
store %struct.PIN_LCD* %0, %struct.PIN_LCD** %2
%3 = load %struct.PIN_LCD*, %struct.PIN_LCD** %2
%4 = call i32 @LCD_Command(i32 1, %struct.PIN_LCD* %3)
ret void
}

LLVM IR (-O2):
%struct.PIN_LCD = type { i32 }
define void @LCD_CLS(%struct.PIN_LCD* %0) {
%2 = tail call i32 @LCD_Command(i32 1, %struct.PIN_LCD* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ test(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main() {
  srand(time(0));
  test("LSLSFSF");
  test("LSLSFF");
  test("LLSFSF");
  test("LLSFF");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
lea    0xeac(%rip),%rdi
call   1050 <test@plt>
lea    0xea8(%rip),%rdi
call   1050 <test@plt>
lea    0xea3(%rip),%rdi
call   1050 <test@plt>
lea    0xe9e(%rip),%rdi
call   1050 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
lea    0xeba(%rip),%rdi
call   1050 <test@plt>
lea    0xeb6(%rip),%rdi
call   1050 <test@plt>
lea    0xeb1(%rip),%rdi
call   1050 <test@plt>
lea    0xeac(%rip),%rdi
call   1050 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"LSLSFSF\00"
@.str.1 = [7 x i8] c"LSLSFF\00"
@.str.2 = [7 x i8] c"LLSFSF\00"
@.str.3 = [6 x i8] c"LLSFF\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32 0)
%3 = call i32 @srand(i32 %2)
%4 = call i32 @test(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"LSLSFSF\00"
@.str.1 = [7 x i8] c"LSLSFF\00"
@.str.2 = [7 x i8] c"LLSFSF\00"
@.str.3 = [6 x i8] c"LLSFF\00"
define i32 @main() {
%1 = tail call i32 @time(i32 0)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 @test(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @test(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *sqlite3_mprintf(char *, char const *);
char *jsonPathSyntaxError(const char *zErr) {
  return sqlite3_mprintf("JSON path error near '%q'", zErr);
}


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

x86 assembly (clang, -O2):
<jsonPathSyntaxError>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <sqlite3_mprintf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"JSON path error near '%q'\00"
define i8* @jsonPathSyntaxError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @sqlite3_mprintf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [26 x i8] c"JSON path error near '%q'\00"
define i8* @jsonPathSyntaxError(i8* %0) {
%2 = tail call i8* @sqlite3_mprintf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
int f();
int main(void) {
  int a;
  return f();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 %1
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, int *, unsigned long *,
                       unsigned long, void *, unsigned long);
int shim_get_mempolicy(int *mode, unsigned long *nodemask,
                       unsigned long maxnode, void *addr, unsigned long flags) {
  return (int)shim_enosys(0, mode, nodemask, maxnode, addr, flags);
}


x86 assembly (clang, -O0):
<shim_get_mempolicy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_get_mempolicy>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_get_mempolicy(i32* %0, i64* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i64 @shim_enosys(i32 0, i32* %0, i64* %1, i64 %2, i8* %3, i64 %4)
%7 = trunc i64 %6 to i32
ret i32 %7
}