xunge/DecIR huggingface dataset:
int isprime(int n) {
  int i;
  for (i = 2; i < n; ++i)
    if (n % 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
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ntfs_free(void *mem) { free(mem); }


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

x86 assembly (clang, -O2):
<ntfs_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ntfs_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void foo475(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo475(i32 %0) {
ret void
}
int adds2(long long x, int y) {
  long long t = x + ((long long)y << 3);
  return !!t;
}


x86 assembly (clang, -O0):
<adds2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adds2>:
movslq %esi,%rcx
shl    $0x3,%rcx
xor    %eax,%eax
add    %rdi,%rcx
setne  %al
ret

LLVM IR (-O0):
define i32 @adds2(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = shl i64 %8, 3
%10 = add nsw i64 %6, %9
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = icmp ne i64 %11, 0
%13 = xor i1 %12, true
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @adds2(i64 %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = shl nsw i64 %3, 3
%5 = sub i64 0, %0
%6 = icmp ne i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
int ZBarcode_Version() {
  if (9) {
    return (2 * 10000) + (10 * 100) + 0 * 10 + 9;
  }
  return (2 * 10000) + (10 * 100) + 0;
}


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

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

LLVM IR (-O0):
define i32 @ZBarcode_Version() {
ret i32 21009
}

LLVM IR (-O2):
define i32 @ZBarcode_Version() {
ret i32 21009
}
/* Type definitions */
struct mloop {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mloop__break_out(struct mloop *);
int /*<<< orphan*/ mloop__do_exit(struct mloop *);
__attribute__((visibility("default"))) void mloop_exit(struct mloop *self) {
  mloop__do_exit(self);
  mloop__break_out(self);
}


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

x86 assembly (clang, -O2):
<mloop_exit>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mloop__do_exit@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <mloop__break_out@plt>

LLVM IR (-O0):
%struct.mloop = type { i32 }
define void @mloop_exit(%struct.mloop* %0) {
%2 = alloca %struct.mloop*
store %struct.mloop* %0, %struct.mloop** %2
%3 = load %struct.mloop*, %struct.mloop** %2
%4 = call i32 @mloop__do_exit(%struct.mloop* %3)
%5 = load %struct.mloop*, %struct.mloop** %2
%6 = call i32 @mloop__break_out(%struct.mloop* %5)
ret void
}

LLVM IR (-O2):
%struct.mloop = type { i32 }
define void @mloop_exit(%struct.mloop* %0) {
%2 = tail call i32 @mloop__do_exit(%struct.mloop* %0)
%3 = tail call i32 @mloop__break_out(%struct.mloop* %0)
ret void
}
/* Variables and functions */
char getchar();
char *strdup(char *);
char *input_str() {
  char buffer[4096];
  int i;
  for (i = 0; (buffer[i] = getchar()) != '\n'; i++) {
  }
  buffer[i] = '\0';
  return (strdup(buffer));
}


x86 assembly (clang, -O0):
<input_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1010,%rsp
movl   $0x0,-0x1004(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
movslq -0x1004(%rbp),%rcx
mov    %al,-0x1000(%rbp,%rcx,1)
movsbl %al,%eax
cmp    $0xa,%eax
je     116f <input_str+0x4f>
jmp    115b <input_str+0x3b>
mov    -0x1004(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1004(%rbp)
jmp    1135 <input_str+0x15>
movslq -0x1004(%rbp),%rax
movb   $0x0,-0x1000(%rbp,%rax,1)
lea    -0x1000(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x1010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_str>:
push   %rbx
sub    $0x1000,%rsp
mov    $0xffffffffffffffff,%rbx
nop
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %al,0x1(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0xa,%al
jne    1130 <input_str+0x10>
mov    %ebx,%eax
movb   $0x0,(%rsp,%rax,1)
mov    %rsp,%rdi
call   1040 <strdup@plt>
add    $0x1000,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @input_str() {
%1 = alloca [4096 x i8]
%2 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = phi i64 [ %8, %3 ], [ 0, %0 ]
%5 = tail call signext i8 (...) @getchar()
%6 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 %4
store i8 %5, i8* %6
%7 = icmp eq i8 %5, 10
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = and i64 %4, 4294967295
%11 = getelementptr inbounds [4096 x i8], [4096 x i8]* %1, i64 0, i64 %10
store i8 0, i8* %11
%12 = call i8* @strdup(i8* %2)
ret i8* %12
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void I2CSlaveEnable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000020))) |= 0x00000020;
  (*((volatile uint32_t *)(ui32Base + 0x00000804))) = 0x00000001;
}


x86 assembly (clang, -O0):
<I2CSlaveEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%eax
cltq
mov    (%rax),%ecx
or     $0x20,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x804,%eax
cltq
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveEnable>:
movslq %edi,%rax
orl    $0x20,0x20(%rax)
movl   $0x1,0x804(%rax)
ret

LLVM IR (-O0):
define void @I2CSlaveEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 32
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 32
store volatile i32 %8, i32* %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 2052
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 1, i32* %12
ret void
}

LLVM IR (-O2):
define void @I2CSlaveEnable(i32 %0) {
%2 = add nsw i32 %0, 32
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 32
store volatile i32 %6, i32* %4
%7 = add nsw i32 %0, 2052
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 1, i32* %9
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
int __IUSAT(int, int);
__attribute__((always_)) uint32_t __UQSAX(uint32_t x, uint32_t y) {
  int32_t r, s;
  r = __IUSAT((((x << 16) >> 16) + ((y) >> 16)), 16) & 0x0000FFFF;
  s = __IUSAT((((x) >> 16) - ((y << 16) >> 16)), 16) & 0x0000FFFF;
  return ((s << 16) | (r));
}


x86 assembly (clang, -O0):
<__UQSAX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x10,%edi
sar    $0x10,%edi
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
add    %eax,%edi
mov    $0x10,%esi
call   1030 <__IUSAT@plt>
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
sar    $0x10,%eax
sub    %eax,%edi
mov    $0x10,%esi
call   1030 <__IUSAT@plt>
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__UQSAX>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
movswl %bp,%eax
mov    %esi,%edi
sar    $0x10,%edi
add    %eax,%edi
mov    $0x10,%esi
call   1030 <__IUSAT@plt>
movzwl %ax,%r14d
sar    $0x10,%ebp
movswl %bx,%eax
sub    %eax,%ebp
mov    %ebp,%edi
mov    $0x10,%esi
call   1030 <__IUSAT@plt>
shl    $0x10,%eax
or     %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__UQSAX(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
%7 = load i32, i32* %3
%8 = shl i32 %7, 16
%9 = ashr i32 %8, 16
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = add nsw i32 %9, %11
%13 = call i32 @__IUSAT(i32 %12, i32 16)
%14 = and i32 %13, 65535
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = ashr i32 %15, 16
%17 = load i32, i32* %4
%18 = shl i32 %17, 16
%19 = ashr i32 %18, 16
%20 = sub nsw i32 %16, %19
%21 = call i32 @__IUSAT(i32 %20, i32 16)
%22 = and i32 %21, 65535
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = shl i32 %23, 16
%25 = load i32, i32* %5
%26 = or i32 %24, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @__UQSAX(i32 %0, i32 %1) {
%3 = shl i32 %0, 16
%4 = ashr exact i32 %3, 16
%5 = ashr i32 %1, 16
%6 = add nsw i32 %4, %5
%7 = tail call i32 @__IUSAT(i32 %6, i32 16)
%8 = and i32 %7, 65535
%9 = ashr i32 %0, 16
%10 = shl i32 %1, 16
%11 = ashr exact i32 %10, 16
%12 = sub nsw i32 %9, %11
%13 = tail call i32 @__IUSAT(i32 %12, i32 16)
%14 = shl i32 %13, 16
%15 = or i32 %14, %8
ret i32 %15
}
void foo(void) {
  int i;
#pragma acc host_data use_device(i)
  {}
}


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

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
int test_imm_35int16_reg(short val) {
  return ((val) & (-0x35 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_35int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -53
%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_35int16_reg(i16 signext %0) {
%2 = and i16 %0, -53
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int evl_checkBufSpace(size_t buf_maxlen, size_t occupied_len, size_t add_len) {
  int bytesLeft = (int)buf_maxlen - (int)occupied_len - (int)add_len;
  if (bytesLeft < 0) {
    return 205;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<evl_checkBufSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %ecx,%eax
mov    -0x20(%rbp),%rcx
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1139 <evl_checkBufSpace+0x39>
movl   $0xcd,-0x4(%rbp)
jmp    1140 <evl_checkBufSpace+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<evl_checkBufSpace>:
mov    %rdi,%rax
add    %esi,%edx
sub    %edx,%eax
sar    $0x1f,%eax
and    $0xcd,%eax
ret

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

LLVM IR (-O2):
define i32 @evl_checkBufSpace(i64 %0, i64 %1, i64 %2) {
%4 = trunc i64 %0 to i32
%5 = trunc i64 %1 to i32
%6 = trunc i64 %2 to i32
%7 = add i32 %5, %6
%8 = sub i32 %4, %7
%9 = icmp slt i32 %8, 0
%10 = select i1 %9, i32 205, i32 0
ret i32 %10
}
void av_tea_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_tea_alloc() {
ret void
}
unsigned short local_to_vax_short_(const unsigned short *s) { return *s; }


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

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

LLVM IR (-O0):
define zeroext i16 @local_to_vax_short_(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @local_to_vax_short_(i16* nocapture %0) {
%2 = load i16, i16* %0
ret i16 %2
}
void swab2(char *b, int n) {
  char *e, p;
  for (e = b + n; b < e; b++) {
    p = *b;
    *b = b[1];
    *++b = p;
  }
}


x86 assembly (clang, -O0):
<swab2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1164 <swab2+0x64>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x19(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111a <swab2+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<swab2>:
test   %esi,%esi
jle    111d <swab2+0x1d>
movslq %esi,%rax
add    %rdi,%rax
nopw   0x0(%rax,%rax,1)
rolw   $0x8,(%rdi)
add    $0x2,%rdi
cmp    %rax,%rdi
jb     1110 <swab2+0x10>
ret

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

LLVM IR (-O2):
define void @swab2(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %13
6: ; preds = %2, %6
%7 = phi i8* [ %11, %6 ], [ %0, %2 ]
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
store i8 %10, i8* %7
store i8 %8, i8* %9
%11 = getelementptr inbounds i8, i8* %7, i64 2
%12 = icmp ult i8* %11, %4
br i1 %12, label %6, label %13
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ decbin(int *, int *, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  int a[] = {2, 2};
  int size = sizeof(a) / sizeof(a[0]);
  int res[100] = {0};
  decbin(a, res, size);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
lea    -0x1b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1040 <memset@plt>
lea    -0x18(%rbp),%rdi
lea    -0x1b0(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1050 <decbin@plt>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1a0,%rsp
movabs $0x200000002,%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rbx
mov    $0x190,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1050 <decbin@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [2 x i32] [i32 2, i32 2]
@.str = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32]
%7 = alloca i32
%8 = alloca [100 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [2 x i32]* %6 to i8*
store i32 2, i32* %7
%10 = bitcast [100 x i32]* %8 to i8*
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %8, i64 0, i64 0
%13 = load i32, i32* %7
%14 = call i32 @decbin(i32* %11, i32* %12, i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = alloca [100 x i32]
%5 = bitcast i64* %3 to i8*
store i64 8589934594, i64* %3
%6 = bitcast [100 x i32]* %4 to i8*
%7 = bitcast i64* %3 to i32*
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%9 = call i32 @decbin(i32* %7, i32* %8, i32 2)
%10 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int fptr_capi20_release(unsigned int);
scalar_t__ loadlib();
unsigned capi20_release(unsigned ApplID) {
  if (loadlib() < 0)
    return 0x1009;
  return fptr_capi20_release(ApplID);
}


x86 assembly (clang, -O0):
<capi20_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <loadlib@plt>
cmp    $0x0,%rax
jge    1148 <capi20_release+0x28>
movl   $0x1009,-0x4(%rbp)
jmp    1153 <capi20_release+0x33>
mov    -0x8(%rbp),%edi
call   1040 <fptr_capi20_release@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capi20_release>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <loadlib@plt>
test   %rax,%rax
js     1137 <capi20_release+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <fptr_capi20_release@plt>
mov    $0x1009,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @capi20_release(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 (...) @loadlib()
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 4105, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @fptr_capi20_release(i32 %8)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @capi20_release(i32 %0) {
%2 = tail call i64 (...) @loadlib()
%3 = icmp slt i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fptr_capi20_release(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 4105, %1 ]
ret i32 %7
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
int strbuf_add(struct strbuf *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int strbuf_addstr(struct strbuf *sb, const char *s) {
  return strbuf_add(sb, s, strlen(s));
}


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

x86 assembly (clang, -O2):
<strbuf_addstr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strbuf_add@plt>

LLVM IR (-O0):
%struct.strbuf = type { i32 }
define i32 @strbuf_addstr(%struct.strbuf* %0, i8* %1) {
%3 = alloca %struct.strbuf*
%4 = alloca i8*
store %struct.strbuf* %0, %struct.strbuf** %3
store i8* %1, i8** %4
%5 = load %struct.strbuf*, %struct.strbuf** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strbuf_add(%struct.strbuf* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define i32 @strbuf_addstr(%struct.strbuf* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strbuf_add(%struct.strbuf* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
size_t strlen(char *);
char *trimr(char *s) {
  size_t len = strlen(s);
  if (len && s[len - 1] == '\n') {
    s[len - 1] = '\0';
  }
  return s;
}


x86 assembly (clang, -O0):
<trimr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115d <trimr+0x4d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    115d <trimr+0x4d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trimr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
je     112a <trimr+0x1a>
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    112a <trimr+0x1a>
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @trimr(i8* returned %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = add i64 %2, -1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %4
store i8 0, i8* %6
br label %10
10: ; preds = %9, %4, %1
ret i8* %0
}
char ConditionTrue(void) { return 1; }


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

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

LLVM IR (-O0):
define signext i8 @ConditionTrue() {
ret i8 1
}

LLVM IR (-O2):
define signext i8 @ConditionTrue() {
ret i8 1
}
int fibo(int n) {
  if (n == 0)
    return 0;
  else if (n == 1)
    return 1;
  else
    return fibo(n - 1) + fibo(n - 2);
}


x86 assembly (clang, -O0):
<fibo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fibo+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fibo+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fibo+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fibo+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibo@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibo>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fibo+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibo@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fibo+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibo(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fibo(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int getipv4sourcefilter(int s, struct in_addr interface, struct in_addr group,
                        uint32_t *fmode, uint32_t *numsrc,
                        struct in_addr *slist) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<getipv4sourcefilter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %esi,-0x8(%rbp)
mov    %edx,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@ENOSYS = global i32 0
define i32 @getipv4sourcefilter(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, %struct.in_addr* %5) {
%7 = alloca %struct.in_addr
%8 = alloca %struct.in_addr
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca %struct.in_addr*
%13 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %7, i32 0, i32 0
store i32 %1, i32* %13
%14 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %8, i32 0, i32 0
store i32 %2, i32* %14
store i32 %0, i32* %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store %struct.in_addr* %5, %struct.in_addr** %12
%15 = load i32, i32* @ENOSYS
%16 = call i32 @__set_errno(i32 %15)
ret i32 -1
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@ENOSYS = global i32 0
define i32 @getipv4sourcefilter(i32 %0, i32 %1, i32 %2, i32* nocapture readnone %3, i32* nocapture readnone %4, %struct.in_addr* nocapture readnone %5) {
%7 = load i32, i32* @ENOSYS
%8 = tail call i32 @__set_errno(i32 %7)
ret i32 -1
}
void nop(struct PCFState *st, struct PCFOP *op) {}


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

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

LLVM IR (-O0):
%struct.PCFState = type opaque
%struct.PCFOP = type opaque
define void @nop(%struct.PCFState* %0, %struct.PCFOP* %1) {
%3 = alloca %struct.PCFState*
%4 = alloca %struct.PCFOP*
store %struct.PCFState* %0, %struct.PCFState** %3
store %struct.PCFOP* %1, %struct.PCFOP** %4
ret void
}

LLVM IR (-O2):
%struct.PCFState = type opaque
%struct.PCFOP = type opaque
define void @nop(%struct.PCFState* nocapture %0, %struct.PCFOP* nocapture %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
void _mx(int64_t *a, int64_t b) { *a = (*a > b) ? (*a) : b; }


x86 assembly (clang, -O0):
<_mx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jle    112d <_mx+0x2d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1135 <_mx+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mx>:
mov    (%rdi),%rax
cmp    %rsi,%rax
cmovg  %rax,%rsi
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @_mx(i64* nocapture %0, i64 %1) {
%3 = load i64, i64* %0
%4 = icmp sgt i64 %3, %1
%5 = select i1 %4, i64 %3, i64 %1
store i64 %5, i64* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int getpid();
void SetPidFile(char *Filename) {
  FILE *f;
  f = fopen(Filename, "w+");
  if (f) {
    fprintf(f, "%u", getpid());
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<SetPidFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1195 <SetPidFile+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xe7c(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetPidFile>:
push   %rbx
lea    0xeb8(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     1176 <SetPidFile+0x36>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xea0(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fclose@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"w+\00"
@.str.1 = [3 x i8] c"%u\00"
define void @SetPidFile(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 @fprintf(i32* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @fclose(i32* %2)
br label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *__progname(char *nargv0) {
  char *tmp = strrchr(nargv0, '/');
  if (tmp)
    tmp++;
  else
    tmp = nargv0;
  return (tmp);
}


x86 assembly (clang, -O0):
<__progname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <__progname+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1152 <__progname+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__progname>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @__progname(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
can_access(path, mode) char *path;
int mode;
{ return (access(path, mode)); }


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

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

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

LLVM IR (-O2):
define i32 @can_access(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @access to i32 (i8*, i32, ...)*)(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Big_factorial_iteration(int);
int factorial_iteration(int);
int factorial_recursion(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf(" %d \n", factorial_recursion(10));
  printf(" %d \n", factorial_iteration(10));
  Big_factorial_iteration(20);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1050 <factorial_recursion@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1060 <factorial_iteration@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
mov    $0x14,%edi
call   1030 <Big_factorial_iteration@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1050 <factorial_recursion@plt>
lea    0xeae(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1060 <factorial_iteration@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x14,%edi
call   1030 <Big_factorial_iteration@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c" %d \0A\00"
define i32 @main() {
%1 = call i32 @factorial_recursion(i32 10)
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @factorial_iteration(i32 10)
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @Big_factorial_iteration(i32 20)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c" %d \0A\00"
define i32 @main() {
%1 = tail call i32 @factorial_recursion(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @factorial_iteration(i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @Big_factorial_iteration(i32 20)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ECANCELED;
int /*<<< orphan*/ errno;
int fails(void *data) {
  errno = ECANCELED;
  return -1;
}


x86 assembly (clang, -O0):
<fails>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fails>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ECANCELED = global i32 0
@errno = global i32 0
define i32 @fails(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ECANCELED
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ECANCELED = global i32 0
@errno = global i32 0
define i32 @fails(i8* nocapture readnone %0) {
%2 = load i32, i32* @ECANCELED
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ matrix_get_scale(float *, float const, float const,
                                    float const);
int /*<<< orphan*/ matrix_multiply_ext(float const *, float *, float *);
float *matrix_scale_ext(const float matrix[4 * 4], const float x, const float y,
                        const float z, float matrix_out[4 * 4]) {
  float matrix_tmp[4 * 4];
  matrix_get_scale(matrix_tmp, x, y, z);
  matrix_multiply_ext(matrix, matrix_tmp, matrix_out);
  return matrix_out;
}


x86 assembly (clang, -O0):
<matrix_scale_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
lea    -0x60(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1030 <matrix_get_scale@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <matrix_multiply_ext@plt>
mov    -0x20(%rbp),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_scale_ext>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsp,%r15
mov    %r15,%rdi
call   1030 <matrix_get_scale@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <matrix_multiply_ext@plt>
mov    %rbx,%rax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float* @matrix_scale_ext(float* %0, float %1, float %2, float %3, float* %4) {
%6 = alloca float*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float*
%11 = alloca [16 x float]
store float* %0, float** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float* %4, float** %10
%12 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 0
%13 = load float, float* %7
%14 = load float, float* %8
%15 = load float, float* %9
%16 = call i32 @matrix_get_scale(float* %12, float %13, float %14, float %15)
%17 = load float*, float** %6
%18 = getelementptr inbounds [16 x float], [16 x float]* %11, i64 0, i64 0
%19 = load float*, float** %10
%20 = call i32 @matrix_multiply_ext(float* %17, float* %18, float* %19)
%21 = load float*, float** %10
ret float* %21
}

LLVM IR (-O2):
define float* @matrix_scale_ext(float* %0, float %1, float %2, float %3, float* returned %4) {
%6 = alloca [16 x float]
%7 = bitcast [16 x float]* %6 to i8*
%8 = getelementptr inbounds [16 x float], [16 x float]* %6, i64 0, i64 0
%9 = call i32 @matrix_get_scale(float* %8, float %1, float %2, float %3)
%10 = call i32 @matrix_multiply_ext(float* %0, float* %8, float* %4)
ret float* %4
}
void gtk_drag_dest_add_uri_targets() {}


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

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

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

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

/* Variables and functions */
scalar_t__ cmp3(void const *, void const *);
scalar_t__ cmp8(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool cmp11(const void *a, const void *b) {
  return cmp3(a, b) && cmp8((uint8_t *)a + 3, (uint8_t *)b + 3);
}


x86 assembly (clang, -O0):
<cmp11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <cmp3@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     116e <cmp11+0x4e>
mov    -0x8(%rbp),%rdi
add    $0xc,%rdi
mov    -0x10(%rbp),%rsi
add    $0xc,%rsi
call   1040 <cmp8@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp11>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <cmp3@plt>
test   %rax,%rax
je     1154 <cmp11+0x34>
add    $0xc,%rbx
add    $0xc,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <cmp8@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
jmp    1156 <cmp11+0x36>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @cmp11(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @cmp3(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 3
%16 = call i64 @cmp8(i32* %12, i32* %15)
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %9, %2
%19 = phi i1 [ false, %2 ], [ %17, %9 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @cmp11(i8* %0, i8* %1) {
%3 = tail call i64 @cmp3(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 12
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i8, i8* %1, i64 12
%9 = bitcast i8* %8 to i32*
%10 = tail call i64 @cmp8(i32* %7, i32* %9)
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %5, %2
%14 = phi i32 [ 0, %2 ], [ %12, %5 ]
ret i32 %14
}
int alock_auth_none_auth(const char *passwd) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @alock_auth_none_auth(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, Sailor!\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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [15 x i8] c"Hello, Sailor!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}