xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ ft_putchar(char);
int ft_putstr(char const *);
int ft_putendl(char const *s) {
  int ret;
  if (!s)
    return (0);
  ret = ft_putstr(s);
  ret += ft_putchar('\n');
  return (ret);
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <ft_putendl+0x23>
movl   $0x0,-0x4(%rbp)
jmp    116c <ft_putendl+0x4c>
mov    -0x10(%rbp),%rdi
call   1040 <ft_putstr@plt>
mov    %eax,-0x14(%rbp)
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
test   %rdi,%rdi
je     113b <ft_putendl+0x1b>
push   %rbx
call   1040 <ft_putstr@plt>
mov    %eax,%ebx
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    %ebx,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_putendl(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @ft_putstr(i8* %0)
%5 = tail call i64 @ft_putchar(i8 signext 10)
%6 = trunc i64 %5 to i32
%7 = add i32 %4, %6
br label %8
8: ; preds = %1, %3
%9 = phi i32 [ %7, %3 ], [ 0, %1 ]
ret i32 %9
}
void genc_eq_s() {}


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

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

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

LLVM IR (-O2):
define void @genc_eq_s() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ *opendir(char const *);
int directory_exists(const char *path) {
  if (path == NULL) {
    return -1;
  }
  DIR *path_dir;
  int d_exists = -1;
  path_dir = opendir(path);
  if (path_dir != NULL) {
    d_exists = 0;
    (void)closedir(path_dir);
  }
  return d_exists;
}


x86 assembly (clang, -O0):
<directory_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <directory_exists+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <directory_exists+0x58>
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1172 <directory_exists+0x52>
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <closedir@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<directory_exists>:
push   %rbx
mov    $0xffffffff,%ebx
test   %rdi,%rdi
je     113f <directory_exists+0x1f>
call   1030 <opendir@plt>
test   %rax,%rax
je     113f <directory_exists+0x1f>
mov    %rax,%rdi
call   1040 <closedir@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @directory_exists(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32* @opendir(i8* %0)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @closedir(i32* %4)
br label %8
8: ; preds = %3, %6, %1
%9 = phi i32 [ -1, %1 ], [ 0, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t bitops_getw(uint16_t *a, uint16_t sh, uint16_t l) {
  return (*a >> sh) & ((1 << (l)) - 1);
}


x86 assembly (clang, -O0):
<bitops_getw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitops_getw>:
mov    %esi,%ecx
mov    (%rdi),%esi
sar    %cl,%esi
mov    $0xffffffff,%eax
mov    %edx,%ecx
shl    %cl,%eax
not    %eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @bitops_getw(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** %4
%8 = load i32, i32* %7
%9 = load i32, i32* %5
%10 = ashr i32 %8, %9
%11 = load i32, i32* %6
%12 = shl i32 1, %11
%13 = sub nsw i32 %12, 1
%14 = and i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @bitops_getw(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = ashr i32 %4, %1
%6 = shl nsw i32 -1, %2
%7 = xor i32 %6, -1
%8 = and i32 %5, %7
ret i32 %8
}
void genbgezl_out() {}


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

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

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

LLVM IR (-O2):
define void @genbgezl_out() {
ret void
}
unsigned char bitsum1(unsigned char byte) {
  unsigned char ret;
  unsigned char i;
  for (i = 0, ret = 0; i < 8; i++)
    if (byte & 0x01 << i)
      ret++;
  return ret;
}


x86 assembly (clang, -O0):
<bitsum1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x8,%eax
jge    1155 <bitsum1+0x55>
movzbl -0x1(%rbp),%eax
movzbl -0x3(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1143 <bitsum1+0x43>
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    1148 <bitsum1+0x48>
mov    -0x3(%rbp),%al
add    $0x1,%al
mov    %al,-0x3(%rbp)
jmp    1112 <bitsum1+0x12>
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitsum1>:
mov    %edi,%eax
and    $0x1,%al
mov    %edi,%ecx
shr    %cl
and    $0x1,%cl
add    %al,%cl
mov    %edi,%eax
shr    $0x2,%al
and    $0x1,%al
add    %cl,%al
mov    %edi,%ecx
shr    $0x3,%cl
and    $0x1,%cl
add    %al,%cl
mov    %edi,%eax
shr    $0x4,%al
and    $0x1,%al
add    %cl,%al
mov    %edi,%ecx
shr    $0x5,%cl
and    $0x1,%cl
add    %al,%cl
mov    %edi,%eax
shr    $0x6,%al
and    $0x1,%al
add    %cl,%al
shr    $0x7,%dil
add    %dil,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @bitsum1(i8 zeroext %0) {
%2 = and i8 %0, 1
%3 = lshr i8 %0, 1
%4 = and i8 %3, 1
%5 = add nuw nsw i8 %2, %4
%6 = lshr i8 %0, 2
%7 = and i8 %6, 1
%8 = add nuw nsw i8 %5, %7
%9 = lshr i8 %0, 3
%10 = and i8 %9, 1
%11 = add nuw nsw i8 %8, %10
%12 = lshr i8 %0, 4
%13 = and i8 %12, 1
%14 = add nuw nsw i8 %11, %13
%15 = lshr i8 %0, 5
%16 = and i8 %15, 1
%17 = add nuw nsw i8 %14, %16
%18 = lshr i8 %0, 6
%19 = and i8 %18, 1
%20 = add nuw nsw i8 %17, %19
%21 = lshr i8 %0, 7
%22 = add nuw nsw i8 %20, %21
ret i8 %22
}
int point_in_circle(int x, int y, int other_x, int other_y, int r) {
  return ((x - other_x) * (x - other_x) + (y - other_y) * (y - other_y)) <
         r * r;
}


x86 assembly (clang, -O0):
<point_in_circle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0xc(%rbp),%ecx
imul   %ecx,%eax
mov    -0x8(%rbp),%ecx
sub    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%edx
sub    -0x10(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    -0x14(%rbp),%ecx
imul   -0x14(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<point_in_circle>:
sub    %edx,%edi
imul   %edi,%edi
sub    %ecx,%esi
imul   %esi,%esi
add    %edi,%esi
imul   %r8d,%r8d
xor    %eax,%eax
cmp    %r8d,%esi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @point_in_circle(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sub nsw i32 %0, %2
%7 = mul nsw i32 %6, %6
%8 = sub nsw i32 %1, %3
%9 = mul nsw i32 %8, %8
%10 = add nuw nsw i32 %9, %7
%11 = mul nsw i32 %4, %4
%12 = icmp ult i32 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
FNIEMOP_DEF(iemOp_Grp7_vmlaunch) {
  AssertFailed();
  return IEMOP_RAISE_INVALID_OPCODE();
}


x86 assembly (clang, -O0):
<FNIEMOP_DEF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <AssertFailed@plt>
mov    $0x0,%al
call   1030 <IEMOP_RAISE_INVALID_OPCODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FNIEMOP_DEF>:
push   %rax
xor    %eax,%eax
call   1040 <AssertFailed@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <IEMOP_RAISE_INVALID_OPCODE@plt>

LLVM IR (-O0):
define i32 @FNIEMOP_DEF(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @AssertFailed()
%4 = call i32 (...) @IEMOP_RAISE_INVALID_OPCODE()
ret i32 %4
}

LLVM IR (-O2):
define i32 @FNIEMOP_DEF(i32 %0) {
%2 = tail call i32 (...) @AssertFailed()
%3 = tail call i32 (...) @IEMOP_RAISE_INVALID_OPCODE()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ crtc_reg_write(int, unsigned char);
void __attribute__((no)) set_cursor_scan_start(unsigned char scan_start) {
  if (scan_start & 0x20)
    scan_start = 0x10 | (scan_start & 0xf);
  crtc_reg_write(0xa, scan_start);
}


x86 assembly (clang, -O0):
<set_cursor_scan_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     113b <set_cursor_scan_start+0x2b>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
or     $0x10,%eax
mov    %al,-0x1(%rbp)
mov    $0xa,%edi
movzbl -0x1(%rbp),%esi
call   1030 <crtc_reg_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cursor_scan_start>:
mov    %edi,%eax
and    $0xf,%al
or     $0x10,%al
test   $0x20,%dil
movzbl %al,%eax
cmove  %edi,%eax
movzbl %al,%esi
mov    $0xa,%edi
jmp    1030 <crtc_reg_write@plt>

LLVM IR (-O0):
define void @set_cursor_scan_start(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = and i32 %9, 15
%11 = or i32 16, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
br label %13
13: ; preds = %7, %1
%14 = load i8, i8* %2
%15 = call i32 @crtc_reg_write(i32 10, i8 zeroext %14)
ret void
}

LLVM IR (-O2):
define void @set_cursor_scan_start(i8 zeroext %0) {
%2 = and i8 %0, 32
%3 = icmp eq i8 %2, 0
%4 = and i8 %0, 15
%5 = or i8 %4, 16
%6 = select i1 %3, i8 %0, i8 %5
%7 = tail call i32 @crtc_reg_write(i32 10, i8 zeroext %6)
ret void
}
/* Variables and functions */
unsigned char readPort1(int);
unsigned char AL_readStatus(void) { return readPort1(0X388); }


x86 assembly (clang, -O0):
<AL_readStatus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x388,%edi
call   1030 <readPort1@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AL_readStatus>:
mov    $0x388,%edi
jmp    1030 <readPort1@plt>

LLVM IR (-O0):
define zeroext i8 @AL_readStatus() {
%1 = call zeroext i8 @readPort1(i32 904)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @AL_readStatus() {
%1 = tail call zeroext i8 @readPort1(i32 904)
ret i8 %1
}
int frontIntX(int currentX, int currentDir) {
  if (currentDir == 1)
    return currentX - 1;
  else if (currentDir == 3)
    return currentX + 1;
  else
    return currentX;
}


x86 assembly (clang, -O0):
<frontIntX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1122 <frontIntX+0x22>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <frontIntX+0x40>
cmpl   $0x3,-0xc(%rbp)
jne    113a <frontIntX+0x3a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <frontIntX+0x40>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<frontIntX>:
mov    %edi,%eax
cmp    $0x3,%esi
je     1110 <frontIntX+0x10>
cmp    $0x1,%esi
jne    1113 <frontIntX+0x13>
add    $0xffffffff,%eax
ret
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @frontIntX(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 eq i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %3
br label %19
11: ; preds = %2
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 3
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %19
17: ; preds = %11
%18 = load i32, i32* %4
store i32 %18, i32* %3
br label %19
19: ; preds = %17, %14, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @frontIntX(i32 %0, i32 %1) {
switch i32 %1, label %7 [
i32 1, label %3
i32 3, label %5
]
3: ; preds = %2
%4 = add nsw i32 %0, -1
br label %7
5: ; preds = %2
%6 = add nsw i32 %0, 1
br label %7
7: ; preds = %2, %5, %3
%8 = phi i32 [ %4, %3 ], [ %6, %5 ], [ %0, %2 ]
ret i32 %8
}
/* Variables and functions */
char *memcpy(char *, char const *, size_t);
char *strncpy(char *dst, const char *src, register size_t count) {
  return memcpy(dst, src, count);
}


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

x86 assembly (clang, -O2):
<strncpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @strncpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *, int *);
int solve(int, int);
int main() {
  int a = 0, b = 0, res = 0;
  res = scanf("%d %d", &a, &b);
  printf("%d", solve(a, b));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x0,(%rsp)
lea    0xeb9(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <solve@plt>
lea    0xe9c(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @solve(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int vh_osdep_init(void) {
  int rc = 0;
  return rc;
}


x86 assembly (clang, -O0):
<vh_osdep_init>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @vh_osdep_init() {
ret i32 0
}
double fd2epb(string)
char *string;
{
  double dj;
  dj = fd2jd(string);
  if (dj < 1.0)
    return (dj / 365.242198781);
  else
    return (jd2epb(dj));
}


x86 assembly (clang, -O0):
<fd2epb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <fd2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb8(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    116e <fd2epb+0x4e>
movsd  -0x18(%rbp),%xmm0
movsd  0xea8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1183 <fd2epb+0x63>
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1040 <jd2epb@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd2epb>:
push   %rax
xor    %eax,%eax
call   1030 <fd2jd@plt>
cvtsi2sd %eax,%xmm0
test   %eax,%eax
jle    1140 <fd2epb+0x20>
mov    $0x1,%al
call   1040 <jd2epb@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret
divsd  0xeb8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fd2epb(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @fd2jd to i32 (i8*, ...)*)(i8* %5)
%7 = sitofp i32 %6 to double
store double %7, double* %4
%8 = load double, double* %4
%9 = fcmp olt double %8, 1.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load double, double* %4
%12 = fdiv double %11, 0x4076D3E00BD4386B
store double %12, double* %2
br label %17
13: ; preds = %1
%14 = load double, double* %4
%15 = call i32 (double, ...) bitcast (i32 (...)* @jd2epb to i32 (double, ...)*)(double %14)
%16 = sitofp i32 %15 to double
store double %16, double* %2
br label %17
17: ; preds = %13, %10
%18 = load double, double* %2
ret double %18
}

LLVM IR (-O2):
define double @fd2epb(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fd2jd to i32 (i8*, ...)*)(i8* %0)
%3 = sitofp i32 %2 to double
%4 = icmp slt i32 %2, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = fdiv double %3, 0x4076D3E00BD4386B
br label %10
7: ; preds = %1
%8 = tail call i32 (double, ...) bitcast (i32 (...)* @jd2epb to i32 (double, ...)*)(double %3)
%9 = sitofp i32 %8 to double
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}
void exynos5_default_sdhci1(void) {}


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

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

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

LLVM IR (-O2):
define void @exynos5_default_sdhci1() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long blue_mask;
};
typedef TYPE_1__ XVisualInfo;

/* Variables and functions */
void set_XVisualInfo_blue_mask(void *_p, unsigned long _v) {
  ((XVisualInfo *)_p)->blue_mask = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XVisualInfo_blue_mask>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XVisualInfo_blue_mask(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %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 i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XVisualInfo_blue_mask(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
long labs(long a) { return a > 0 ? a : -a; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1120 <labs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i64, i64* %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = sub nsw i64 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i64 [ %6, %5 ], [ %9, %7 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Type definitions */
struct intel_ring {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kfree(struct intel_ring *);
void mock_ring_free(struct intel_ring *ring) { kfree(ring); }


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

x86 assembly (clang, -O2):
<mock_ring_free>:
jmp    1030 <kfree@plt>

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

LLVM IR (-O2):
%struct.intel_ring = type { i32 }
define void @mock_ring_free(%struct.intel_ring* %0) {
%2 = tail call i32 @kfree(%struct.intel_ring* %0)
ret void
}
/* Variables and functions */
char *getenv(char *);
char *strchr(char *, char);
char *read_env_var(char *name) {
  char *v = getenv(name);
  if (v) {
    char *quote = strchr(v, '"');
    if (quote) {
      *quote = '\0';
    }
  }
  return v;
}


x86 assembly (clang, -O0):
<read_env_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <read_env_var+0x4d>
mov    -0x10(%rbp),%rdi
mov    $0x22,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1168 <read_env_var+0x48>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
jmp    116d <read_env_var+0x4d>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_env_var>:
push   %rbx
call   1030 <getenv@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1143 <read_env_var+0x23>
mov    %rbx,%rdi
mov    $0x22,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1143 <read_env_var+0x23>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @read_env_var(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @getenv(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i8* @strchr(i8* %10, i8 signext 34)
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = load i8*, i8** %4
store i8 0, i8* %15
br label %16
16: ; preds = %14, %9
br label %17
17: ; preds = %16, %1
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @read_env_var(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i8* @strchr(i8* %2, i8 signext 34)
%6 = icmp eq i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %4
store i8 0, i8* %5
br label %8
8: ; preds = %4, %7, %1
ret i8* %2
}
char **kth_sentence_in_mth_paragraph(char ****document, int k, int m) {
  return document[m - 1][k - 1];
}


x86 assembly (clang, -O0):
<kth_sentence_in_mth_paragraph>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kth_sentence_in_mth_paragraph>:
movslq %edx,%rax
mov    -0x8(%rdi,%rax,8),%rax
movslq %esi,%rcx
mov    -0x8(%rax,%rcx,8),%rax
ret

LLVM IR (-O0):
define i8** @kth_sentence_in_mth_paragraph(i8**** %0, i32 %1, i32 %2) {
%4 = alloca i8****
%5 = alloca i32
%6 = alloca i32
store i8**** %0, i8***** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8****, i8***** %4
%8 = load i32, i32* %6
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8***, i8**** %7, i64 %10
%12 = load i8***, i8**** %11
%13 = load i32, i32* %5
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8**, i8*** %12, i64 %15
%17 = load i8**, i8*** %16
ret i8** %17
}

LLVM IR (-O2):
define i8** @kth_sentence_in_mth_paragraph(i8**** nocapture %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8***, i8**** %0, i64 %5
%7 = load i8***, i8**** %6
%8 = add nsw i32 %1, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8**, i8*** %7, i64 %9
%11 = load i8**, i8*** %10
ret i8** %11
}
void INT_Excep_PERIA_INTA234(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA234() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_stdin();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
float ask_angle(void) {
  float angle;
  printf("\x1b["
         "1"
         "m"
         "\nAngle (degrees): "
         "\x1b[0m");
  scanf("%f", &angle);
  clear_stdin();
  angle *= 3.14159 / 180.0f;
  return angle;
}


x86 assembly (clang, -O0):
<ask_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    $0x0,%al
call   1030 <clear_stdin@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe94(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ask_angle>:
push   %rax
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1030 <clear_stdin@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xe99(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [27 x i8] c"\1B[1m\0AAngle (degrees): \1B[0m\00"
@.str.1 = [3 x i8] c"%f\00"
define float @ask_angle() {
%1 = alloca float
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%4 = call i32 (...) @clear_stdin()
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fmul double %6, 0x3F91DF45A50DE270
%8 = fptrunc double %7 to float
store float %8, float* %1
%9 = load float, float* %1
ret float %9
}

LLVM IR (-O2):
@.str = [27 x i8] c"\1B[1m\0AAngle (degrees): \1B[0m\00"
@.str.1 = [3 x i8] c"%f\00"
define float @ask_angle() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = call i32 (...) @clear_stdin()
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = fmul double %7, 0x3F91DF45A50DE270
%9 = fptrunc double %8 to float
ret float %9
}
__typeof__(calloc(1, 1)) test_calloc_100(void) { return calloc(1, 1); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%esi
mov    %rsi,%rdi
call   1030 <calloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x1,%edi
mov    $0x1,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @test_calloc_100() {
%1 = call i8* @calloc(i64 1, i64 1)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @test_calloc_100() {
%1 = tail call dereferenceable_or_null(1) i8* @calloc(i64 1, i64 1)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Welcome to Little Cave Adventure.\n");
  printf("It is very dark in here.\n");
  printf("\nBye!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeff(%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>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Welcome to Little Cave Adventure.\0A\00"
@.str.1 = [26 x i8] c"It is very dark in here.\0A\00"
@.str.2 = [7 x i8] c"\0ABye!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [34 x i8] c"Welcome to Little Cave Adventure.\00"
@str.3 = [25 x i8] c"It is very dark in here.\00"
@str.4 = [6 x i8] c"\0ABye!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
int stringLength(const char string[]) {
  int count = 0;
  while (string[count] != 0)
    ++count;
  return count;
}


x86 assembly (clang, -O0):
<stringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <stringLength+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <stringLength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <stringLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @stringLength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
double log(double);
double test_func_3(double x) { return 1 - x * log(x + 20); }


x86 assembly (clang, -O0):
<test_func_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed9(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe9c(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_3>:
push   %rax
movapd %xmm0,%xmm1
movsd  %xmm0,(%rsp)
movsd  0xede(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1030 <log@plt>
mulsd  (%rsp),%xmm0
movsd  0xed0(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @test_func_3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 2.000000e+01
%6 = call double @log(double %5)
%7 = fneg double %3
%8 = call double @llvm.fmuladd.f64(double %7, double %6, double 1.000000e+00)
ret double %8
}

LLVM IR (-O2):
define double @test_func_3(double %0) {
%2 = fadd double %0, 2.000000e+01
%3 = tail call double @log(double %2)
%4 = fneg double %0
%5 = tail call double @llvm.fmuladd.f64(double %4, double %3, double 1.000000e+00)
ret double %5
}
OP(dd, a2) {
  illegal_1();
  op_a2();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_a2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_a2@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_a2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ glEnd();
void endCallback(void) { glEnd(); }


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

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

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

LLVM IR (-O2):
define void @endCallback() {
%1 = tail call i32 (...) @glEnd()
ret void
}
/* Variables and functions */
scalar_t__ rmdir(char const *);
int g_remove_dir(const char *dirname) { return rmdir(dirname) == 0; }


x86 assembly (clang, -O0):
<g_remove_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rmdir@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_remove_dir>:
push   %rax
call   1030 <rmdir@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @g_remove_dir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @rmdir(i8* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @g_remove_dir(i8* nocapture %0) {
%2 = tail call i64 @rmdir(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int getADC(int /*<<< orphan*/);
double referenceVoltage(void) { return ((5. * getADC(0)) / 1023.); }


x86 assembly (clang, -O0):
<referenceVoltage>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <getADC@plt>
cvtsi2sd %eax,%xmm1
movsd  0xee1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xecd(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<referenceVoltage>:
push   %rax
xor    %edi,%edi
call   1030 <getADC@plt>
cvtsi2sd %eax,%xmm0
mulsd  0xedc(%rip),%xmm0
divsd  0xedc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @referenceVoltage() {
%1 = call i32 @getADC(i32 0)
%2 = sitofp i32 %1 to double
%3 = fmul double 5.000000e+00, %2
%4 = fdiv double %3, 1.023000e+03
ret double %4
}

LLVM IR (-O2):
define double @referenceVoltage() {
%1 = tail call i32 @getADC(i32 0)
%2 = sitofp i32 %1 to double
%3 = fmul double %2, 5.000000e+00
%4 = fdiv double %3, 1.023000e+03
ret double %4
}
int InitWorkThread() { return 1; }


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

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

LLVM IR (-O0):
define i32 @InitWorkThread() {
ret i32 1
}

LLVM IR (-O2):
define i32 @InitWorkThread() {
ret i32 1
}
unsigned long native_save_fl(void) {
  unsigned long flags;
  __asm__ __volatile__("# __raw_save_flags\n\t"
                       "pushf ; pop %0"
                       : "=g"(flags)
                       :
                       : "memory");
  return flags;
}


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

x86 assembly (clang, -O2):
<native_save_fl>:
pushf
pop    -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @native_save_fl() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @native_save_fl() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = load i64, i64* %1
ret i64 %3
}
int testBit_fun_ulong(unsigned long x, unsigned i) { return (x & 1 << i) != 0; }


x86 assembly (clang, -O0):
<testBit_fun_ulong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBit_fun_ulong>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
xor    %eax,%eax
test   %rdi,%rcx
setne  %al
ret

LLVM IR (-O0):
define i32 @testBit_fun_ulong(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = and i64 %5, %8
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @testBit_fun_ulong(i64 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = sext i32 %3 to i64
%5 = and i64 %4, %0
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
double f4_cb_send_two_float(double (*cb)(float, float)) {
  float r1 = 55.0;
  float r2 = 55.0;
  return cb(r1, r2) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_two_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xee7(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   *%rax
movsd  0xec2(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_two_float>:
push   %rax
movss  0xef7(%rip),%xmm0
movapd %xmm0,%xmm1
call   *%rdi
addsd  0xef1(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_two_float(double (float, float)* %0) {
%2 = alloca double (float, float)*
%3 = alloca float
%4 = alloca float
store double (float, float)* %0, double (float, float)** %2
store float 5.500000e+01, float* %3
store float 5.500000e+01, float* %4
%5 = load double (float, float)*, double (float, float)** %2
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call double %5(float %6, float %7)
%9 = fadd double %8, 1.000000e+00
ret double %9
}

LLVM IR (-O2):
define double @f4_cb_send_two_float(double (float, float)* nocapture %0) {
%2 = tail call double %0(float 5.500000e+01, float 5.500000e+01)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y_root;
};
typedef TYPE_1__ XKeyPressedEvent;

/* Variables and functions */
void set_XKeyPressedEvent_y_root(void *_p, int _v) {
  ((XKeyPressedEvent *)_p)->y_root = (int)_v;
}


x86 assembly (clang, -O0):
<set_XKeyPressedEvent_y_root>:
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_XKeyPressedEvent_y_root>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XKeyPressedEvent_y_root(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_XKeyPressedEvent_y_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int toe_bond_slavecnt(struct net_device *bond_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.net_device = type opaque
define i32 @toe_bond_slavecnt(%struct.net_device* nocapture readnone %0) {
ret i32 0
}
void foo_1_1_2_1_1_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_1_2_2_2_1() {
ret void
}
/* Variables and functions */
double sqrt(double);
double g3(double x) { return (sqrt((x + 1) / x)); }


x86 assembly (clang, -O0):
<g3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g3>:
movapd %xmm0,%xmm1
movsd  0xee4(%rip),%xmm0
addsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1133 <g3+0x23>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @g3(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.000000e+00
%5 = load double, double* %2
%6 = fdiv double %4, %5
%7 = call double @sqrt(double %6)
ret double %7
}

LLVM IR (-O2):
define double @g3(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fdiv double %2, %0
%4 = tail call double @sqrt(double %3)
ret double %4
}
/* Type definitions */
struct udphdr {
  int dummy;
};
struct sk_buff {
  int dummy;
};

/* Variables and functions */
scalar_t__ skb_transport_header(struct sk_buff const *);
struct udphdr *udp_hdr(const struct sk_buff *skb) {
  return (struct udphdr *)skb_transport_header(skb);
}


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

x86 assembly (clang, -O2):
<udp_hdr>:
jmp    1030 <skb_transport_header@plt>

LLVM IR (-O0):
%struct.udphdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.udphdr* @udp_hdr(%struct.sk_buff* %0) {
%2 = alloca %struct.sk_buff*
store %struct.sk_buff* %0, %struct.sk_buff** %2
%3 = load %struct.sk_buff*, %struct.sk_buff** %2
%4 = call i64 @skb_transport_header(%struct.sk_buff* %3)
%5 = inttoptr i64 %4 to %struct.udphdr*
ret %struct.udphdr* %5
}

LLVM IR (-O2):
%struct.udphdr = type { i32 }
%struct.sk_buff = type { i32 }
define %struct.udphdr* @udp_hdr(%struct.sk_buff* %0) {
%2 = tail call i64 @skb_transport_header(%struct.sk_buff* %0)
%3 = inttoptr i64 %2 to %struct.udphdr*
ret %struct.udphdr* %3
}
void test_afficher_mains_cachee() {}


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

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

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

LLVM IR (-O2):
define void @test_afficher_mains_cachee() {
ret void
}
/* Variables and functions */
int _isblank(int);
int isblank(int c) { return _isblank(c); }


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

x86 assembly (clang, -O2):
<isblank>:
jmp    1030 <_isblank@plt>

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

LLVM IR (-O2):
define i32 @isblank(i32 %0) {
%2 = tail call i32 @_isblank(i32 %0)
ret i32 %2
}