xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int i = 1;
  printf("\n%d %d", i ^= 1 % 2, i <<= 1 % 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%esi
xor    $0x1,%esi
mov    %esi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
shl    $0x1,%edx
mov    %edx,-0x4(%rbp)
lea    0xec8(%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
xor    %esi,%esi
xor    %edx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"\0A%d %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int print(const void *datum) {
  printf("%d ", (int)datum);
  return 0;
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @print(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int main() {
  int fd = open("/tmp", O_RDONLY);
  if (fd == -1)
    abort();
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1168 <main+0x38>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1050 <open@plt>
cmp    $0xffffffff,%eax
je     1156 <main+0x26>
mov    %eax,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"/tmp\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @close(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"/tmp\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = tail call i32 @close(i32 %2)
ret i32 0
}
int test_imm_5Aint8_mem(signed char *val) {
  return ((*val) & (-0x5A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Aint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -90
%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_5Aint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -90
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void write_buffer(float insample, float *buffer, unsigned long buflen,
                  unsigned long pos, unsigned long n) {
  while (n + pos >= buflen)
    n -= buflen;
  buffer[n + pos] = insample;
}


x86 assembly (clang, -O0):
<write_buffer>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     113f <write_buffer+0x3f>
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    1119 <write_buffer+0x19>
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
add    -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_buffer>:
add    %rcx,%rdx
add    %rsi,%rdx
cs nopw 0x0(%rax,%rax,1)
sub    %rsi,%rdx
cmp    %rsi,%rdx
jae    1110 <write_buffer+0x10>
movss  %xmm0,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @write_buffer(float %0, float* %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca float
%7 = alloca float*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store float %0, float* %6
store float* %1, float** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
br label %11
11: ; preds = %17, %5
%12 = load i64, i64* %10
%13 = load i64, i64* %9
%14 = add i64 %12, %13
%15 = load i64, i64* %8
%16 = icmp uge i64 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i64, i64* %8
%19 = load i64, i64* %10
%20 = sub i64 %19, %18
store i64 %20, i64* %10
br label %11
21: ; preds = %11
%22 = load float, float* %6
%23 = load float*, float** %7
%24 = load i64, i64* %10
%25 = load i64, i64* %9
%26 = add i64 %24, %25
%27 = getelementptr inbounds float, float* %23, i64 %26
store float %22, float* %27
ret void
}

LLVM IR (-O2):
define void @write_buffer(float %0, float* nocapture writeonly %1, i64 %2, i64 %3, i64 %4) {
br label %6
6: ; preds = %6, %5
%7 = phi i64 [ %4, %5 ], [ %10, %6 ]
%8 = add i64 %7, %3
%9 = icmp ult i64 %8, %2
%10 = sub i64 %7, %2
br i1 %9, label %11, label %6
11: ; preds = %6
%12 = getelementptr inbounds float, float* %1, i64 %8
store float %0, float* %12
ret void
}
void gtk_menu_item_new_with_label() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_item_new_with_label() {
ret void
}
int main() {
  char *t = "title";
  char *s;
  s = t;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int int_converter(char x) {
  int y = 0;
  y = (int)x + 256;
  y = y % 256;
  return y;
}


x86 assembly (clang, -O0):
<int_converter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x100,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_converter>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @int_converter(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 256
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = srem i32 %7, 256
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @int_converter(i8 signext %0) {
%2 = zext i8 %0 to i32
ret i32 %2
}
struct device_node *of_get_root_node(void) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.device_node = type opaque
define %struct.device_node* @of_get_root_node() {
ret %struct.device_node* null
}

LLVM IR (-O2):
%struct.device_node = type opaque
define noalias %struct.device_node* @of_get_root_node() {
ret %struct.device_node* null
}
unsigned xrop3_85_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = ~D;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_85_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_85_1_1>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %edi,%esi
not    %edi
shl    $0x8,%edi
not    %eax
and    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_85_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %7
%21 = load i32, i32* %5
%22 = xor i32 %21, -1
store i32 %22, i32* %8
%23 = load i32, i32* %8
%24 = load i32, i32* %6
%25 = xor i32 %24, -1
%26 = and i32 %23, %25
%27 = load i32, i32* %7
%28 = xor i32 %27, -1
%29 = and i32 %26, %28
%30 = load i32, i32* %5
%31 = load i32, i32* %6
%32 = and i32 %30, %31
%33 = or i32 %29, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %7
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_85_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = xor i32 %3, -1
%7 = shl nsw i32 %6, 8
%8 = xor i32 %5, -1
%9 = and i32 %7, %8
%10 = or i8 %1, %0
%11 = zext i8 %10 to i32
%12 = or i32 %9, %11
ret i32 %12
}
int pci_disable_pcie_error_reporting(struct pci_dev *pdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_disable_pcie_error_reporting(%struct.pci_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
long double tan(long double);
long double fun_tan(long double a) { return tan(a); }


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

x86 assembly (clang, -O2):
<fun_tan>:
jmp    1030 <tan@plt>

LLVM IR (-O0):
define x86_fp80 @fun_tan(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 @tan(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @fun_tan(x86_fp80 %0) {
%2 = tail call x86_fp80 @tan(x86_fp80 %0)
ret x86_fp80 %2
}
void gtk_spin_button_get_increments() {}


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

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

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

LLVM IR (-O2):
define void @gtk_spin_button_get_increments() {
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
__attribute__((always_)) int32_t clamp(int32_t value, int32_t min,
                                       int32_t max) {
  if (value < min)
    return min;
  else if (value > max)
    return max;
  else
    return value;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    112b <clamp+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <clamp+0x4e>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1146 <clamp+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <clamp+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @clamp(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
void sendString(unsigned char *s, unsigned int dest) {}


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

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

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

LLVM IR (-O2):
define void @sendString(i8* nocapture %0, i32 %1) {
ret void
}
__attribute__((weak)) int _read(int file, char *ptr, int len) {
  file = file;
  len = len;
  return 0;
}


x86 assembly (clang, -O0):
<_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define weak i32 @_read(i32 %0, i8* %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
unsigned int strlen(char *);
unsigned int strings_length(char *string) {
  assert(string);
  return strlen(string);
}


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

x86 assembly (clang, -O2):
<strings_length>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @strings_length(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @strings_length(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32 @strlen(i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ I2C1_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void I2C1_IRQHandler(void) {
  I2C1_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @I2C1_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @I2C1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @I2C1_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @I2C1_DriverIRQHandler()
ret void
}
int execute_timerfd_gettime() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_timerfd_gettime() {
ret i32 0
}
/* Variables and functions */
int beep();
int nc_beep(void) { return beep(); }


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

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

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

LLVM IR (-O2):
define i32 @nc_beep() {
%1 = tail call i32 (...) @beep()
ret i32 %1
}
void troca(float *a, float *b) {
  int c;
  c = *a;
  *a = *b;
  *b = c;
}


x86 assembly (clang, -O0):
<troca>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvttss2si (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
cvtsi2ssl -0x14(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<troca>:
movss  (%rsi),%xmm0
movss  (%rdi),%xmm1
movss  %xmm0,(%rdi)
cvttps2dq %xmm1,%xmm0
cvtdq2ps %xmm0,%xmm0
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @troca(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i32
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = load float, float* %6
%8 = fptosi float %7 to i32
store i32 %8, i32* %5
%9 = load float*, float** %4
%10 = load float, float* %9
%11 = load float*, float** %3
store float %10, float* %11
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to float
%14 = load float*, float** %4
store float %13, float* %14
ret void
}

LLVM IR (-O2):
define void @troca(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = fptosi float %3 to i32
%5 = load float, float* %1
store float %5, float* %0
%6 = sitofp i32 %4 to float
store float %6, float* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printbin(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 0; i < 30; i++) {
    printf("%d: ", i);
    printbin(i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1e,-0x8(%rbp)
jge    1165 <main+0x45>
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <printbin@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <printbin@plt>
add    $0x1,%ebx
cmp    $0x1e,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 30
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @printbin(i32 %9)
br label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d: \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @printbin(i32 %2)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 30
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int descent;
};
typedef TYPE_1__ XFontStruct;

/* Variables and functions */
void set_XFontStruct_descent(void *_p, int _v) {
  ((XFontStruct *)_p)->descent = (int)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XFontStruct_descent(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void SV_SendServerInfoChange(char *key, char *value) {}


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

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

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

LLVM IR (-O2):
define void @SV_SendServerInfoChange(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int read_litteral(char *);
int parse_and_operator() { return read_litteral("&&"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"&&\00"
define i32 @parse_and_operator() {
%1 = tail call i32 @read_litteral(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
unsigned bound_unsigned(unsigned min, unsigned value, unsigned max) {
  if (value > max) {
    value = max;
  } else if (value < min) {
    value = min;
  }
  return value;
}


x86 assembly (clang, -O0):
<bound_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jbe    1124 <bound_unsigned+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113b <bound_unsigned+0x3b>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1136 <bound_unsigned+0x36>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113b <bound_unsigned+0x3b>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bound_unsigned>:
mov    %edi,%eax
cmp    %edi,%esi
cmovae %esi,%eax
cmp    %edx,%esi
cmova  %edx,%eax
ret

LLVM IR (-O0):
define i32 @bound_unsigned(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = icmp ugt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %6
store i32 %11, i32* %5
br label %19
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = icmp ult i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %4
store i32 %17, i32* %5
br label %18
18: ; preds = %16, %12
br label %19
19: ; preds = %18, %10
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @bound_unsigned(i32 %0, i32 %1, i32 %2) {
%4 = icmp ugt i32 %1, %2
%5 = icmp ult i32 %1, %0
%6 = select i1 %5, i32 %0, i32 %1
%7 = select i1 %4, i32 %2, i32 %6
ret i32 %7
}
int mystery(int a, int b) {
  if (b < 0) {
    b = -b;
    a = -a;
  }
  if (b == 0) {
    return 0;
  }
  if (b == 1) {
    return a;
  } else {
    return a + mystery(a, b - 1);
  }
}


x86 assembly (clang, -O0):
<mystery>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1138 <mystery+0x28>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    114e <mystery+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1181 <mystery+0x71>
cmpl   $0x1,-0xc(%rbp)
jne    1163 <mystery+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1181 <mystery+0x71>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <mystery@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystery>:
mov    %edi,%eax
xor    %ecx,%ecx
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%edi
neg    %eax
test   %esi,%esi
cmovns %edi,%eax
neg    %edx
cmovs  %esi,%edx
test   %edx,%edx
je     1130 <mystery+0x30>
cmp    $0x1,%edx
je     1132 <mystery+0x32>
add    $0xffffffff,%edx
add    %eax,%ecx
mov    %edx,%esi
jmp    1110 <mystery+0x10>
mov    %edx,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mystery(i32 %0, i32 %1) {
br label %3
3: ; preds = %12, %2
%4 = phi i32 [ 0, %2 ], [ %14, %12 ]
%5 = phi i32 [ %0, %2 ], [ %10, %12 ]
%6 = phi i32 [ %1, %2 ], [ %13, %12 ]
%7 = icmp slt i32 %6, 0
%8 = sub nsw i32 0, %6
%9 = sub nsw i32 0, %5
%10 = select i1 %7, i32 %9, i32 %5
%11 = select i1 %7, i32 %8, i32 %6
switch i32 %11, label %12 [
i32 0, label %15
i32 1, label %16
]
12: ; preds = %3
%13 = add nsw i32 %11, -1
%14 = add nsw i32 %10, %4
br label %3
15: ; preds = %3
br label %16
16: ; preds = %3, %15
%17 = phi i32 [ %11, %15 ], [ %10, %3 ]
%18 = add nsw i32 %17, %4
ret i32 %18
}
int test_udf_ver() { return 8; }


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

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

LLVM IR (-O0):
define i32 @test_udf_ver() {
ret i32 8
}

LLVM IR (-O2):
define i32 @test_udf_ver() {
ret i32 8
}
void foo(void) {
#pragma acc kernels
  ;
}


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_put_cvolume() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_put_cvolume"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"NOT IMPLEMENTED:pa_tagstruct_put_cvolume\0A\00"
define i32 @pa_tagstruct_put_cvolume() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_tagstruct_put_cvolume\00"
define i32 @pa_tagstruct_put_cvolume() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
float calcforce(float m, float a) {
  float ret;
  ret = m * a;
  return ret;
}


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

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

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

LLVM IR (-O2):
define float @calcforce(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *create_thread_from_thread() {
  printf("Wątek z wątku\n");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"W\C4\85tek z w\C4\85tku\0A\00"
define i8* @create_thread_from_thread() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [16 x i8] c"W\C4\85tek z w\C4\85tku\00"
define noalias i8* @create_thread_from_thread() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i8* null
}
double dblmin(double a, double b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<dblmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <dblmin+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <dblmin+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblmin>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dblmin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @dblmin(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ catString(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void catNameValueString(char *name, char *value) {
  char buf[160 + 2];
  sprintf(buf, "\"%s\":\"%s\"", name, value);
  catString(buf);
}


x86 assembly (clang, -O0):
<catNameValueString>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xc0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xc0(%rbp),%rdi
call   1030 <catString@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catNameValueString>:
push   %rbx
sub    $0xb0,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xecb(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <catString@plt>
add    $0xb0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\22%s\22:\22%s\22\00"
define void @catNameValueString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [162 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [162 x i8], [162 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = getelementptr inbounds [162 x i8], [162 x i8]* %5, i64 0, i64 0
%11 = call i32 @catString(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\22%s\22:\22%s\22\00"
define void @catNameValueString(i8* %0, i8* %1) {
%3 = alloca [162 x i8]
%4 = getelementptr inbounds [162 x i8], [162 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i32 @catString(i8* %4)
ret void
}
void swap_mem(void *one, void *two) {
  void *temp = one;
  one = two;
  two = temp;
}


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

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

LLVM IR (-O0):
define void @swap_mem(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i8*, i8** %4
store i8* %7, i8** %3
%8 = load i8*, i8** %5
store i8* %8, i8** %4
ret void
}

LLVM IR (-O2):
define void @swap_mem(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void cdiDecodeDate(int date, int *year, int *month, int *day) {
  int idate;
  *year = date / 10000;
  idate = date - *year * 10000;
  if (idate < 0)
    idate = -idate;
  *month = idate / 100;
  *day = idate - *month * 100;
}


x86 assembly (clang, -O0):
<cdiDecodeDate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
imul   $0x2710,(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    114a <cdiDecodeDate+0x4a>
xor    %eax,%eax
sub    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
imul   $0x64,(%rax),%eax
sub    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdiDecodeDate>:
movslq %edi,%rax
imul   $0x68db8bad,%rax,%rdi
mov    %rdi,%r8
shr    $0x3f,%r8
sar    $0x2c,%rdi
add    %r8d,%edi
mov    %edi,(%rsi)
imul   $0xffffd8f0,%edi,%esi
add    %esi,%eax
mov    %eax,%esi
neg    %esi
cmovs  %eax,%esi
imul   $0x51eb851f,%rsi,%rax
shr    $0x25,%rax
mov    %eax,(%rdx)
imul   $0xffffff9c,%eax,%eax
add    %esi,%eax
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @cdiDecodeDate(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32, i32* %5
%11 = sdiv i32 %10, 10000
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = mul nsw i32 %15, 10000
%17 = sub nsw i32 %13, %16
store i32 %17, i32* %9
%18 = load i32, i32* %9
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %4
%21 = load i32, i32* %9
%22 = sub nsw i32 0, %21
store i32 %22, i32* %9
br label %23
23: ; preds = %20, %4
%24 = load i32, i32* %9
%25 = sdiv i32 %24, 100
%26 = load i32*, i32** %7
store i32 %25, i32* %26
%27 = load i32, i32* %9
%28 = load i32*, i32** %7
%29 = load i32, i32* %28
%30 = mul nsw i32 %29, 100
%31 = sub nsw i32 %27, %30
%32 = load i32*, i32** %8
store i32 %31, i32* %32
ret void
}

LLVM IR (-O2):
define void @cdiDecodeDate(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = sdiv i32 %0, 10000
store i32 %5, i32* %1
%6 = mul nsw i32 %5, -10000
%7 = add i32 %6, %0
%8 = tail call i32 @llvm.abs.i32(i32 %7, i1 true)
%9 = udiv i32 %8, 100
store i32 %9, i32* %2
%10 = mul nsw i32 %9, -100
%11 = add nsw i32 %10, %8
store i32 %11, i32* %3
ret void
}
int test_imm_84uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x84 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_84uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 132
%7 = icmp ne i64 %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_84uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 8650752
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int howmany(int, int);
int sys_param_howmany(int x, int y) { return howmany(x, y); }


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

x86 assembly (clang, -O2):
<sys_param_howmany>:
jmp    1030 <howmany@plt>

LLVM IR (-O0):
define i32 @sys_param_howmany(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 @howmany(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sys_param_howmany(i32 %0, i32 %1) {
%3 = tail call i32 @howmany(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ appaserver_error_output_starting_argv_stderr(int, char **);
void appaserver_error_usage_stderr(int argc, char **argv) {
  appaserver_error_output_starting_argv_stderr(argc, argv);
}


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

x86 assembly (clang, -O2):
<appaserver_error_usage_stderr>:
jmp    1030 <appaserver_error_output_starting_argv_stderr@plt>

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

LLVM IR (-O2):
define void @appaserver_error_usage_stderr(i32 %0, i8** %1) {
%3 = tail call i32 @appaserver_error_output_starting_argv_stderr(i32 %0, i8** %1)
ret void
}
char *ListStr(char *l, char *s) {
  while (*s)
    *l++ = *s++;
  return l;
}


x86 assembly (clang, -O0):
<ListStr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <ListStr+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <ListStr+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ListStr>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <ListStr+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <ListStr+0x10>
ret

LLVM IR (-O0):
define i8* @ListStr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %9, %2
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
%12 = load i8, i8* %10
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
store i8 %12, i8* %13
br label %5
15: ; preds = %5
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @ListStr(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void aes_decrypt_deinit(void *ctx) {
  memset(ctx, 0, (4 * 44));
  free(ctx);
}


x86 assembly (clang, -O0):
<aes_decrypt_deinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0xb0,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_decrypt_deinit>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0xb0,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @aes_decrypt_deinit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @memset(i8* %3, i32 0, i32 176)
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @aes_decrypt_deinit(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i32 0, i32 176)
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int EINVAL;
int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate) {
  (void)attr;
  (void)detachstate;
  return EINVAL;
}


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

x86 assembly (clang, -O2):
<pthread_attr_getdetachstate>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @pthread_attr_getdetachstate(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 = load i32, i32* @EINVAL
ret i32 %7
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @pthread_attr_getdetachstate(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
ret i32 %3
}