xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
ssize_t lisp_read(int fd, void *buf, size_t count) {
  return read(fd, buf, count);
}


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

x86 assembly (clang, -O2):
<lisp_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @lisp_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void av_free(void *ptr) {
  if (ptr)
    free(ptr);
}


x86 assembly (clang, -O0):
<av_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <av_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_free>:
test   %rdi,%rdi
je     111a <av_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @av_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @av_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t f00_19(uint32_t x, uint32_t y, uint32_t z) {
  return ((y ^ z) & x) ^ z;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
and    -0x4(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f00_19(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = xor i32 %7, %8
%10 = load i32, i32* %4
%11 = and i32 %9, %10
%12 = load i32, i32* %6
%13 = xor i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f00_19(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, %1
%5 = and i32 %4, %0
%6 = xor i32 %5, %2
ret i32 %6
}
void string_literal() { *((char *)"hello") = 0; }


x86 assembly (clang, -O0):
<string_literal>:
push   %rbp
mov    %rsp,%rbp
movb   $0x0,0xef5(%rip)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define void @string_literal() {
store i8 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
ret void
}

LLVM IR (-O2):
define void @string_literal() {
ret void
}
const char *convert_char(const char *s, void *arg) {
  char *p = (char *)arg;
  *p = *s;
  return s + 1;
}


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

x86 assembly (clang, -O2):
<convert_char>:
mov    (%rdi),%al
mov    %al,(%rsi)
lea    0x1(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @convert_char(i8* %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
store i8 %3, i8* %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %4
}
float FConvertToC(float fahrenheit) { return (fahrenheit - 32) * 5 / 9; }


x86 assembly (clang, -O0):
<FConvertToC>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xef2(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xee2(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xed2(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FConvertToC>:
addss  0xef8(%rip),%xmm0
mulss  0xef4(%rip),%xmm0
divss  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define float @FConvertToC(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 3.200000e+01
%5 = fmul float %4, 5.000000e+00
%6 = fdiv float %5, 9.000000e+00
ret float %6
}

LLVM IR (-O2):
define float @FConvertToC(float %0) {
%2 = fadd float %0, -3.200000e+01
%3 = fmul float %2, 5.000000e+00
%4 = fdiv float %3, 9.000000e+00
ret float %4
}
int test_imm_D1uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xD1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D1uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 209
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_D1uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 897648164864
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndexedXX1(int);
int /*<<< orphan*/ INC16(int /*<<< orphan*/, int);
void OpFEM0X1(void) { INC16(AbsoluteIndexedXX1(3), 0xFFFFFF); }


x86 assembly (clang, -O0):
<OpFEM0X1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <AbsoluteIndexedXX1@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <INC16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpFEM0X1>:
push   %rax
mov    $0x3,%edi
call   1030 <AbsoluteIndexedXX1@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <INC16@plt>

LLVM IR (-O0):
define void @OpFEM0X1() {
%1 = call i32 @AbsoluteIndexedXX1(i32 3)
%2 = call i32 @INC16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @OpFEM0X1() {
%1 = tail call i32 @AbsoluteIndexedXX1(i32 3)
%2 = tail call i32 @INC16(i32 %1, i32 16777215)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void wcsulexfree(void *ptr) { free((char *)ptr); }


x86 assembly (clang, -O0):
<wcsulexfree>:
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):
<wcsulexfree>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @wcsulexfree(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 @wcsulexfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t letohl(uint32_t value) {
  return (((uint32_t)((uint8_t *)&value)[3]) << 24) |
         (((uint32_t)((uint8_t *)&value)[2]) << 16) |
         (((uint32_t)((uint8_t *)&value)[1]) << 8) |
         (((uint32_t)((uint8_t *)&value)[0]) << 0);
}


x86 assembly (clang, -O0):
<letohl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x14(%rbp),%rax
shl    $0x18,%eax
mov    0xc(%rbp),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    0x4(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%rcx
shl    $0x0,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @letohl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i64*
%4 = getelementptr inbounds i64, i64* %3, i64 3
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 24
%8 = bitcast i32* %2 to i64*
%9 = getelementptr inbounds i64, i64* %8, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = bitcast i32* %2 to i64*
%15 = getelementptr inbounds i64, i64* %14, i64 1
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = bitcast i32* %2 to i64*
%21 = getelementptr inbounds i64, i64* %20, i64 0
%22 = load i64, i64* %21
%23 = trunc i64 %22 to i32
%24 = shl i32 %23, 0
%25 = or i32 %19, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @letohl(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ close_log();
int /*<<< orphan*/ exit(int const);
void die(const int status) {
  close_log();
  exit(status);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <close_log@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <close_log@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @die(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @close_log()
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @die(i32 %0) {
%2 = tail call i32 (...) @close_log()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
const volatile int *volatile restrict const gQ(
    const volatile int *volatile restrict const i) {
  return eQ(i);
}


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

x86 assembly (clang, -O2):
<gQ>:
push   %rax
mov    %rdi,(%rsp)
mov    (%rsp),%rdi
xor    %eax,%eax
call   1030 <eQ@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i32* @gQ(i32* noalias %0) {
%2 = alloca i32*
store volatile i32* %0, i32** %2
%3 = load volatile i32*, i32** %2
%4 = call i32 (i32*, ...) bitcast (i32 (...)* @eQ to i32 (i32*, ...)*)(i32* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}

LLVM IR (-O2):
define i32* @gQ(i32* noalias %0) {
%2 = alloca i32*
store volatile i32* %0, i32** %2
%3 = load volatile i32*, i32** %2
%4 = tail call i32 (i32*, ...) bitcast (i32 (...)* @eQ to i32 (i32*, ...)*)(i32* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Enter a number: ");
  scanf("%d", &num);
  printf("%d", exact_square(num));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec7(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <exact_square@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @exact_square(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeTrace(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000002);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000001, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeTrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
mov    $0x8,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeTrace>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x1,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeTrace(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @GPIODirModeSet(i32 %5, i32 %6, i32 2)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @GPIOPadConfigSet(i32 %8, i32 %9, i32 1, i32 8)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeTrace(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 1, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _tw2_get_decode_key(char *, char *, char *, int, int);
scalar_t__ fio_read_member_key(char *, char *);
void tw2_member_key_output(char *fname) {
  char skey[1000], akey[80], akey_time[80];
  if (fio_read_member_key(fname, skey))
    _tw2_get_decode_key(skey, akey, akey_time, 4, 5);
}


x86 assembly (clang, -O0):
<tw2_member_key_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x490,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x3f0(%rbp),%rsi
call   1040 <fio_read_member_key@plt>
cmp    $0x0,%rax
je     116e <tw2_member_key_output+0x4e>
lea    -0x3f0(%rbp),%rdi
lea    -0x440(%rbp),%rsi
lea    -0x490(%rbp),%rdx
mov    $0x4,%ecx
mov    $0x5,%r8d
call   1030 <_tw2_get_decode_key@plt>
add    $0x490,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tw2_member_key_output>:
sub    $0x488,%rsp
lea    0xa0(%rsp),%rsi
call   1040 <fio_read_member_key@plt>
test   %rax,%rax
je     1159 <tw2_member_key_output+0x39>
lea    0xa0(%rsp),%rdi
lea    0x50(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x4,%ecx
mov    $0x5,%r8d
call   1030 <_tw2_get_decode_key@plt>
add    $0x488,%rsp
ret

LLVM IR (-O0):
define void @tw2_member_key_output(i8* %0) {
%2 = alloca i8*
%3 = alloca [1000 x i8]
%4 = alloca [80 x i8]
%5 = alloca [80 x i8]
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%8 = call i64 @fio_read_member_key(i8* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%14 = call i32 @_tw2_get_decode_key(i8* %11, i8* %12, i8* %13, i32 4, i32 5)
br label %15
15: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
define void @tw2_member_key_output(i8* %0) {
%2 = alloca [1000 x i8]
%3 = alloca [80 x i8]
%4 = alloca [80 x i8]
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%8 = call i64 @fio_read_member_key(i8* %0, i8* %5)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = call i32 @_tw2_get_decode_key(i8* %5, i8* %6, i8* %7, i32 4, i32 5)
br label %12
12: ; preds = %10, %1
ret void
}
/* Variables and functions */
char *base_name(char const *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strcmp(char *, char const *);
int base_name_is(const char *path, const char *str) {
  char *base;
  int result;
  base = base_name(path);
  if (!base)
    return 0;
  result = !strcmp(base, str);
  free(base);
  return result;
}


x86 assembly (clang, -O0):
<base_name_is>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <base_name@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1164 <base_name_is+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1190 <base_name_is+0x60>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base_name_is>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbp
call   1040 <base_name@plt>
test   %rax,%rax
je     1160 <base_name_is+0x30>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
call   1050 <strcmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
sete   %bpl
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    1162 <base_name_is+0x32>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @base_name_is(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i8* @base_name(i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 0, i32* %3
br label %23
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = load i8*, i8** %5
%16 = call i32 @strcmp(i8* %14, i8* %15)
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
store i32 %19, i32* %7
%20 = load i8*, i8** %6
%21 = call i32 @free(i8* %20)
%22 = load i32, i32* %7
store i32 %22, i32* %3
br label %23
23: ; preds = %13, %12
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @base_name_is(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @base_name(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* %3, i8* dereferenceable(1) %1)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @free(i8* %3)
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ %8, %5 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ experiment();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  while (n-- > 0)
    experiment();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    115f <main+0x3f>
mov    $0x0,%al
call   1030 <experiment@plt>
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x4(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x4(%rsp)
test   %eax,%eax
jle    1158 <main+0x38>
xor    %eax,%eax
call   1030 <experiment@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
store i32 %5, i32* %1
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = call i32 (...) @experiment()
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
%11 = icmp sgt i32 %9, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
long __create_module(char const *, size_t);
int errno;
unsigned long create_module(const char *name, size_t size) {
  long ret = __create_module(name, size);
  if (ret == -1 && errno > 125) {
    ret = -errno;
    errno = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<create_module>:
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 <__create_module@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0xffffffffffffffff,-0x18(%rbp)
jne    116a <create_module+0x5a>
mov    0x2e9d(%rip),%rax
cmpl   $0x7d,(%rax)
jle    116a <create_module+0x5a>
xor    %eax,%eax
mov    0x2e8b(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    0x2e7c(%rip),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_module>:
push   %rax
call   1030 <__create_module@plt>
cmp    $0xffffffffffffffff,%rax
jne    1136 <create_module+0x26>
mov    0x2ebd(%rip),%rcx
mov    (%rcx),%edx
cmp    $0x7e,%edx
jl     1136 <create_module+0x26>
movslq %edx,%rax
neg    %rax
movl   $0x0,(%rcx)
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i64 @create_module(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i64 @__create_module(i8* %6, i64 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp eq i64 %9, -1
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = icmp sgt i32 %12, 125
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* @errno
%16 = sub nsw i32 0, %15
%17 = sext i32 %16 to i64
store i64 %17, i64* %5
store i32 0, i32* @errno
br label %18
18: ; preds = %14, %11, %2
%19 = load i64, i64* %5
ret i64 %19
}

LLVM IR (-O2):
@errno = global i32 0
define i64 @create_module(i8* %0, i64 %1) {
%3 = tail call i64 @__create_module(i8* %0, i64 %1)
%4 = icmp eq i64 %3, -1
%5 = load i32, i32* @errno
%6 = icmp sgt i32 %5, 125
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = sub nsw i32 0, %5
%10 = sext i32 %9 to i64
store i32 0, i32* @errno
br label %11
11: ; preds = %8, %2
%12 = phi i64 [ %10, %8 ], [ %3, %2 ]
ret i64 %12
}
/* Variables and functions */
int mdc(int, int);
int mmc(int a, int b) {
  int formula;
  if (!b)
    return a;
  else
    formula = (a * b) / (mdc(a, b));
  return (formula);
}


x86 assembly (clang, -O0):
<mmc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <mmc+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <mmc+0x49>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <mdc@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmc>:
mov    %edi,%eax
test   %esi,%esi
je     112b <mmc+0x1b>
push   %rbx
mov    %esi,%ebx
imul   %eax,%ebx
mov    %eax,%edi
call   1030 <mdc@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @mmc(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = mul nsw i32 %1, %0
%6 = tail call i32 @mdc(i32 %0, i32 %1)
%7 = sdiv i32 %5, %6
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ %0, %2 ]
ret i32 %9
}
int int_is_between(int a, int b, int c) { return a <= c && c <= b; }


x86 assembly (clang, -O0):
<int_is_between>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     112a <int_is_between+0x2a>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_is_between>:
cmp    %edx,%edi
setle  %al
cmp    %esi,%edx
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @int_is_between(i32 %0, i32 %1, i32 %2) {
%4 = icmp sle i32 %0, %2
%5 = icmp sle i32 %2, %1
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
int test_imm_CFuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xCF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CFuint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 207
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_CFuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13565952
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((no, noclone)) int g1(int A, int B) {
  volatile int C = A & ~B;
  return C ^ ~A;
}


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
mov    %edi,%eax
not    %esi
and    %edi,%esi
mov    %esi,-0x4(%rsp)
xor    -0x4(%rsp),%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @g1(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 = xor i32 %7, -1
%9 = and i32 %6, %8
store volatile i32 %9, i32* %5
%10 = load volatile i32, i32* %5
%11 = load i32, i32* %3
%12 = xor i32 %11, -1
%13 = xor i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @g1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = xor i32 %1, -1
%6 = and i32 %5, %0
store volatile i32 %6, i32* %3
%7 = load volatile i32, i32* %3
%8 = xor i32 %7, %0
%9 = xor i32 %8, -1
ret i32 %9
}
double _itod(unsigned hi, unsigned lo) {
  double v;
  unsigned long long ll =
      ((((unsigned long long)(hi)) << 32) | (unsigned long long)((unsigned)lo));
  *((unsigned long long *)&v) = ll;
  return v;
}


x86 assembly (clang, -O0):
<_itod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x20,%rax
mov    -0x8(%rbp),%ecx
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_itod>:
shl    $0x20,%rdi
mov    %esi,%eax
or     %rdi,%rax
movq   %rax,%xmm0
ret

LLVM IR (-O0):
define double @_itod(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = shl i64 %8, 32
%10 = load i32, i32* %4
%11 = zext i32 %10 to i64
%12 = or i64 %9, %11
store i64 %12, i64* %6
%13 = load i64, i64* %6
%14 = bitcast double* %5 to i64*
store i64 %13, i64* %14
%15 = load double, double* %5
ret double %15
}

LLVM IR (-O2):
define double @_itod(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = shl nuw i64 %3, 32
%5 = zext i32 %1 to i64
%6 = or i64 %4, %5
%7 = bitcast i64 %6 to double
ret double %7
}
void initialiseStatesAndConstants(double *states, double *variables) {
  variables[0] = 1.0;
  states[0] = -2.0;
  states[1] = 0.0;
}


x86 assembly (clang, -O0):
<initialiseStatesAndConstants>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xef0(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialiseStatesAndConstants>:
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rsi)
movsd  0xeeb(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @initialiseStatesAndConstants(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
store double 1.000000e+00, double* %6
%7 = load double*, double** %3
%8 = getelementptr inbounds double, double* %7, i64 0
store double -2.000000e+00, double* %8
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 1
store double 0.000000e+00, double* %10
ret void
}

LLVM IR (-O2):
define void @initialiseStatesAndConstants(double* nocapture writeonly %0, double* nocapture writeonly %1) {
store double 1.000000e+00, double* %1
%3 = bitcast double* %0 to <2 x double>*
store <2 x double> <double -2.000000e+00, double 0.000000e+00>, <2 x double>* %3
ret void
}
int simple5(void) { char carr[5] = {1}; }


x86 assembly (clang, -O0):
<simple5>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xef1(%rip),%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.simple5.carr = [5 x i8] c"\01\00\00\00\00"
define i32 @simple5() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = bitcast [5 x i8]* %2 to i8*
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @simple5() {
ret i32 undef
}
int dummy_palettesize(int size) {
  size = size;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @dummy_palettesize(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int r, area, circum;
  printf("Enter a radius of a circle: ");
  scanf("%d", &r);
  area = (22 / 7) * r * r;
  circum = 2 * (22 / 7) * r;
  printf("Area: %d and Circumference: %d", area, circum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
imul   $0x3,-0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x6,-0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%ecx
imul   %ecx,%ecx
lea    (%rcx,%rcx,2),%esi
add    %eax,%eax
lea    (%rax,%rax,2),%edx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Enter a radius of a circle: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"Area: %d and Circumference: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = mul nsw i32 3, %7
%9 = load i32, i32* %2
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = mul nsw i32 6, %11
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Enter a radius of a circle: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"Area: %d and Circumference: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, 3
%7 = mul nsw i32 %6, %5
%8 = mul nsw i32 %5, 6
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int strlen(const char *s) {
  int n;
  for (n = 0; s[n]; n++)
    ;
  return n;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1134 <strlen+0x34>
jmp    1126 <strlen+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ link(char *, char *);
int main(void) {
  if (0 > link("see.emily.play/gnome", "arnold.layne.hard"))
    return EXIT_FAILURE;
  else
    return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xee8(%rip),%rsi
call   1030 <link@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jle    1151 <main+0x41>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <main+0x4d>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef6(%rip),%rsi
call   1030 <link@plt>
test   %rax,%rax
jns    1132 <main+0x22>
mov    0x2eb0(%rip),%rax
jmp    1139 <main+0x29>
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"see.emily.play/gnome\00"
@.str.1 = [18 x i8] c"arnold.layne.hard\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @link(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp sgt i64 0, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i32, i32* @EXIT_FAILURE
store i32 %5, i32* %1
br label %8
6: ; preds = %0
%7 = load i32, i32* @EXIT_SUCCESS
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [21 x i8] c"see.emily.play/gnome\00"
@.str.1 = [18 x i8] c"arnold.layne.hard\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 @link(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
%3 = load i32, i32* @EXIT_FAILURE
%4 = load i32, i32* @EXIT_SUCCESS
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
int bm_max(int a, int b) { return a > b ? a : b; }


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

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

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

LLVM IR (-O2):
define i32 @bm_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int do_448() { return 448; }


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

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

LLVM IR (-O0):
define i32 @do_448() {
ret i32 448
}

LLVM IR (-O2):
define i32 @do_448() {
ret i32 448
}
/* Variables and functions */
int /*<<< orphan*/ kputchar(int);
void _putchar(int c, void *arg) { kputchar(c); }


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

x86 assembly (clang, -O2):
<_putchar>:
jmp    1030 <kputchar@plt>

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

LLVM IR (-O2):
define void @_putchar(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @kputchar(i32 %0)
ret void
}
void env_csv_reset(const struct XCSF *xcsf) { (void)xcsf; }


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

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

LLVM IR (-O0):
%struct.XCSF = type opaque
define void @env_csv_reset(%struct.XCSF* %0) {
%2 = alloca %struct.XCSF*
store %struct.XCSF* %0, %struct.XCSF** %2
%3 = load %struct.XCSF*, %struct.XCSF** %2
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
define void @env_csv_reset(%struct.XCSF* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ integration(float, float, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main(void) {
  float a, b;
  float I;
  printf("Enter the lower and upper limits of integral: ");
  scanf("%f %f", &a, &b);
  printf("The result is %0.6lf.\n", integration(b, a, 10000));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mov    $0x2710,%edi
call   1030 <integration@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
mov    $0x2710,%edi
call   1030 <integration@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Enter the lower and upper limits of integral: \00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [23 x i8] c"The result is %0.6lf.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3)
%7 = load float, float* %3
%8 = load float, float* %2
%9 = call i32 @integration(float %7, float %8, i32 10000)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"Enter the lower and upper limits of integral: \00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [23 x i8] c"The result is %0.6lf.\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%7 = load float, float* %2
%8 = load float, float* %1
%9 = call i32 @integration(float %7, float %8, i32 10000)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TransformAlarmC__0__Alarm__stop();
void AlarmToTimerC__0__Alarm__stop(void) { TransformAlarmC__0__Alarm__stop(); }


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

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

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

LLVM IR (-O2):
define void @AlarmToTimerC__0__Alarm__stop() {
%1 = tail call i32 (...) @TransformAlarmC__0__Alarm__stop()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ audio_exit();
int /*<<< orphan*/ input_exit();
int /*<<< orphan*/ log_exit();
int /*<<< orphan*/ net_exit();
int /*<<< orphan*/ phys_exit();
int /*<<< orphan*/ script_exit();
int /*<<< orphan*/ video_exit();
void void_exit(void) {
  phys_exit();
  script_exit();
  net_exit();
  input_exit();
  audio_exit();
  video_exit();
  log_exit();
}


x86 assembly (clang, -O0):
<void_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <phys_exit@plt>
mov    $0x0,%al
call   1090 <script_exit@plt>
mov    $0x0,%al
call   1060 <net_exit@plt>
mov    $0x0,%al
call   1040 <input_exit@plt>
mov    $0x0,%al
call   1080 <audio_exit@plt>
mov    $0x0,%al
call   1030 <video_exit@plt>
mov    $0x0,%al
call   1070 <log_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<void_exit>:
push   %rax
xor    %eax,%eax
call   1050 <phys_exit@plt>
xor    %eax,%eax
call   1090 <script_exit@plt>
xor    %eax,%eax
call   1060 <net_exit@plt>
xor    %eax,%eax
call   1040 <input_exit@plt>
xor    %eax,%eax
call   1080 <audio_exit@plt>
xor    %eax,%eax
call   1030 <video_exit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <log_exit@plt>

LLVM IR (-O0):
define void @void_exit() {
%1 = call i32 (...) @phys_exit()
%2 = call i32 (...) @script_exit()
%3 = call i32 (...) @net_exit()
%4 = call i32 (...) @input_exit()
%5 = call i32 (...) @audio_exit()
%6 = call i32 (...) @video_exit()
%7 = call i32 (...) @log_exit()
ret void
}

LLVM IR (-O2):
define void @void_exit() {
%1 = tail call i32 (...) @phys_exit()
%2 = tail call i32 (...) @script_exit()
%3 = tail call i32 (...) @net_exit()
%4 = tail call i32 (...) @input_exit()
%5 = tail call i32 (...) @audio_exit()
%6 = tail call i32 (...) @video_exit()
%7 = tail call i32 (...) @log_exit()
ret void
}
/* Type definitions */
struct cosmos {
  int dummy;
};

/* Variables and functions */
struct cosmos *cosmos_get_db() {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.cosmos = type { i32 }
define %struct.cosmos* @cosmos_get_db() {
ret %struct.cosmos* null
}

LLVM IR (-O2):
%struct.cosmos = type { i32 }
define noalias %struct.cosmos* @cosmos_get_db() {
ret %struct.cosmos* null
}