xunge/DecIR huggingface dataset:
/* Variables and functions */
int SPI_LOOP;
int SPI_getMode(int);
int SPI_setMode(int, int);
int SPI_disableLoopback(int spidev_fd) {
  int mode = SPI_getMode(spidev_fd);
  if (mode < 0)
    return -1;
  return SPI_setMode(spidev_fd, mode & ~SPI_LOOP);
}


x86 assembly (clang, -O0):
<SPI_disableLoopback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <SPI_getMode@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114c <SPI_disableLoopback+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <SPI_disableLoopback+0x48>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%esi
call   1030 <SPI_setMode@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_disableLoopback>:
push   %rbx
mov    %edi,%ebx
call   1040 <SPI_getMode@plt>
test   %eax,%eax
js     1143 <SPI_disableLoopback+0x23>
mov    0x2ea5(%rip),%rcx
mov    (%rcx),%ecx
not    %ecx
and    %ecx,%eax
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <SPI_setMode@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SPI_LOOP = global i32 0
define i32 @SPI_disableLoopback(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @SPI_getMode(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %17
10: ; preds = %1
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* @SPI_LOOP
%14 = xor i32 %13, -1
%15 = and i32 %12, %14
%16 = call i32 @SPI_setMode(i32 %11, i32 %15)
store i32 %16, i32* %2
br label %17
17: ; preds = %10, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@SPI_LOOP = global i32 0
define i32 @SPI_disableLoopback(i32 %0) {
%2 = tail call i32 @SPI_getMode(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @SPI_LOOP
%6 = xor i32 %5, -1
%7 = and i32 %2, %6
%8 = tail call i32 @SPI_setMode(i32 %0, i32 %7)
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ -1, %1 ]
ret i32 %10
}
int JumpStep(int n) {
  if (n <= 0)
    return 0;
  if (n == 1 || n == 2)
    return n;
  return (JumpStep(n - 1) + JumpStep(n - 2));
}


x86 assembly (clang, -O0):
<JumpStep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <JumpStep+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1173 <JumpStep+0x63>
cmpl   $0x1,-0x8(%rbp)
je     1145 <JumpStep+0x35>
cmpl   $0x2,-0x8(%rbp)
jne    1150 <JumpStep+0x40>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <JumpStep+0x63>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <JumpStep@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <JumpStep@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<JumpStep>:
test   %edi,%edi
jle    1127 <JumpStep+0x17>
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    -0x1(%rbx),%eax
xor    %ebp,%ebp
cmp    $0x2,%eax
jae    112a <JumpStep+0x1a>
mov    %ebx,%eax
jmp    1149 <JumpStep+0x39>
xor    %eax,%eax
ret
xor    %ebp,%ebp
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <JumpStep@plt>
mov    %eax,%ecx
lea    -0x2(%rbx),%eax
add    %ecx,%ebp
add    $0xfffffffd,%ebx
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1130 <JumpStep+0x20>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @JumpStep(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %19, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = icmp ult i32 %4, 2
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %13, %6 ], [ %4, %3 ]
%8 = phi i32 [ %12, %6 ], [ 0, %3 ]
%9 = phi i32 [ %11, %6 ], [ %0, %3 ]
%10 = tail call i32 @JumpStep(i32 %7)
%11 = add nsw i32 %9, -2
%12 = add nsw i32 %10, %8
%13 = add nsw i32 %9, -3
%14 = icmp ult i32 %13, 2
br i1 %14, label %15, label %6
15: ; preds = %6, %3
%16 = phi i32 [ %0, %3 ], [ %11, %6 ]
%17 = phi i32 [ 0, %3 ], [ %12, %6 ]
%18 = add nsw i32 %16, %17
br label %19
19: ; preds = %15, %1
%20 = phi i32 [ %18, %15 ], [ 0, %1 ]
ret i32 %20
}
int _noop_cmp(void *v, char key[16], void *params) { return 1; }


x86 assembly (clang, -O0):
<_noop_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_noop_cmp(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 1
}
foo(int *p, int i) {
  int x;
  if (i > 10) {
    if (p) {
      x = *p;
      p = 0;
    }
  } else
    p = 0;
  if (p == 0)
    return x + 1;
  return i;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jle    1136 <foo+0x36>
cmpq   $0x0,-0x10(%rbp)
je     1131 <foo+0x31>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
jmp    113e <foo+0x3e>
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1157 <foo+0x57>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115d <foo+0x5d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %rdi,%rdi
je     110f <foo+0xf>
cmp    $0xb,%esi
jl     110f <foo+0xf>
mov    (%rdi),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32* %0, i32 %1) {
%3 = icmp slt i32 %1, 11
%4 = icmp eq i32* %0, null
%5 = or i1 %4, %3
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* %0
%8 = add i32 %7, 1
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ undef, %2 ]
ret i32 %10
}
char *langRomTypeStandard() { return "Standard"; }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"Standard\00"
define i8* @langRomTypeStandard() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
char *grskip(register char *p, register c) {
  while (*p && *p != c)
    ++p;
  if (*p)
    *p++ = 0;
  return (p);
}


x86 assembly (clang, -O0):
<grskip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1130 <grskip+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1140 <grskip+0x40>
jmp    1151 <grskip+0x51>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <grskip+0xb>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1170 <grskip+0x70>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grskip>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     111f <grskip+0x1f>
cmp    %esi,%ecx
jne    1110 <grskip+0x10>
lea    -0x1(%rax),%rdx
test   %cl,%cl
je     112b <grskip+0x2b>
movb   $0x0,(%rdx)
ret
mov    %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @grskip(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = sext i8 %5 to i32
%8 = icmp eq i32 %7, %1
%9 = or i1 %6, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
br i1 %6, label %13, label %12
12: ; preds = %11
store i8 0, i8* %4
br label %13
13: ; preds = %12, %11
%14 = phi i8* [ %10, %12 ], [ %4, %11 ]
ret i8* %14
}
int test_imm_EBint16_mem(short *val) {
  return ((*val) & (-0xEB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EBint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -235
%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_EBint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -235
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void init() {
  freopen("magic.in", "r", stdin);
  freopen("magic.out", "w+", stdout);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
lea    0xedc(%rip),%rdi
lea    0xede(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
lea    0xecb(%rip),%rdi
lea    0xece(%rip),%rsi
call   1030 <freopen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
lea    0xedf(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
lea    0xece(%rip),%rdi
lea    0xed1(%rip),%rsi
pop    %rax
jmp    1030 <freopen@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"magic.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [10 x i8] c"magic.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
define void @init() {
%1 = load i32, i32* @stdin
%2 = call i32 @freopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"magic.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [10 x i8] c"magic.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
define void @init() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @freopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}
void SPI_set_16_bit() {
  (*((volatile unsigned char *)0xE0068004)) = 0x01;
  (*((volatile unsigned short *)0xE0068000)) = 0x10F;
  (*((volatile unsigned char *)0xE0068004)) = 0x02;
}


x86 assembly (clang, -O0):
<SPI_set_16_bit>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0068004,%eax
movb   $0x1,(%rax)
mov    $0xe0068000,%eax
movw   $0x10f,(%rax)
mov    $0xe0068004,%eax
movb   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_set_16_bit>:
mov    $0xe0068004,%eax
movb   $0x1,(%rax)
movw   $0x10f,-0x4(%rax)
movb   $0x2,(%rax)
ret

LLVM IR (-O0):
define void @SPI_set_16_bit() {
store volatile i8 1, i8* inttoptr (i64 3758522372 to i8*)
store volatile i16 271, i16* inttoptr (i64 3758522368 to i16*)
store volatile i8 2, i8* inttoptr (i64 3758522372 to i8*)
ret void
}

LLVM IR (-O2):
define void @SPI_set_16_bit() {
store volatile i8 1, i8* inttoptr (i64 3758522372 to i8*)
store volatile i16 271, i16* inttoptr (i64 3758522368 to i16*)
store volatile i8 2, i8* inttoptr (i64 3758522372 to i8*)
ret void
}
void g_arith_pow_u64(void *s, void *d, void *o) {}


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

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

LLVM IR (-O0):
define void @g_arith_pow_u64(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @g_arith_pow_u64(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
long long _mm_cvttsd_si64(int /*<<< orphan*/);
long long test_mm_cvttsd_si64(__m128d A) { return _mm_cvttsd_si64(A); }


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

x86 assembly (clang, -O2):
<test_mm_cvttsd_si64>:
jmp    1030 <_mm_cvttsd_si64@plt>

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

LLVM IR (-O2):
define i64 @test_mm_cvttsd_si64(i32 %0) {
%2 = tail call i64 @_mm_cvttsd_si64(i32 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ lgen(char *, char *, int);
void cgstorsb(int n) { lgen("%s\t%%al,%c%d", "movb", n); }


x86 assembly (clang, -O0):
<cgstorsb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <lgen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgstorsb>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <lgen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\09%%al,%c%d\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgstorsb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lgen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09%%al,%c%d\00"
@.str.1 = [5 x i8] c"movb\00"
define void @cgstorsb(i32 %0) {
%2 = tail call i32 @lgen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void sfree(void *ptr) { return; }


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

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

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

LLVM IR (-O2):
define void @sfree(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int delete_path(char *, int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
char *get_job_log_directory(char const *);
int /*<<< orphan*/ *strchr(char const *, char);
int delete_log_directory(const char *subdir) {
  char *log_subdir = get_job_log_directory(subdir);
  int ret = -1;
  if (log_subdir != NULL) {
    ret = delete_path(log_subdir, strchr(subdir, '/') == NULL);
  }
  free(log_subdir);
  return ret;
}


x86 assembly (clang, -O0):
<delete_log_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <get_job_log_directory@plt>
mov    %rax,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1199 <delete_log_directory+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
mov    -0x20(%rbp),%rdi
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
call   1040 <delete_path@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_log_directory>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1060 <get_job_log_directory@plt>
mov    %rax,%r14
test   %rax,%rax
je     1176 <delete_log_directory+0x36>
mov    %rbx,%rdi
mov    $0x2f,%esi
call   1050 <strchr@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
mov    %r14,%rdi
call   1040 <delete_path@plt>
mov    %eax,%ebx
jmp    117b <delete_log_directory+0x3b>
mov    $0xffffffff,%ebx
mov    %r14,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @delete_log_directory(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @get_job_log_directory(i8* %5)
store i8* %6, i8** %3
store i32 -1, i32* %4
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32* @strchr(i8* %11, i8 signext 47)
%13 = icmp eq i32* %12, null
%14 = zext i1 %13 to i32
%15 = call i32 @delete_path(i8* %10, i32 %14)
store i32 %15, i32* %4
br label %16
16: ; preds = %9, %1
%17 = load i8*, i8** %3
%18 = call i32 @free(i8* %17)
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @delete_log_directory(i8* %0) {
%2 = tail call i8* @get_job_log_directory(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32* @strchr(i8* %0, i8 signext 47)
%6 = icmp eq i32* %5, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @delete_path(i8* %2, i32 %7)
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ %8, %4 ], [ -1, %1 ]
%11 = tail call i32 @free(i8* %2)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f1(int i) { printf("%d\n", i); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @f1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Prexit(char *, int, int);
void *calloc(int, int);
void *Calloc(int c, int b) {
  void *p;
  if (!(p = calloc(c, b)))
    Prexit("(%d)%d", c, b);
  return p;
}


x86 assembly (clang, -O0):
<Calloc>:
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 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1159 <Calloc+0x39>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeac(%rip),%rdi
call   1040 <Prexit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Calloc>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1147 <Calloc+0x27>
lea    0xec3(%rip),%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <Prexit@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"(%d)%d\00"
define noalias i8* @Calloc(i32 %0, i32 %1) {
%3 = tail call i8* @calloc(i32 %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @Prexit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *v__new_data(uint32_t capacity, uint32_t len, const char *data) {
  char *p = (char *)malloc(capacity);
  assert(p);
  if (len)
    memcpy(p, data, len);
  p[len] = '\0';
  return p;
}


x86 assembly (clang, -O0):
<v__new_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <assert@plt>
cmpl   $0x0,-0x8(%rbp)
je     1171 <v__new_data+0x41>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v__new_data>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
test   %ebp,%ebp
je     115a <v__new_data+0x2a>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @v__new_data(i32 %0, i32 %1, i8* %2) {
%4 = tail call i64 @malloc(i32 %0)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @assert(i8* %5)
%7 = icmp eq i32 %1, 0
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @memcpy(i8* %5, i8* %2, i32 %1)
br label %10
10: ; preds = %8, %3
%11 = sext i32 %1 to i64
%12 = getelementptr inbounds i8, i8* %5, i64 %11
store i8 0, i8* %12
ret i8* %5
}
void __sanitizer_sandbox_on_notify() {}


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

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

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

LLVM IR (-O2):
define void @__sanitizer_sandbox_on_notify() {
ret void
}
double _Complex __conj(double _Complex z) { return ~z; }


x86 assembly (clang, -O0):
<__conj>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm1
movaps 0xee6(%rip),%xmm2
movsd  -0x18(%rbp),%xmm0
pxor   %xmm2,%xmm0
movsd  %xmm1,-0x10(%rbp)
movlpd %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<__conj>:
xorps  0xef9(%rip),%xmm1
ret

LLVM IR (-O0):
define { double, double } @__conj(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca { double, double }
%5 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %0, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %1, double* %6
%7 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%10 = load double, double* %9
%11 = fneg double %10
%12 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%13 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %8, double* %12
store double %11, double* %13
%14 = load { double, double }, { double, double }* %3
ret { double, double } %14
}

LLVM IR (-O2):
define { double, double } @__conj(double %0, double %1) {
%3 = fneg double %1
%4 = insertvalue { double, double } poison, double %0, 0
%5 = insertvalue { double, double } %4, double %3, 1
ret { double, double } %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int troca(int *, int);
void main() {
  int a = 4;
  int b = troca(&a, 3);
  printf("a = %d, b = %d\n", a, b);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x3,%esi
call   1040 <troca@plt>
mov    0x4(%rsp),%esi
lea    0xebd(%rip),%rdi
mov    %eax,%edx
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"a = %d, b = %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 4, i32* %1
%3 = call i32 @troca(i32* %1, i32 3)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double *, int);
void Copy_Vector(double *d, double *s, int n) {
  memcpy(d, s, sizeof(double) * n);
}


x86 assembly (clang, -O0):
<Copy_Vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Copy_Vector>:
shl    $0x3,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @Copy_Vector(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 8, %10
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(double* %7, double* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @Copy_Vector(double* %0, double* %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = tail call i32 @memcpy(double* %0, double* %1, i32 %4)
ret void
}
/* Variables and functions */
float pow(float, float);
float convert_linear_rgb_to_srgb(float x) {
  if (x < 0.0031308f) {
    return (255.0f * 12.92f) * x;
  } else {
    return ((255.0f * 1.055f) * pow(x, 1.0f / 2.4f)) - (0.055 * 255.0f);
  }
}


x86 assembly (clang, -O0):
<convert_linear_rgb_to_srgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1146 <convert_linear_rgb_to_srgb+0x36>
movss  0xed5(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1180 <convert_linear_rgb_to_srgb+0x70>
movss  -0x8(%rbp),%xmm0
movss  0xeb5(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movss  0xea1(%rip),%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9d(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_linear_rgb_to_srgb>:
push   %rax
movss  0xee7(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1128 <convert_linear_rgb_to_srgb+0x18>
mulss  0xee6(%rip),%xmm0
pop    %rax
ret
movss  0xed4(%rip),%xmm1
call   1030 <pow@plt>
mulss  0xecb(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xec7(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @convert_linear_rgb_to_srgb(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0x3F69A5C380000000
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fmul float 0x40A9BD3340000000, %7
store float %8, float* %2
br label %16
9: ; preds = %1
%10 = load float, float* %3
%11 = call float @pow(float %10, float 0x3FDAAAAAA0000000)
%12 = fmul float 0x4070D06660000000, %11
%13 = fpext float %12 to double
%14 = fsub double %13, 1.402500e+01
%15 = fptrunc double %14 to float
store float %15, float* %2
br label %16
16: ; preds = %9, %6
%17 = load float, float* %2
ret float %17
}

LLVM IR (-O2):
define float @convert_linear_rgb_to_srgb(float %0) {
%2 = fcmp olt float %0, 0x3F69A5C380000000
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = fmul float %0, 0x40A9BD3340000000
br label %11
5: ; preds = %1
%6 = tail call float @pow(float %0, float 0x3FDAAAAAA0000000)
%7 = fmul float %6, 0x4070D06660000000
%8 = fpext float %7 to double
%9 = fadd double %8, -1.402500e+01
%10 = fptrunc double %9 to float
br label %11
11: ; preds = %5, %3
%12 = phi float [ %4, %3 ], [ %10, %5 ]
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ cpuid(int, unsigned int *, int /*<<< orphan*/ *,
                         int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int turbo_status() {
  unsigned int eax;
  cpuid(6, &eax, NULL, NULL, NULL);
  return ((eax & 0x2) >> 1);
}


x86 assembly (clang, -O0):
<turbo_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6,%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1030 <cpuid@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
shr    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turbo_status>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x6,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <cpuid@plt>
mov    0x4(%rsp),%eax
shr    %eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @turbo_status() {
%1 = alloca i32
%2 = call i32 @cpuid(i32 6, i32* %1, i32* null, i32* null, i32* null)
%3 = load i32, i32* %1
%4 = and i32 %3, 2
%5 = lshr i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @turbo_status() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @cpuid(i32 6, i32* %1, i32* null, i32* null, i32* null)
%4 = load i32, i32* %1
%5 = lshr i32 %4, 1
%6 = and i32 %5, 1
ret i32 %6
}
void UART_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @UART_RestoreConfig() {
ret void
}
int des_sort(a, b) const char **a;
const char **b;
{ return (strcmp(*b, *a)); }


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

x86 assembly (clang, -O2):
<des_sort>:
mov    (%rsi),%rax
mov    (%rdi),%rsi
mov    %rax,%rdi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @des_sort(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8*, i8** %0
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
max(i, j) int i, j;
{ return (i > j ? i : j); }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
struct link {
  int dummy;
};

/* Variables and functions */
struct link *concat(struct link *, struct link *);
struct link *set(struct link *);
struct link *Union(struct link *l1, struct link *l2) {
  struct link *un = concat(l1, l2);
  return set(un);
}


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

x86 assembly (clang, -O2):
<Union>:
push   %rax
call   1030 <concat@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <set@plt>

LLVM IR (-O0):
%struct.link = type { i32 }
define %struct.link* @Union(%struct.link* %0, %struct.link* %1) {
%3 = alloca %struct.link*
%4 = alloca %struct.link*
%5 = alloca %struct.link*
store %struct.link* %0, %struct.link** %3
store %struct.link* %1, %struct.link** %4
%6 = load %struct.link*, %struct.link** %3
%7 = load %struct.link*, %struct.link** %4
%8 = call %struct.link* @concat(%struct.link* %6, %struct.link* %7)
store %struct.link* %8, %struct.link** %5
%9 = load %struct.link*, %struct.link** %5
%10 = call %struct.link* @set(%struct.link* %9)
ret %struct.link* %10
}

LLVM IR (-O2):
%struct.link = type { i32 }
define %struct.link* @Union(%struct.link* %0, %struct.link* %1) {
%3 = tail call %struct.link* @concat(%struct.link* %0, %struct.link* %1)
%4 = tail call %struct.link* @set(%struct.link* %3)
ret %struct.link* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int unused_local;
  printf("Hello world\n");
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int __nvvm_read_ptx_sreg_tid_w();
int __nvvm_read_ptx_sreg_tid_x();
int __nvvm_read_ptx_sreg_tid_y();
int __nvvm_read_ptx_sreg_tid_z();
__attribute__((device)) int read_tid() {
  int x = __nvvm_read_ptx_sreg_tid_x();
  int y = __nvvm_read_ptx_sreg_tid_y();
  int z = __nvvm_read_ptx_sreg_tid_z();
  int w = __nvvm_read_ptx_sreg_tid_w();
  return x + y + z + w;
}


x86 assembly (clang, -O0):
<read_tid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <__nvvm_read_ptx_sreg_tid_x@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__nvvm_read_ptx_sreg_tid_y@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <__nvvm_read_ptx_sreg_tid_z@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <__nvvm_read_ptx_sreg_tid_w@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_tid>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1060 <__nvvm_read_ptx_sreg_tid_x@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <__nvvm_read_ptx_sreg_tid_y@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <__nvvm_read_ptx_sreg_tid_z@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <__nvvm_read_ptx_sreg_tid_w@plt>
add    %r14d,%ebp
add    %ebx,%ebp
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_tid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @__nvvm_read_ptx_sreg_tid_x()
store i32 %5, i32* %1
%6 = call i32 (...) @__nvvm_read_ptx_sreg_tid_y()
store i32 %6, i32* %2
%7 = call i32 (...) @__nvvm_read_ptx_sreg_tid_z()
store i32 %7, i32* %3
%8 = call i32 (...) @__nvvm_read_ptx_sreg_tid_w()
store i32 %8, i32* %4
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @read_tid() {
%1 = tail call i32 (...) @__nvvm_read_ptx_sreg_tid_x()
%2 = tail call i32 (...) @__nvvm_read_ptx_sreg_tid_y()
%3 = tail call i32 (...) @__nvvm_read_ptx_sreg_tid_z()
%4 = tail call i32 (...) @__nvvm_read_ptx_sreg_tid_w()
%5 = add nsw i32 %2, %1
%6 = add nsw i32 %5, %3
%7 = add nsw i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ mp_get_memory_functions(void *(*)(size_t),
                                           int /*<<< orphan*/ *,
                                           int /*<<< orphan*/ *);
void *_nettle_gmp_alloc(size_t n) {
  void *(*alloc_func)(size_t);
  assert(n > 0);
  mp_get_memory_functions(&alloc_func, NULL, NULL);
  return alloc_func(n);
}


x86 assembly (clang, -O0):
<_nettle_gmp_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1040 <mp_get_memory_functions@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nettle_gmp_alloc>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
lea    0x8(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <mp_get_memory_functions@plt>
mov    %rbx,%rdi
call   *0x8(%rsp)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_nettle_gmp_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8* (i64)*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp ugt i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = bitcast i8* (i64)** %3 to i8* (i64)*
%9 = call i32 @mp_get_memory_functions(i8* (i64)* %8, i32* null, i32* null)
%10 = load i8* (i64)*, i8* (i64)** %3
%11 = load i64, i64* %2
%12 = call i8* %10(i64 %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @_nettle_gmp_alloc(i64 %0) {
%2 = alloca i8* (i64)*
%3 = bitcast i8* (i64)** %2 to i8*
%4 = icmp ne i64 %0, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = bitcast i8* (i64)** %2 to i8* (i64)*
%8 = call i32 @mp_get_memory_functions(i8* (i64)* %7, i32* null, i32* null)
%9 = load i8* (i64)*, i8* (i64)** %2
%10 = call i8* %9(i64 %0)
ret i8* %10
}
/* Variables and functions */
int fixup_db_avp(void **, int, int);
int fixup_db_load_avp(void **param, int param_no) {
  return fixup_db_avp(param, param_no, 1);
}


x86 assembly (clang, -O0):
<fixup_db_load_avp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1030 <fixup_db_avp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixup_db_load_avp>:
mov    $0x1,%edx
jmp    1030 <fixup_db_avp@plt>

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

LLVM IR (-O2):
define i32 @fixup_db_load_avp(i8** %0, i32 %1) {
%3 = tail call i32 @fixup_db_avp(i8** %0, i32 %1, i32 1)
ret i32 %3
}
int test_llist_exists() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @test_llist_exists() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("12 + 34 = %d\n", 12 + 34);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"12 + 34 = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 46)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"12 + 34 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 46)
ret i32 0
}
__attribute__((always_)) void set_mp_bus_to_node(int busnum, int node) {}


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

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

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

LLVM IR (-O2):
define void @set_mp_bus_to_node(i32 %0, i32 %1) {
ret void
}
void RGBAToYJRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @RGBAToYJRow_AVX2() {
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct list *);
int /*<<< orphan*/ list_empty(struct list *);
int /*<<< orphan*/ list_pop(struct list *);
void list_destroy(struct list *l) {
  while (!list_empty(l))
    (void)list_pop(l);
  free(l);
}


x86 assembly (clang, -O0):
<list_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <list_empty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115a <list_destroy+0x2a>
jmp    1168 <list_destroy+0x38>
mov    -0x8(%rbp),%rdi
call   1040 <list_pop@plt>
jmp    113c <list_destroy+0xc>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_destroy>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1050 <list_empty@plt>
test   %eax,%eax
jne    1156 <list_destroy+0x26>
mov    %rbx,%rdi
call   1040 <list_pop@plt>
mov    %rbx,%rdi
jmp    1140 <list_destroy+0x10>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define void @list_destroy(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
br label %3
3: ; preds = %8, %1
%4 = load %struct.list*, %struct.list** %2
%5 = call i32 @list_empty(%struct.list* %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load %struct.list*, %struct.list** %2
%10 = call i32 @list_pop(%struct.list* %9)
br label %3
11: ; preds = %3
%12 = load %struct.list*, %struct.list** %2
%13 = call i32 @free(%struct.list* %12)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_destroy(%struct.list* %0) {
%2 = tail call i32 @list_empty(%struct.list* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = tail call i32 @list_pop(%struct.list* %0)
%6 = tail call i32 @list_empty(%struct.list* %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4, %1
%9 = tail call i32 @free(%struct.list* %0)
ret void
}