xunge/DecIR huggingface dataset:
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *getHead(struct node *);
struct node *goRight(struct node *, int);
struct node *moveCursorToIndex(struct node *currNode, int n) {
  struct node *temp = getHead(currNode);
  if (n > 0) {
    return goRight(temp, n);
  }
  return temp;
}


x86 assembly (clang, -O0):
<moveCursorToIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <getHead@plt>
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    115b <moveCursorToIndex+0x3b>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <goRight@plt>
mov    %rax,-0x8(%rbp)
jmp    1163 <moveCursorToIndex+0x43>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveCursorToIndex>:
push   %rbx
mov    %esi,%ebx
call   1040 <getHead@plt>
test   %ebx,%ebx
jle    1137 <moveCursorToIndex+0x17>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <goRight@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define %struct.node* @moveCursorToIndex(%struct.node* %0, i32 %1) {
%3 = alloca %struct.node*
%4 = alloca %struct.node*
%5 = alloca i32
%6 = alloca %struct.node*
store %struct.node* %0, %struct.node** %4
store i32 %1, i32* %5
%7 = load %struct.node*, %struct.node** %4
%8 = call %struct.node* @getHead(%struct.node* %7)
store %struct.node* %8, %struct.node** %6
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load %struct.node*, %struct.node** %6
%13 = load i32, i32* %5
%14 = call %struct.node* @goRight(%struct.node* %12, i32 %13)
store %struct.node* %14, %struct.node** %3
br label %17
15: ; preds = %2
%16 = load %struct.node*, %struct.node** %6
store %struct.node* %16, %struct.node** %3
br label %17
17: ; preds = %15, %11
%18 = load %struct.node*, %struct.node** %3
ret %struct.node* %18
}

LLVM IR (-O2):
%struct.node = type { i32 }
define %struct.node* @moveCursorToIndex(%struct.node* %0, i32 %1) {
%3 = tail call %struct.node* @getHead(%struct.node* %0)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call %struct.node* @goRight(%struct.node* %3, i32 %1)
br label %7
7: ; preds = %2, %5
%8 = phi %struct.node* [ %6, %5 ], [ %3, %2 ]
ret %struct.node* %8
}
void test_three(int x, int y) {
#pragma omp simd collapse(1)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_three>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_three+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_three+0x43>
jmp    1135 <test_three+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_three+0x24>
jmp    1148 <test_three+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_three+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_three(i32 %0, i32 %1) {
ret void
}
void conf_load_defaults(int tr) { return; }


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

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

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

LLVM IR (-O2):
define void @conf_load_defaults(i32 %0) {
ret void
}
float convert_rad_to_deg(float th_rad) {
  float rad_to_deg = 180.0 / 3.141592653;
  return th_rad * rad_to_deg;
}


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

x86 assembly (clang, -O2):
<convert_rad_to_deg>:
mulss  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define float @convert_rad_to_deg(float %0) {
%2 = fmul float %0, 0x404CA5DC20000000
ret float %2
}
/* Variables and functions */
scalar_t__ __builtin_y0(double);
int /*<<< orphan*/ link_failure_builtin_y0();
void test_builtin_y0(double d) {
  if (__builtin_y0(d) != __builtin_y0(d))
    link_failure_builtin_y0();
}


x86 assembly (clang, -O0):
<test_builtin_y0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_y0@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__builtin_y0@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_y0+0x3c>
mov    $0x0,%al
call   1040 <link_failure_builtin_y0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_y0>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <__builtin_y0@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <__builtin_y0@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_y0+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_y0@plt>

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

LLVM IR (-O2):
define void @test_builtin_y0(double %0) {
%2 = tail call i64 @__builtin_y0(double %0)
%3 = tail call i64 @__builtin_y0(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_y0()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ shell_main(int /*<<< orphan*/, void *);
int /*<<< orphan*/ startupTests();
void _start() {
  startupTests();
  shell_main(0, ((void *)0));
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <startupTests@plt>
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <shell_main@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rax
xor    %eax,%eax
call   1040 <startupTests@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <shell_main@plt>

LLVM IR (-O0):
define void @_start() {
%1 = call i32 (...) @startupTests()
%2 = call i32 @shell_main(i32 0, i8* null)
ret void
}

LLVM IR (-O2):
define void @_start() {
%1 = tail call i32 (...) @startupTests()
%2 = tail call i32 @shell_main(i32 0, i8* null)
ret void
}
/* Variables and functions */
int ypit_sod(int);
int ypit_milliday(int soy) {
  unsigned n = ypit_sod(soy) * 5;
  n >>= 4;
  n = (n + (n * 24273 >> 17)) >> 5;
  return n;
}


x86 assembly (clang, -O0):
<ypit_milliday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ypit_sod@plt>
imul   $0x5,%eax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   $0x5ed1,-0x8(%rbp),%ecx
shr    $0x11,%ecx
add    %ecx,%eax
shr    $0x5,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ypit_milliday>:
push   %rax
call   1030 <ypit_sod@plt>
lea    (%rax,%rax,4),%ecx
shr    $0x4,%ecx
imul   $0x5ed1,%ecx,%eax
shr    $0x11,%eax
add    %ecx,%eax
shr    $0x5,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ypit_milliday(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @ypit_sod(i32 %4)
%6 = mul nsw i32 %5, 5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = lshr i32 %7, 4
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = mul i32 %10, 24273
%12 = lshr i32 %11, 17
%13 = add i32 %9, %12
%14 = lshr i32 %13, 5
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @ypit_milliday(i32 %0) {
%2 = tail call i32 @ypit_sod(i32 %0)
%3 = mul nsw i32 %2, 5
%4 = lshr i32 %3, 4
%5 = mul i32 %4, 24273
%6 = lshr i32 %5, 17
%7 = add nuw nsw i32 %6, %4
%8 = lshr i32 %7, 5
ret i32 %8
}
int bit_test(int *tbl, int l, unsigned int bit) {
  int b;
  b = bit % 32;
  bit = bit / 32;
  return !!(tbl[bit % l] & (1 << b));
}


x86 assembly (clang, -O0):
<bit_test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    -0x20(%rbp),%rax
mov    %edx,%ecx
mov    (%rax,%rcx,4),%eax
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_test>:
mov    %edx,%ecx
mov    %edx,%eax
shr    $0x5,%eax
xor    %edx,%edx
div    %esi
mov    (%rdi,%rdx,4),%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bit_test(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = urem i32 %8, 32
store i32 %9, i32* %7
%10 = load i32, i32* %6
%11 = udiv i32 %10, 32
store i32 %11, i32* %6
%12 = load i32*, i32** %4
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = urem i32 %13, %14
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %12, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %7
%20 = shl i32 1, %19
%21 = and i32 %18, %20
%22 = icmp ne i32 %21, 0
%23 = xor i1 %22, true
%24 = xor i1 %23, true
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @bit_test(i32* nocapture %0, i32 %1, i32 %2) {
%4 = and i32 %2, 31
%5 = lshr i32 %2, 5
%6 = urem i32 %5, %1
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = lshr i32 %9, %4
%11 = and i32 %10, 1
ret i32 %11
}
int fahrenheit_to_celsius(int fahrenheit) {
  return (5 * (fahrenheit - 32) / 9);
}


x86 assembly (clang, -O0):
<fahrenheit_to_celsius>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
imul   $0x5,%eax,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahrenheit_to_celsius>:
lea    (%rdi,%rdi,4),%eax
add    $0xffffff60,%eax
cltq
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fahrenheit_to_celsius(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 32
%5 = mul nsw i32 5, %4
%6 = sdiv i32 %5, 9
ret i32 %6
}

LLVM IR (-O2):
define i32 @fahrenheit_to_celsius(i32 %0) {
%2 = mul i32 %0, 5
%3 = add i32 %2, -160
%4 = sdiv i32 %3, 9
ret i32 %4
}
void foo28() {}


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

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

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

LLVM IR (-O2):
define void @foo28() {
ret void
}
int test_imm_1Cuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x1C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Cuint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 28
%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_1Cuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 28
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_ldbio(unsigned char *);
void test_ldbio(unsigned char *p1, unsigned char *p2) {
  __builtin_ldbio(p1);
  __builtin_ldbio(p2);
  __builtin_ldbio(p2 + 1);
  __builtin_ldbio(p2 + 2);
  __builtin_ldbio(p2 + 2047);
  __builtin_ldbio(p2 + 2048);
}


x86 assembly (clang, -O0):
<test_ldbio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__builtin_ldbio@plt>
mov    -0x10(%rbp),%rdi
call   1030 <__builtin_ldbio@plt>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <__builtin_ldbio@plt>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
call   1030 <__builtin_ldbio@plt>
mov    -0x10(%rbp),%rdi
add    $0x7ff,%rdi
call   1030 <__builtin_ldbio@plt>
mov    -0x10(%rbp),%rdi
add    $0x800,%rdi
call   1030 <__builtin_ldbio@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ldbio>:
push   %rbx
mov    %rsi,%rbx
call   1030 <__builtin_ldbio@plt>
mov    %rbx,%rdi
call   1030 <__builtin_ldbio@plt>
lea    0x1(%rbx),%rdi
call   1030 <__builtin_ldbio@plt>
lea    0x2(%rbx),%rdi
call   1030 <__builtin_ldbio@plt>
lea    0x7ff(%rbx),%rdi
call   1030 <__builtin_ldbio@plt>
add    $0x800,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__builtin_ldbio@plt>

LLVM IR (-O0):
define void @test_ldbio(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @__builtin_ldbio(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @__builtin_ldbio(i8* %7)
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = call i32 @__builtin_ldbio(i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 2
%14 = call i32 @__builtin_ldbio(i8* %13)
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 2047
%17 = call i32 @__builtin_ldbio(i8* %16)
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2048
%20 = call i32 @__builtin_ldbio(i8* %19)
ret void
}

LLVM IR (-O2):
define void @test_ldbio(i8* %0, i8* %1) {
%3 = tail call i32 @__builtin_ldbio(i8* %0)
%4 = tail call i32 @__builtin_ldbio(i8* %1)
%5 = getelementptr inbounds i8, i8* %1, i64 1
%6 = tail call i32 @__builtin_ldbio(i8* %5)
%7 = getelementptr inbounds i8, i8* %1, i64 2
%8 = tail call i32 @__builtin_ldbio(i8* %7)
%9 = getelementptr inbounds i8, i8* %1, i64 2047
%10 = tail call i32 @__builtin_ldbio(i8* %9)
%11 = getelementptr inbounds i8, i8* %1, i64 2048
%12 = tail call i32 @__builtin_ldbio(i8* %11)
ret void
}
int test_imm_85uint16_reg(unsigned short val) {
  return ((val) & (-0x85 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_85uint16_reg>:
test   $0xff7b,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_85uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -133
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, char const *, char *, size_t);
ssize_t readlinkat(int fd, const char *restrict path, char *restrict buf,
                   size_t bufsize) {
  return syscall(332, fd, path, buf, bufsize);
}


x86 assembly (clang, -O0):
<readlinkat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x14c,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlinkat>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x14c,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @readlinkat(i32 %0, i8* noalias %1, i8* noalias %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i32 @syscall(i32 332, i32 %9, i8* %10, i8* %11, i64 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @readlinkat(i32 %0, i8* noalias %1, i8* noalias %2, i64 %3) {
%5 = tail call i32 @syscall(i32 332, i32 %0, i8* %1, i8* %2, i64 %3)
ret i32 %5
}
/* Variables and functions */
void *realloc(void *, size_t);
void *realloc_adapted(void *ptr, size_t size,
                      void *UNUSED_data __attribute__((unused))) {
  return realloc(ptr, size);
}


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

x86 assembly (clang, -O2):
<realloc_adapted>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @realloc_adapted(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @realloc_adapted(i8* nocapture %0, i64 %1, i8* nocapture readnone %2) {
%4 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ stabs_function();
int main(void) {
  stabs_function();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @stabs_function()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
scalar_t__ setns(int, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void join_namespace_or_die(const char *name, int ns_fd) {
  if (setns(ns_fd, 0) < 0) {
    fprintf(stderr, "cannot set %s namespace\n", name);
    _exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<join_namespace_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
xor    %esi,%esi
call   1040 <setns@plt>
cmp    $0x0,%rax
jge    117a <join_namespace_or_die+0x4a>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe99(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join_namespace_or_die>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
xor    %esi,%esi
call   1040 <setns@plt>
test   %rax,%rax
js     1144 <join_namespace_or_die+0x14>
pop    %rbx
ret
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"cannot set %s namespace\0A\00"
@EXIT_FAILURE = global i32 0
define void @join_namespace_or_die(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 = call i64 @setns(i32 %5, i32 0)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %3
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @_exit(i32 %12)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"cannot set %s namespace\0A\00"
@EXIT_FAILURE = global i32 0
define void @join_namespace_or_die(i8* %0, i32 %1) {
%3 = tail call i64 @setns(i32 %1, i32 0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @_exit(i32 %8)
unreachable
10: ; preds = %2
ret void
}
/* Type definitions */
struct cli_def {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cli_print(struct cli_def *, char *, char const *);
int hook_disable(struct cli_def *cli, const char *command, char *argv[],
                 int argc) {
  cli_print(cli, "Hook (disable): %s", command);
  return 0;
}


x86 assembly (clang, -O0):
<hook_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeca(%rip),%rsi
call   1030 <cli_print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cli_def = type { i32 }
@.str = [19 x i8] c"Hook (disable): %s\00"
define i32 @hook_disable(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3) {
%5 = alloca %struct.cli_def*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
store %struct.cli_def* %0, %struct.cli_def** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load %struct.cli_def*, %struct.cli_def** %5
%10 = load i8*, i8** %6
%11 = call i32 @cli_print(%struct.cli_def* %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.cli_def = type { i32 }
@.str = [19 x i8] c"Hook (disable): %s\00"
define i32 @hook_disable(%struct.cli_def* %0, i8* %1, i8** nocapture readnone %2, i32 %3) {
%5 = tail call i32 @cli_print(%struct.cli_def* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
int pr_debug(char const *fmt, ...) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @pr_debug(i8* nocapture readnone %0, ...) {
ret i32 0
}
void quick_sort(a, p, r) double a[];
unsigned long p, r;
{
  unsigned long q;
  if (p < r) {
    q = partition(a, p, r);
    quick_sort(a, p, q);
    quick_sort(a, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1181 <quick_sort+0x61>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <partition@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
mov    -0x18(%rbp),%rdx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    %rdx,%rsi
jae    116d <quick_sort+0x4d>
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <partition@plt>
movslq %eax,%rbx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <quick_sort@plt>
add    $0x1,%rbx
mov    %rbx,%r12
cmp    %r14,%rbx
jb     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @quick_sort(double* %0, i64 %1, i64 %2) {
%4 = icmp ult i64 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i64 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 (double*, i64, i64, ...) bitcast (i32 (...)* @partition to i32 (double*, i64, i64, ...)*)(double* %0, i64 %6, i64 %2)
%8 = sext i32 %7 to i64
tail call void @quick_sort(double* %0, i64 %6, i64 %8)
%9 = add nsw i64 %8, 1
%10 = icmp ult i64 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int ax_web_socket_set_nonblock(int socket_fd) {
  int oldflags = fcntl(socket_fd, F_GETFL, 0);
  if (fcntl(socket_fd, F_SETFL, oldflags | O_NONBLOCK) != -1) {
    return 0;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<ax_web_socket_set_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    0x2ea1(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     1163 <ax_web_socket_set_nonblock+0x53>
movl   $0x0,-0x4(%rbp)
jmp    116a <ax_web_socket_set_nonblock+0x5a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ax_web_socket_set_nonblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb5(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
call   1030 <fcntl@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @ax_web_socket_set_nonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFL
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* @F_SETFL
%10 = load i32, i32* %4
%11 = load i32, i32* @O_NONBLOCK
%12 = or i32 %10, %11
%13 = call i32 @fcntl(i32 %8, i32 %9, i32 %12)
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %1
store i32 0, i32* %2
br label %17
16: ; preds = %1
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @ax_web_socket_set_nonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %3
%7 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %6)
%8 = icmp eq i32 %7, -1
%9 = sext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ft_putnbr_unsgned(unsigned int);
int ft_printf_u(unsigned int nbr) {
  int ret;
  unsigned int copy;
  copy = nbr;
  ret = 0;
  if (nbr == 0)
    ret++;
  while (nbr >= 1) {
    nbr = nbr / 10;
    ret++;
  }
  ft_putnbr_unsgned(copy);
  return (ret);
}


x86 assembly (clang, -O0):
<ft_printf_u>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113b <ft_printf_u+0x2b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <ft_printf_u+0x30>
cmpl   $0x1,-0x4(%rbp)
jb     1167 <ft_printf_u+0x57>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <ft_printf_u+0x30>
mov    -0xc(%rbp),%edi
call   1030 <ft_putnbr_unsgned@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_printf_u>:
push   %rbx
test   %edi,%edi
je     1136 <ft_printf_u+0x26>
xor    %ebx,%ebx
mov    $0xcccccccd,%eax
mov    %edi,%ecx
xchg   %ax,%ax
mov    %ecx,%edx
imul   %rax,%rdx
shr    $0x23,%rdx
add    $0x1,%ebx
cmp    $0x9,%ecx
mov    %edx,%ecx
ja     1120 <ft_printf_u+0x10>
jmp    113b <ft_printf_u+0x2b>
mov    $0x1,%ebx
call   1030 <ft_putnbr_unsgned@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_printf_u(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = udiv i32 %4, 10
%7 = add nuw nsw i32 %5, 1
%8 = icmp ult i32 %4, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
%11 = tail call i32 @ft_putnbr_unsgned(i32 %0)
ret i32 %10
}
/* Variables and functions */
long double __qcos(long double);
long double intr_wrap_028(long double p1) { return __qcos(p1); }


x86 assembly (clang, -O0):
<intr_wrap_028>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qcos@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_028>:
jmp    1030 <__qcos@plt>

LLVM IR (-O0):
define x86_fp80 @intr_wrap_028(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @__qcos(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @intr_wrap_028(x86_fp80 %0) {
%2 = tail call x86_fp80 @__qcos(x86_fp80 %0)
ret x86_fp80 %2
}
unsigned short inw(unsigned short port) {
  unsigned short v;
  asm volatile("inw %1, %0" : "=a"(v) : "d"(port));
  return v;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define zeroext i16 @inw(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm sideeffect "inw $1, $0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @inw(i16 zeroext %0) {
%2 = tail call i16 asm sideeffect "inw $1, $0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
void sigtermHandler(int sig) {}


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

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

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

LLVM IR (-O2):
define void @sigtermHandler(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_put1_8(int, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ const *, int);
void MC_put_o_8_3dnow(uint8_t *dest, const uint8_t *ref, int stride,
                      int height) {
  MC_put1_8(height, dest, ref, stride);
}


x86 assembly (clang, -O0):
<MC_put_o_8_3dnow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <MC_put1_8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_put_o_8_3dnow>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %eax,%ecx
jmp    1030 <MC_put1_8@plt>

LLVM IR (-O0):
define void @MC_put_o_8_3dnow(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = call i32 @MC_put1_8(i32 %9, i32* %10, i32* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @MC_put_o_8_3dnow(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_put1_8(i32 %3, i32* %0, i32* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_putstr(char *str) {
  int it;
  it = 0;
  while (str[it] != 0)
    ft_putchar(str[it++]);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <ft_putstr+0x48>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ft_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @ft_putchar(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ enc32le(unsigned char *, int /*<<< orphan*/);
void enc64le(void *dst, uint64_t x) {
  unsigned char *buf;
  buf = dst;
  enc32le(buf, (uint32_t)x);
  enc32le(buf + 4, (uint32_t)(x >> 32));
}


x86 assembly (clang, -O0):
<enc64le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <enc32le@plt>
mov    -0x18(%rbp),%rdi
add    $0x4,%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
call   1030 <enc32le@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enc64le>:
push   %rbx
mov    %rdi,%rbx
call   1030 <enc32le@plt>
add    $0x4,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <enc32le@plt>

LLVM IR (-O0):
define void @enc64le(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i32, i32* %4
%9 = call i32 @enc32le(i8* %7, i32 %8)
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 4
%12 = load i32, i32* %4
%13 = ashr i32 %12, 32
%14 = call i32 @enc32le(i8* %11, i32 %13)
ret void
}

LLVM IR (-O2):
define void @enc64le(i8* %0, i32 %1) {
%3 = tail call i32 @enc32le(i8* %0, i32 %1)
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = tail call i32 @enc32le(i8* %4, i32 poison)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *);
int /*<<< orphan*/ kill_this_task();
int /*<<< orphan*/ set_dink_speed(int);
int /*<<< orphan*/ sp_frame_delay(int, int /*<<< orphan*/);
void disarm(void) {
  set_dink_speed(3);
  sp_frame_delay(1, 0);
  debug("Disarming boots");
  kill_this_task();
}


x86 assembly (clang, -O0):
<disarm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1060 <set_dink_speed@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <sp_frame_delay@plt>
lea    0xe9f(%rip),%rdi
call   1040 <debug@plt>
mov    $0x0,%al
call   1030 <kill_this_task@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<disarm>:
push   %rax
mov    $0x3,%edi
call   1060 <set_dink_speed@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <sp_frame_delay@plt>
lea    0xea2(%rip),%rdi
call   1040 <debug@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <kill_this_task@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Disarming boots\00"
define void @disarm() {
%1 = call i32 @set_dink_speed(i32 3)
%2 = call i32 @sp_frame_delay(i32 1, i32 0)
%3 = call i32 @debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @kill_this_task()
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Disarming boots\00"
define void @disarm() {
%1 = tail call i32 @set_dink_speed(i32 3)
%2 = tail call i32 @sp_frame_delay(i32 1, i32 0)
%3 = tail call i32 @debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @kill_this_task()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ humdev(float const, float const, float, float, float, float);
float humdev_dkdy(const float x, const float y) {
  float k, l, dkdx, dkdy;
  humdev(x, y, k, l, dkdx, dkdy);
  return dkdy;
}


x86 assembly (clang, -O0):
<humdev_dkdy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movss  -0x14(%rbp),%xmm4
movss  -0x18(%rbp),%xmm5
call   1030 <humdev@plt>
movss  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<humdev_dkdy>:
jmp    1030 <humdev@plt>

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

LLVM IR (-O2):
define float @humdev_dkdy(float %0, float %1) {
%3 = tail call i32 @humdev(float %0, float %1, float undef, float undef, float undef, float undef)
ret float undef
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
extern const char *onig_copyright(void) {
  static char s[58];
  sprintf(s, "Oniguruma %d.%d.%d : Copyright (C) 2002-2008 K.Kosako", 5, 9, 6);
  return s;
}


x86 assembly (clang, -O0):
<onig_copyright>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x5,%edx
mov    $0x9,%ecx
mov    $0x6,%r8d
call   1030 <sprintf@plt>
lea    0x2f02(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<onig_copyright>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x5,%edx
mov    $0x9,%ecx
mov    $0x6,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@onig_copyright.s = internal global [58 x i8] zeroinitializer
@.str = [54 x i8] c"Oniguruma %d.%d.%d : Copyright (C) 2002-2008 K.Kosako\00"
define i8* @onig_copyright() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @onig_copyright.s, i64 0, i64 0), i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 5, i32 9, i32 6)
ret i8* getelementptr inbounds ([58 x i8], [58 x i8]* @onig_copyright.s, i64 0, i64 0)
}

LLVM IR (-O2):
@onig_copyright.s = internal global [58 x i8] zeroinitializer
@.str = [54 x i8] c"Oniguruma %d.%d.%d : Copyright (C) 2002-2008 K.Kosako\00"
define i8* @onig_copyright() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @onig_copyright.s, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 5, i32 9, i32 6)
ret i8* getelementptr inbounds ([58 x i8], [58 x i8]* @onig_copyright.s, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ g_writeln(char *);
int out_params(void) {
  g_writeln("");
  g_writeln("xrdp rsa key gen utility examples");
  g_writeln("  xrdp-keygen xrdp ['path and file name' | auto] [512 or 2048]");
  g_writeln("  xrdp-keygen test");
  g_writeln("");
  return 0;
}


x86 assembly (clang, -O0):
<out_params>:
push   %rbp
mov    %rsp,%rbp
lea    0xf45(%rip),%rdi
call   1030 <g_writeln@plt>
lea    0xed9(%rip),%rdi
call   1030 <g_writeln@plt>
lea    0xeef(%rip),%rdi
call   1030 <g_writeln@plt>
lea    0xf22(%rip),%rdi
call   1030 <g_writeln@plt>
lea    0xf15(%rip),%rdi
call   1030 <g_writeln@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_params>:
push   %rbx
lea    0xf48(%rip),%rbx
mov    %rbx,%rdi
call   1030 <g_writeln@plt>
lea    0xed9(%rip),%rdi
call   1030 <g_writeln@plt>
lea    0xeef(%rip),%rdi
call   1030 <g_writeln@plt>
lea    0xf22(%rip),%rdi
call   1030 <g_writeln@plt>
mov    %rbx,%rdi
call   1030 <g_writeln@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [34 x i8] c"xrdp rsa key gen utility examples\00"
@.str.2 = [63 x i8] c" xrdp-keygen xrdp ['path and file name' | auto] [512 or 2048]\00"
@.str.3 = [19 x i8] c" xrdp-keygen test\00"
define i32 @out_params() {
%1 = call i32 @g_writeln(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @g_writeln(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @g_writeln(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @g_writeln(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @g_writeln(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [34 x i8] c"xrdp rsa key gen utility examples\00"
@.str.2 = [63 x i8] c" xrdp-keygen xrdp ['path and file name' | auto] [512 or 2048]\00"
@.str.3 = [19 x i8] c" xrdp-keygen test\00"
define i32 @out_params() {
%1 = tail call i32 @g_writeln(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @g_writeln(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @g_writeln(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @g_writeln(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @g_writeln(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}