xunge/DecIR huggingface dataset:
int test_imm_F3int8_reg(signed char val) {
  return ((val) & (-0xF3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F3int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff0d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_F3int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -243
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned long st_ll_getstate(struct st_data_s *ll) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.st_data_s = type opaque
define i64 @st_ll_getstate(%struct.st_data_s* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ amaret_local_Mcu_reset__E();
int /*<<< orphan*/ pollen_hardware_Led_off__E();
void test32_Blink2_pollen__reset__E() {
  amaret_local_Mcu_reset__E();
  pollen_hardware_Led_off__E();
}


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

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

LLVM IR (-O0):
define void @test32_Blink2_pollen__reset__E() {
%1 = call i32 (...) @amaret_local_Mcu_reset__E()
%2 = call i32 (...) @pollen_hardware_Led_off__E()
ret void
}

LLVM IR (-O2):
define void @test32_Blink2_pollen__reset__E() {
%1 = tail call i32 (...) @amaret_local_Mcu_reset__E()
%2 = tail call i32 (...) @pollen_hardware_Led_off__E()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __getgroups(int size, gid_t *list) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__getgroups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getgroups>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__getgroups(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__getgroups(i32 %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Variables and functions */
size_t memlen(const unsigned char *s) {
  const unsigned char *p = s;
  while (*p)
    p++;
  return p - s;
}


x86 assembly (clang, -O0):
<memlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <memlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <memlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <memlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @memlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
int test_08(unsigned char x, int y, int z) { return ((x << 3) & 111) != 0; }


x86 assembly (clang, -O0):
<test_08>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x3,%eax
and    $0x6f,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_08>:
xor    %eax,%eax
test   $0xd,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @test_08(i8 zeroext %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 = zext i8 %7 to i32
%9 = shl i32 %8, 3
%10 = and i32 %9, 111
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_08(i8 zeroext %0, i32 %1, i32 %2) {
%4 = and i8 %0, 13
%5 = icmp ne i8 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void fn1(void) {
  __builtin_printf("xxxxxxxxxxxxxxxxx%"
                   "dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
}


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

x86 assembly (clang, -O2):
<fn1>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [75 x i8] c"xxxxxxxxxxxxxxxxx%dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\00"
define void @fn1() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
ret void
}
int FinF2(int (*f)(int)) {
  int g = 45;
  return f(g);
}


x86 assembly (clang, -O0):
<FinF2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2d,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FinF2>:
mov    %rdi,%rax
mov    $0x2d,%edi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @FinF2(i32 (i32)* nocapture %0) {
%2 = tail call i32 %0(i32 45)
ret i32 %2
}
int d(int v) { return 2 * v; }


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

x86 assembly (clang, -O2):
<d>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @d(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
RX0RX1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((p0[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
ja     1140 <RX0RX1+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <RX0RX1+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0RX1>:
movslq %edx,%rax
mov    (%r8,%rax,4),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,4),%edx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @RX0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i32, i32* %5, i64 %10
%12 = load i32, i32* %11
%13 = icmp ule i32 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
int days_of_february(year) const int year;
{ return ((year & 3) ? 28 : (!(year % 100) && (year % 400)) ? 28 : 29); }


x86 assembly (clang, -O0):
<days_of_february>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     1123 <days_of_february+0x23>
mov    $0x1c,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <days_of_february+0x66>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x9(%rbp)
jne    1150 <days_of_february+0x50>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    $0x1d,%eax
mov    $0x1c,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<days_of_february>:
mov    $0x1c,%eax
test   $0x3,%dil
je     110c <days_of_february+0xc>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1d,%eax
cmp    $0x28f5c28,%edx
ja     110b <days_of_february+0xb>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
or     $0x1c,%eax
ret

LLVM IR (-O0):
define i32 @days_of_february(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %19
7: ; preds = %1
%8 = load i32, i32* %2
%9 = srem i32 %8, 100
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = srem i32 %12, 400
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %11, %7
%16 = phi i1 [ false, %7 ], [ %14, %11 ]
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 28, i32 29
br label %19
19: ; preds = %15, %6
%20 = phi i32 [ 28, %6 ], [ %18, %15 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @days_of_february(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 29, i32 28
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 28, %1 ], [ 29, %4 ], [ %10, %7 ]
ret i32 %12
}
int security_inode_stat(struct inode *inode) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @security_inode_stat(%struct.inode* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(int);
char *removeSpace(char *str) {
  while (*str) {
    if (isspace((int)*str) == 0)
      return str;
    str++;
  }
  return str;
}


x86 assembly (clang, -O0):
<removeSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <removeSpace+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
jne    114c <removeSpace+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <removeSpace+0x55>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <removeSpace+0xc>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeSpace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <removeSpace+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <removeSpace+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <removeSpace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @removeSpace(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %10
%5 = phi i8 [ %12, %10 ], [ %2, %1 ]
%6 = phi i8* [ %11, %10 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i64 @isspace(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %10, %1
%15 = phi i8* [ %0, %1 ], [ %11, %10 ], [ %6, %4 ]
ret i8* %15
}
void main(void) {
  int q;
  int a[4];
  int b;
  b = b + q + a[1];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x24(%rbp),%eax
add    -0x4(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32
%4 = load i32, i32* %3
%5 = load i32, i32* %1
%6 = add nsw i32 %4, %5
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
store i32 %9, i32* %3
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
unsigned char is_header(const char c) {
  return ((c >= 65 && c <= 122) || c == 45) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_header>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <is_header+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1136 <is_header+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_header>:
lea    -0x41(%rdi),%eax
cmp    $0x3a,%al
setb   %cl
cmp    $0x2d,%dil
sete   %al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @is_header(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %14, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 45
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @is_header(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 58
%4 = icmp eq i8 %0, 45
%5 = or i1 %4, %3
%6 = zext i1 %5 to i8
ret i8 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ __softboundmpx_store_return_metadata(void *, void *);
void *opendir(char const *);
__attribute__((__weak__, __always___)) DIR *
softboundmpx_opendir(const char *name) {
  void *ret_ptr = opendir(name);
  void *ret_ptr_bound = (char *)ret_ptr + 1024 * 1024;
  __softboundmpx_store_return_metadata(ret_ptr, ret_ptr_bound);
  return (DIR *)ret_ptr;
}


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

x86 assembly (clang, -O2):
<softboundmpx_opendir>:
push   %rbx
call   1030 <opendir@plt>
mov    %rax,%rbx
lea    0x100000(%rax),%rsi
mov    %rax,%rdi
call   1040 <__softboundmpx_store_return_metadata@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i32* @softboundmpx_opendir(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @opendir(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1048576
store i8* %8, i8** %4
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @__softboundmpx_store_return_metadata(i8* %9, i8* %10)
%12 = load i8*, i8** %3
%13 = bitcast i8* %12 to i32*
ret i32* %13
}

LLVM IR (-O2):
define weak i32* @softboundmpx_opendir(i8* %0) {
%2 = tail call i8* @opendir(i8* %0)
%3 = getelementptr inbounds i8, i8* %2, i64 1048576
%4 = tail call i32 @__softboundmpx_store_return_metadata(i8* %2, i8* %3)
%5 = bitcast i8* %2 to i32*
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ MILLER_RABIN(int *, int);
int /*<<< orphan*/ getrandom(int, int *);
void getprime(int n, int *d) {
  do {
    getrandom(n, d);
    d[1] = 1;
  } while (!MILLER_RABIN(d, 50));
}


x86 assembly (clang, -O0):
<getprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <getrandom@plt>
mov    -0x10(%rbp),%rax
movl   $0x1,0x4(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x32,%esi
call   1030 <MILLER_RABIN@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112f <getprime+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getprime>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <getrandom@plt>
movl   $0x1,0x4(%rbx)
mov    %rbx,%rdi
mov    $0x32,%esi
call   1030 <MILLER_RABIN@plt>
test   %eax,%eax
je     1130 <getprime+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @getprime(i32 %0, i32* %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 1
br label %4
4: ; preds = %4, %2
%5 = tail call i32 @getrandom(i32 %0, i32* %1)
store i32 1, i32* %3
%6 = tail call i32 @MILLER_RABIN(i32* %1, i32 50)
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_ADDUSW(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0xdd);
  addbyte(0xc0 | (dst_reg << 3) | src_reg);
}


x86 assembly (clang, -O0):
<MMX_ADDUSW>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xdd,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0xc0,%edi
or     -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_ADDUSW>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0xdd,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebp
or     %ebx,%ebp
or     $0xc0,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_ADDUSW(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 221)
%8 = load i32, i32* %3
%9 = shl i32 %8, 3
%10 = or i32 192, %9
%11 = load i32, i32* %4
%12 = or i32 %10, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_ADDUSW(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 221)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = or i32 %7, 192
%9 = tail call i32 @addbyte(i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
void carriage() {
  char c = '0';
  while (1) {
    printf("%c", c);
    fflush(stdout);
    ++c;
    if (c > '9')
      c = '0';
    printf("\r");
    sleep(1);
  }
}


x86 assembly (clang, -O0):
<carriage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x30,-0x1(%rbp)
movsbl -0x1(%rbp),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jle    1175 <carriage+0x45>
movb   $0x30,-0x1(%rbp)
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    113c <carriage+0xc>

x86 assembly (clang, -O2):
<carriage>:
push   %rbp
push   %r14
push   %rbx
mov    $0x30,%bl
mov    0x2ea3(%rip),%r14
mov    $0x30,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %bl,%ebx
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    (%r14),%edi
call   1040 <fflush@plt>
add    $0x1,%bl
cmp    $0x3a,%bl
movzbl %bl,%ebx
cmovge %ebp,%ebx
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1150 <carriage+0x20>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@stdout = global i32 0
@.str.1 = [2 x i8] c"\0D\00"
define void @carriage() {
%1 = alloca i8
store i8 48, i8* %1
br label %2
2: ; preds = %0, %14
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = load i8, i8* %1
%9 = add i8 %8, 1
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = icmp sgt i32 %11, 57
br i1 %12, label %13, label %14
13: ; preds = %2
store i8 48, i8* %1
br label %14
14: ; preds = %13, %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
@stdout = global i32 0
define void @carriage() {
br label %1
1: ; preds = %1, %0
%2 = phi i8 [ 48, %0 ], [ %9, %1 ]
%3 = sext i8 %2 to i32
%4 = tail call i32 @putchar(i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = add i8 %2, 1
%8 = icmp sgt i8 %7, 57
%9 = select i1 %8, i8 48, i8 %7
%10 = tail call i32 @putchar(i32 13)
%11 = tail call i32 @sleep(i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void one(void) { printf("Hi from one()\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hi from one()\00"
define void @one() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
int c054(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c054() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ height;
};
struct TYPE_4__ {
  TYPE_1__ max_ink_extent;
};
typedef TYPE_2__ XFontSetExtents;

/* Variables and functions */
unsigned short get_XFontSetExtents_max_ink_extent_height(void *_p) {
  return (unsigned short)((XFontSetExtents *)_p)->max_ink_extent.height;
}


x86 assembly (clang, -O0):
<get_XFontSetExtents_max_ink_extent_height>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_XFontSetExtents_max_ink_extent_height>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define zeroext i16 @get_XFontSetExtents_max_ink_extent_height(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define zeroext i16 @get_XFontSetExtents_max_ink_extent_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}
/* Variables and functions */
scalar_t__ pow(int, int);
int lookup1_values(int a, int b) {
  int r = 0, p = 0;
  do {
    r++;
    p = (int)pow(r, b);
  } while (p <= a);
  return r - 1;
}


x86 assembly (clang, -O0):
<lookup1_values>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <pow@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jle    112c <lookup1_values+0x1c>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup1_values>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    $0xffffffff,%ebx
xchg   %ax,%ax
lea    0x2(%rbx),%edi
mov    %r14d,%esi
call   1030 <pow@plt>
add    $0x1,%ebx
cmp    %ebp,%eax
jle    1120 <lookup1_values+0x10>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @lookup1_values(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %5, %3 ]
%5 = add nuw nsw i32 %4, 1
%6 = tail call i64 @pow(i32 %5, i32 %1)
%7 = trunc i64 %6 to i32
%8 = icmp sgt i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3
ret i32 %4
}
/* Variables and functions */
void *LZ4_createStream();
void *LZ4_create(char *inputBuffer) {
  (void)inputBuffer;
  return LZ4_createStream();
}


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

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

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

LLVM IR (-O2):
define i8* @LZ4_create(i8* nocapture readnone %0) {
%2 = tail call i8* (...) @LZ4_createStream()
ret i8* %2
}
/* Variables and functions */
int CodonToAmino(int, int const);
int QcoordToCodon(int const, int const);
int QcoordToAmino(const int qcoord, const int gencode) {
  int codon;
  codon = QcoordToCodon(qcoord, gencode);
  return CodonToAmino(codon, gencode);
}


x86 assembly (clang, -O0):
<QcoordToAmino>:
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 <QcoordToCodon@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <CodonToAmino@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QcoordToAmino>:
push   %rbx
mov    %esi,%ebx
call   1030 <QcoordToCodon@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <CodonToAmino@plt>

LLVM IR (-O0):
define i32 @QcoordToAmino(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @QcoordToCodon(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @CodonToAmino(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @QcoordToAmino(i32 %0, i32 %1) {
%3 = tail call i32 @QcoordToCodon(i32 %0, i32 %1)
%4 = tail call i32 @CodonToAmino(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _do_xrstor(void const *, int);
void do_xrstor(const void *buffer) {
  _do_xrstor(buffer, 0xffffffffffffffffULL);
}


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

x86 assembly (clang, -O2):
<do_xrstor>:
mov    $0xffffffff,%esi
jmp    1030 <_do_xrstor@plt>

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

LLVM IR (-O2):
define void @do_xrstor(i8* %0) {
%2 = tail call i32 @_do_xrstor(i8* %0, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ max(char *);
int main(void) {
  char *x = "testtesttest";
  max(x);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"testtesttest\00"
define i32 @main() {
%1 = tail call i32 @max(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ japi_setdebug(int);
void j_setdebug(int arg0) { japi_setdebug(arg0); }


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

x86 assembly (clang, -O2):
<j_setdebug>:
jmp    1030 <japi_setdebug@plt>

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

LLVM IR (-O2):
define void @j_setdebug(i32 %0) {
%2 = tail call i32 @japi_setdebug(i32 %0)
ret void
}
void com90c66d(void) { return; }


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

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

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

LLVM IR (-O2):
define void @com90c66d() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int factRec(int, int);
int /*<<< orphan*/ printf(char *);
int fact(int n) {
  if (n < 0) {
    printf("Error!\n");
    exit(1);
  } else
    return factRec(1, n);
}


x86 assembly (clang, -O0):
<fact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    115b <fact+0x2b>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1040 <factRec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact>:
test   %edi,%edi
js     1140 <fact+0x10>
mov    %edi,%esi
mov    $0x1,%edi
jmp    1040 <factRec@plt>
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Error!\0A\00"
define i32 @fact(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @factRec(i32 1, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@str = [7 x i8] c"Error!\00"
define i32 @fact(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = tail call i32 @factRec(i32 1, i32 %0)
ret i32 %7
}
int test_imm_50uint8_mem(unsigned char *val) {
  return ((*val) & (-0x50 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_50uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -80
%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_50uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -80
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_dobldobl_size_limit(int k, int *szl) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(601, &k, szl, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_dobldobl_size_limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x259,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_dobldobl_size_limit>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x259,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_dobldobl_size_limit(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 601, i32* %3, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscon_dobldobl_size_limit(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 601, i32* %3, i32* %1, double* undef, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ smallest(int);
int problem005() {
  int i = 1;
  while (!smallest(i)) {
    i++;
  }
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <smallest@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114c <problem005+0x2c>
jmp    115a <problem005+0x3a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <problem005+0xf>
mov    -0x4(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebx
mov    %ebx,%edi
call   1040 <smallest@plt>
test   %eax,%eax
je     1130 <problem005+0x10>
lea    0xebb(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @problem005() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 1, %0 ], [ %5, %1 ]
%3 = tail call i32 @smallest(i32 %2)
%4 = icmp eq i32 %3, 0
%5 = add nuw nsw i32 %2, 1
br i1 %4, label %1, label %6
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
void RTDbgAsSymbolByAddr(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgAsSymbolByAddr() {
ret void
}
int isPrime(int num) {
  int i;
  for (i = 2; i < num; ++i) {
    if (num % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <isPrime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <isPrime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <isPrime+0x50>
jmp    113b <isPrime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <isPrime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <isPrime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <isPrime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <isPrime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
void ws_init(void) {}


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

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

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

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

/* Variables and functions */
void *malloc(size_t);
void *mymalloc(struct alloc_type *myalloc, size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<mymalloc>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
%struct.alloc_type = type { i32 }
define i8* @mymalloc(%struct.alloc_type* %0, i64 %1) {
%3 = alloca %struct.alloc_type*
%4 = alloca i64
store %struct.alloc_type* %0, %struct.alloc_type** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i8* @malloc(i64 %5)
ret i8* %6
}

LLVM IR (-O2):
%struct.alloc_type = type { i32 }
define noalias i8* @mymalloc(%struct.alloc_type* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ TMR3_DriverIRQHandler();
__attribute__((weak)) void TMR3_IRQHandler(void) { TMR3_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @TMR3_IRQHandler() {
%1 = call i32 (...) @TMR3_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @TMR3_IRQHandler() {
%1 = tail call i32 (...) @TMR3_DriverIRQHandler()
ret void
}
char *add_signed(char *base, signed long offset) { return base + offset; }


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

x86 assembly (clang, -O2):
<add_signed>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i8* @add_signed(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = getelementptr inbounds i8, i8* %5, i64 %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @add_signed(i8* readnone %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ksubWinProbs();
int main(void) {
  ksubWinProbs();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ksubWinProbs()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pasm_parse();
void parse(void) { pasm_parse(); }


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

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

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

LLVM IR (-O2):
define void @parse() {
%1 = tail call i32 (...) @pasm_parse()
ret void
}