xunge/DecIR huggingface dataset:
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void GPIO_setOutputEnableMultiDio(uint32_t dioMask,
                                  uint32_t bitVectoredOutputEnable) {
  ;
  (*((volatile unsigned long *)(0x40022000 + 0x000000D0))) =
      ((*((volatile unsigned long *)(0x40022000 + 0x000000D0))) & ~dioMask) |
      (bitVectoredOutputEnable & dioMask);
}


x86 assembly (clang, -O0):
<GPIO_setOutputEnableMultiDio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400220d0,%eax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
and    %rdx,%rax
or     %rax,%rcx
mov    $0x400220d0,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_setOutputEnableMultiDio>:
mov    %rdi,-0x10(%rsp)
mov    %rsi,-0x8(%rsp)
mov    0x400220d0,%rax
40
mov    -0x10(%rsp),%rcx
not    %rcx
and    %rax,%rcx
mov    -0x8(%rsp),%rax
and    -0x10(%rsp),%rax
or     %rcx,%rax
mov    %rax,0x400220d0
40
ret

LLVM IR (-O0):
define void @GPIO_setOutputEnableMultiDio(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* inttoptr (i64 1073881296 to i64*)
%6 = load volatile i64, i64* %3
%7 = xor i64 %6, -1
%8 = and i64 %5, %7
%9 = load volatile i64, i64* %4
%10 = load volatile i64, i64* %3
%11 = and i64 %9, %10
%12 = or i64 %8, %11
store volatile i64 %12, i64* inttoptr (i64 1073881296 to i64*)
ret void
}

LLVM IR (-O2):
define void @GPIO_setOutputEnableMultiDio(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* inttoptr (i64 1073881296 to i64*)
%6 = load volatile i64, i64* %3
%7 = xor i64 %6, -1
%8 = and i64 %5, %7
%9 = load volatile i64, i64* %4
%10 = load volatile i64, i64* %3
%11 = and i64 %10, %9
%12 = or i64 %11, %8
store volatile i64 %12, i64* inttoptr (i64 1073881296 to i64*)
ret void
}
/* Type definitions */
struct in_addr {
  unsigned int s_addr;
};

/* Variables and functions */
struct in_addr hash2ip(void *ip) {
  struct in_addr addr;
  addr.s_addr = *(unsigned int *)ip;
  return addr;
}


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

x86 assembly (clang, -O2):
<hash2ip>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @hash2ip(i8* %0) {
%2 = alloca %struct.in_addr
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @hash2ip(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int test_imm_3Buint16_reg(unsigned short val) {
  return ((val) & (0x3B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Buint16_reg>:
test   $0x3b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_3Buint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 59
%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_3Buint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 59
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t SysCtlResetCauseGet(void) {
  return ((*((volatile uint32_t *)(0x400FE05C))));
}


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

x86 assembly (clang, -O2):
<SysCtlResetCauseGet>:
mov    0x400fe05c,%eax
ret

LLVM IR (-O0):
define i32 @SysCtlResetCauseGet() {
%1 = load volatile i32, i32* inttoptr (i64 1074782300 to i32*)
ret i32 %1
}

LLVM IR (-O2):
define i32 @SysCtlResetCauseGet() {
%1 = load volatile i32, i32* inttoptr (i64 1074782300 to i32*)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float pi = 3.141592;
  printf("%f\n", pi);
  float thousand = 0.1e4;
  printf("%f\n", thousand);
  thousand = 1e4;
  printf("%f\n", thousand);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
movss  0xe9d(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef4(%rip),%rbx
movss  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xed4(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xec8(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0x400921FB00000000, float* %2
%4 = load float, float* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %4)
store float 1.000000e+03, float* %3
%6 = load float, float* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %6)
store float 1.000000e+04, float* %3
%8 = load float, float* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 0x400921FB00000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 1.000000e+03)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float 1.000000e+04)
ret i32 0
}
__attribute__((always_)) void tracing_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @tracing_stop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char str[5];
  gets(str);
  puts(str);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x9(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x9(%rbp),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xb(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%6 = call i32 @puts(i8* %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @puts(i8* %2)
%5 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
float sqrt(float const);
float glmComputeVectorLength2f(const float v[2]) {
  return sqrt(v[0] * v[0] + v[1] * v[1]);
}


x86 assembly (clang, -O0):
<glmComputeVectorLength2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeVectorLength2f>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1132 <glmComputeVectorLength2f+0x22>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @glmComputeVectorLength2f(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = call float @sqrt(float %16)
ret float %17
}

LLVM IR (-O2):
define float @glmComputeVectorLength2f(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = tail call float @sqrt(float %6)
ret float %7
}
int do_329() { return 329; }


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

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

LLVM IR (-O0):
define i32 @do_329() {
ret i32 329
}

LLVM IR (-O2):
define i32 @do_329() {
ret i32 329
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void h_betting() {
  printf("\tEnter the number of tricks you think you and your partner can make "
         "this hand.\n");
  printf("\tEarning more tricks than your bet adds the number of tricks you "
         "took to your score plus a two point bonus.\n");
  printf("\tFailing to beat your bet means your bet is subtracted from your "
         "team's score.\n");
  printf("\tTo call a loner or shooter, enter 24.\n");
}


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

x86 assembly (clang, -O2):
<h_betting>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf8b(%rip),%rdi
call   1030 <puts@plt>
lea    0xfce(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [80 x i8] c"\09Enter the number of tricks you think you and your partner can make this hand.\0A\00"
@.str.1 = [109 x i8] c"\09Earning more tricks than your bet adds the number of tricks you took to your score plus a two point bonus.\0A\00"
@.str.2 = [80 x i8] c"\09Failing to beat your bet means your bet is subtracted from your team's score.\0A\00"
@.str.3 = [40 x i8] c"\09To call a loner or shooter, enter 24.\0A\00"
define void @h_betting() {
%1 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [79 x i8] c"\09Enter the number of tricks you think you and your partner can make this hand.\00"
@str.4 = [108 x i8] c"\09Earning more tricks than your bet adds the number of tricks you took to your score plus a two point bonus.\00"
@str.5 = [79 x i8] c"\09Failing to beat your bet means your bet is subtracted from your team's score.\00"
@str.6 = [39 x i8] c"\09To call a loner or shooter, enter 24.\00"
define void @h_betting() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort_crypto_lib(char *);
int /*<<< orphan*/ is_private_key(struct item *);
void check_is_private_key(struct item *item) {
  if (!is_private_key(item))
    abort_crypto_lib("Presented item is not a private key");
}


x86 assembly (clang, -O0):
<check_is_private_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_private_key@plt>
cmp    $0x0,%eax
jne    114a <check_is_private_key+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <abort_crypto_lib@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_is_private_key>:
push   %rax
call   1030 <is_private_key@plt>
test   %eax,%eax
je     112c <check_is_private_key+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <abort_crypto_lib@plt>

LLVM IR (-O0):
%struct.item = type { i32 }
@.str = [36 x i8] c"Presented item is not a private key\00"
define void @check_is_private_key(%struct.item* %0) {
%2 = alloca %struct.item*
store %struct.item* %0, %struct.item** %2
%3 = load %struct.item*, %struct.item** %2
%4 = call i32 @is_private_key(%struct.item* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @abort_crypto_lib(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.item = type { i32 }
@.str = [36 x i8] c"Presented item is not a private key\00"
define void @check_is_private_key(%struct.item* %0) {
%2 = tail call i32 @is_private_key(%struct.item* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @abort_crypto_lib(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(int argc, char **arg) {
  printf("Usage : %s FILENAME\n\n", arg[0]);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    (%rsi),%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Usage : %s FILENAME\0A\0A\00"
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"Usage : %s FILENAME\0A\0A\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int syscall(int, char const *, char const **, char const **);
int execve(const char *path, const char **argv, const char **envp) {
  return syscall(11, path, argv, envp);
}


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

x86 assembly (clang, -O2):
<execve>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xb,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @execve(i8* %0, i8** %1, i8** %2) {
%4 = tail call i32 @syscall(i32 11, i8* %0, i8** %1, i8** %2)
ret i32 %4
}
void libart_preinit(void *app, void *modinfo) {}


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

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

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

LLVM IR (-O2):
define void @libart_preinit(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void gtk_tool_item_get_visible_vertical() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_item_get_visible_vertical() {
ret void
}
/* Variables and functions */
void g5_set_xmjMC(int /*<<< orphan*/, int, int, double **, double *);
void g5_set_xmj(int adr, int nj, double (*xj)[3], double *mj) {
  return g5_set_xmjMC(0, adr, nj, xj, mj);
}


x86 assembly (clang, -O0):
<g5_set_xmj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
xor    %edi,%edi
call   1030 <g5_set_xmjMC@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g5_set_xmj>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <g5_set_xmjMC@plt>

LLVM IR (-O0):
define void @g5_set_xmj(i32 %0, i32 %1, [3 x double]* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca [3 x double]*
%8 = alloca double*
store i32 %0, i32* %5
store i32 %1, i32* %6
store [3 x double]* %2, [3 x double]** %7
store double* %3, double** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load [3 x double]*, [3 x double]** %7
%12 = bitcast [3 x double]* %11 to double**
%13 = load double*, double** %8
ret void
}

LLVM IR (-O2):
define void @g5_set_xmj(i32 %0, i32 %1, [3 x double]* %2, double* %3) {
%5 = bitcast [3 x double]* %2 to double**
tail call void @g5_set_xmjMC(i32 0, i32 %0, i32 %1, double** %5, double* %3)
ret void
}
void wcnss_wlan_crypto_free_ablkcipher(void *tfm) {}


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

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

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

LLVM IR (-O2):
define void @wcnss_wlan_crypto_free_ablkcipher(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int atoi(char *);
int _atoi(char *_var, int _default) { return _var ? atoi(_var) : _default; }


x86 assembly (clang, -O0):
<_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113b <_atoi+0x2b>
mov    -0x8(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x10(%rbp)
jmp    1141 <_atoi+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_atoi>:
test   %rdi,%rdi
je     111a <_atoi+0xa>
jmp    1030 <atoi@plt>
mov    %esi,%eax
ret

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

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

/* Variables and functions */
void SHAREMIND_MAP_KEY_FREE_uint_fast16_t(uint_fast16_t *const dest) {
  (void)dest;
}


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

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

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

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_uint_fast16_t(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int my_getline(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  int length;
  char line[500];
  while ((length = my_getline(line)) != 0) {
    if (length >= 80)
      puts(line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x200(%rbp),%rdi
call   1040 <my_getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1165 <main+0x45>
cmpl   $0x50,-0x8(%rbp)
jl     1160 <main+0x40>
lea    -0x200(%rbp),%rdi
call   1030 <puts@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x200,%rsp
mov    %rsp,%rdi
call   1040 <my_getline@plt>
test   %eax,%eax
je     115b <main+0x3b>
mov    %rsp,%rbx
jmp    114c <main+0x2c>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <my_getline@plt>
test   %eax,%eax
je     115b <main+0x3b>
cmp    $0x50,%eax
jl     1140 <main+0x20>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [500 x i8]
%2 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%3 = call i32 @my_getline(i8* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp sgt i32 %6, 79
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @puts(i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @my_getline(i8* %2)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %10, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ activationDeallocatorOutput();
void activationDeallocator() { activationDeallocatorOutput(); }


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

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

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

LLVM IR (-O2):
define void @activationDeallocator() {
%1 = tail call i32 (...) @activationDeallocatorOutput()
ret void
}
double factorial(double n) { return n <= 1 ? 1 : n * factorial(n - 1); }


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     1142 <factorial+0x32>
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1173 <factorial+0x63>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea7(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <factorial@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %rax
movapd %xmm0,%xmm1
movsd  0xee3(%rip),%xmm0
ucomisd %xmm1,%xmm0
jae    113e <factorial+0x2e>
movsd  0xedd(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <factorial@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @factorial(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ole double %3, 1.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %12
6: ; preds = %1
%7 = load double, double* %2
%8 = load double, double* %2
%9 = fsub double %8, 1.000000e+00
%10 = call double @factorial(double %9)
%11 = fmul double %7, %10
br label %12
12: ; preds = %6, %5
%13 = phi double [ 1.000000e+00, %5 ], [ %11, %6 ]
ret double %13
}

LLVM IR (-O2):
define double @factorial(double %0) {
%2 = fcmp ugt double %0, 1.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1, %5
%4 = phi double [ %8, %5 ], [ 1.000000e+00, %1 ]
ret double %4
5: ; preds = %1
%6 = fadd double %0, -1.000000e+00
%7 = tail call double @factorial(double %6)
%8 = fmul double %7, %0
br label %3
}
extern double d1d2n1n2(double d1, double d2, int n1, int n2) {
  return d1 + d2 + n1 + n2;
}


x86 assembly (clang, -O0):
<d1d2n1n2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d1d2n1n2>:
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %esi,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @d1d2n1n2(double %0, double %1, i32 %2, i32 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store double %0, double* %5
store double %1, double* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = fadd double %9, %10
%12 = load i32, i32* %7
%13 = sitofp i32 %12 to double
%14 = fadd double %11, %13
%15 = load i32, i32* %8
%16 = sitofp i32 %15 to double
%17 = fadd double %14, %16
ret double %17
}

LLVM IR (-O2):
define double @d1d2n1n2(double %0, double %1, i32 %2, i32 %3) {
%5 = fadd double %0, %1
%6 = sitofp i32 %2 to double
%7 = fadd double %5, %6
%8 = sitofp i32 %3 to double
%9 = fadd double %7, %8
ret double %9
}
/* Type definitions */
struct Queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Q_empty(struct Queue *);
int /*<<< orphan*/ Q_get(struct Queue *);
void Q_destroy(struct Queue *q) {
  while (!Q_empty(q))
    Q_get(q);
}


x86 assembly (clang, -O0):
<Q_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Q_empty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114a <Q_destroy+0x2a>
jmp    1158 <Q_destroy+0x38>
mov    -0x8(%rbp),%rdi
call   1040 <Q_get@plt>
jmp    112c <Q_destroy+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_destroy>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <Q_empty@plt>
test   %eax,%eax
jne    1146 <Q_destroy+0x26>
mov    %rbx,%rdi
call   1040 <Q_get@plt>
mov    %rbx,%rdi
jmp    1130 <Q_destroy+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.Queue = type { i32 }
define void @Q_destroy(%struct.Queue* %0) {
%2 = tail call i32 @Q_empty(%struct.Queue* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = tail call i32 @Q_get(%struct.Queue* %0)
%6 = tail call i32 @Q_empty(%struct.Queue* %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UART4_Write(char);
void PrintHandler(char c) { UART4_Write(c); }


x86 assembly (clang, -O0):
<PrintHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <UART4_Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHandler>:
jmp    1030 <UART4_Write@plt>

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

LLVM IR (-O2):
define void @PrintHandler(i8 signext %0) {
%2 = tail call i32 @UART4_Write(i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void quit(int signum) {
  printf("Closing remote control daemon...\n");
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Closing remote control daemon...\0A\00"
define void @quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [33 x i8] c"Closing remote control daemon...\00"
define void @quit(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int gob_encode_unsigned_long_long(char *, size_t, int);
int gob_encode_boolean(char *buf, size_t buf_size, int b) {
  return gob_encode_unsigned_long_long(buf, buf_size, b != 0);
}


x86 assembly (clang, -O0):
<gob_encode_boolean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
cmpl   $0x0,-0x14(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edx
call   1030 <gob_encode_unsigned_long_long@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gob_encode_boolean>:
xor    %eax,%eax
test   %edx,%edx
setne  %al
mov    %eax,%edx
jmp    1030 <gob_encode_unsigned_long_long@plt>

LLVM IR (-O0):
define i32 @gob_encode_boolean(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @gob_encode_unsigned_long_long(i8* %7, i64 %8, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @gob_encode_boolean(i8* %0, i64 %1, i32 %2) {
%4 = icmp ne i32 %2, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @gob_encode_unsigned_long_long(i8* %0, i64 %1, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fail_test(int);
scalar_t__ run(char *);
void test_load() {
  do {
    if (run("test/progs/"
            "load_basic.b"))
      fail_test(95);
    ;
  } while (0);
  do {
    if (!run("test/progs/"
             "load_unknown_var_err.b"))
      fail_test(96);
    ;
  } while (0);
}


x86 assembly (clang, -O0):
<test_load>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test_load+0x9>
lea    0xed0(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
je     1149 <test_load+0x29>
mov    $0x5f,%edi
call   1030 <fail_test@plt>
jmp    114e <test_load+0x2e>
jmp    1153 <test_load+0x33>
lea    0xebe(%rip),%rdi
call   1040 <run@plt>
cmp    $0x0,%rax
jne    1173 <test_load+0x53>
mov    $0x60,%edi
call   1030 <fail_test@plt>
jmp    1178 <test_load+0x58>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_load>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     113c <test_load+0x1c>
mov    $0x5f,%edi
call   1030 <fail_test@plt>
lea    0xed5(%rip),%rdi
call   1040 <run@plt>
test   %rax,%rax
je     114f <test_load+0x2f>
pop    %rax
ret
mov    $0x60,%edi
pop    %rax
jmp    1030 <fail_test@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"test/progs/load_basic.b\00"
@.str.1 = [34 x i8] c"test/progs/load_unknown_var_err.b\00"
define void @test_load() {
br label %1
1: ; preds = %0
%2 = call i64 @run(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 @fail_test(i32 95)
br label %6
6: ; preds = %4, %1
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
%9 = call i64 @run(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = call i32 @fail_test(i32 96)
br label %13
13: ; preds = %11, %8
br label %14
14: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"test/progs/load_basic.b\00"
@.str.1 = [34 x i8] c"test/progs/load_unknown_var_err.b\00"
define void @test_load() {
%1 = tail call i64 @run(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @fail_test(i32 95)
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @run(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @fail_test(i32 96)
br label %10
10: ; preds = %5, %8
ret void
}
/* Variables and functions */
size_t ssat_mul(size_t a, size_t b) {
  size_t c;
  if (a == 0 || b == 0)
    return 0;
  if (a > (((size_t)(-1)) / b))
    return ((size_t)(-1));
  else
    return a * b;
}


x86 assembly (clang, -O0):
<ssat_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1122 <ssat_mul+0x22>
cmpq   $0x0,-0x18(%rbp)
jne    112f <ssat_mul+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    1170 <ssat_mul+0x70>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jbe    1163 <ssat_mul+0x63>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1170 <ssat_mul+0x70>
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssat_mul>:
mov    %rsi,%rcx
imul   %rdi,%rcx
mov    %rsi,%rax
mul    %rdi
mov    $0xffffffffffffffff,%rax
cmovno %rcx,%rax
test   %rsi,%rsi
cmove  %rsi,%rax
test   %rdi,%rdi
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @ssat_mul(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = icmp eq i64 %1, 0
%5 = or i1 %3, %4
%6 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %1, i64 %0)
%7 = extractvalue { i64, i1 } %6, 1
%8 = mul i64 %1, %0
%9 = select i1 %7, i64 -1, i64 %8
%10 = select i1 %5, i64 0, i64 %9
ret i64 %10
}
int func(void) { return 5; }


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

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

LLVM IR (-O0):
define i32 @func() {
ret i32 5
}

LLVM IR (-O2):
define i32 @func() {
ret i32 5
}
/* Type definitions */
struct string {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ string_append(struct string *, char *);
void string_append_char(struct string *dst, char ch) {
  char tmp[2];
  tmp[0] = ch;
  tmp[1] = '\0';
  string_append(dst, tmp);
}


x86 assembly (clang, -O0):
<string_append_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xb(%rbp)
movb   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xb(%rbp),%rsi
call   1030 <string_append@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_append_char>:
push   %rax
mov    %sil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rsi
call   1030 <string_append@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.string = type { i32 }
define void @string_append_char(%struct.string* %0, i8 signext %1) {
%3 = alloca %struct.string*
%4 = alloca i8
%5 = alloca [2 x i8]
store %struct.string* %0, %struct.string** %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 0, i8* %8
%9 = load %struct.string*, %struct.string** %3
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%11 = call i32 @string_append(%struct.string* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.string = type { i32 }
define void @string_append_char(%struct.string* %0, i8 signext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %5
%6 = call i32 @string_append(%struct.string* %0, i8* %4)
ret void
}
float test_powf(float x, float y) { return __builtin_powf(x, y); }


x86 assembly (clang, -O0):
<test_powf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <powf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_powf>:
jmp    1030 <powf@plt>

LLVM IR (-O0):
define float @test_powf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @powf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @test_powf(float %0, float %1) {
%3 = tail call float @powf(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hiroshima University\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [22 x i8] c"Hiroshima University\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"Hiroshima University\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int run_ffts();
int benchmarkRun() { return run_ffts(); }


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

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

LLVM IR (-O0):
define i32 @benchmarkRun() {
%1 = call i32 (...) @run_ffts()
ret i32 %1
}

LLVM IR (-O2):
define i32 @benchmarkRun() {
%1 = tail call i32 (...) @run_ffts()
ret i32 %1
}
/* Variables and functions */
bool __leapp(unsigned int y) {
  return y % 4 == 0 && (y % 100 != 0 || y % 400 == 0);
}


x86 assembly (clang, -O0):
<__leapp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1150 <__leapp+0x50>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114a <__leapp+0x4a>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__leapp>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <__leapp+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <__leapp+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @__leapp(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = urem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = urem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ ins_sort(int *, int *);
int /*<<< orphan*/ quicksort_r(int *, int, int);
void quicksort1(int list[], int left, int right) {
  quicksort_r(list, left, right - 1);
  ins_sort(list, list + right - 1);
}


x86 assembly (clang, -O0):
<quicksort1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
call   1030 <quicksort_r@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
add    $0xfffffffffffffffc,%rsi
call   1040 <ins_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort1>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rdi,%rbx
lea    -0x1(%r14),%edx
call   1030 <quicksort_r@plt>
movslq %r14d,%rax
lea    (%rbx,%rax,4),%rsi
add    $0xfffffffffffffffc,%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ins_sort@plt>

LLVM IR (-O0):
define void @quicksort1(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* %5
%9 = load i32, i32* %6
%10 = sub nsw i32 %9, 1
%11 = call i32 @quicksort_r(i32* %7, i32 %8, i32 %10)
%12 = load i32*, i32** %4
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = getelementptr inbounds i32, i32* %16, i64 -1
%18 = call i32 @ins_sort(i32* %12, i32* %17)
ret void
}

LLVM IR (-O2):
define void @quicksort1(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = tail call i32 @quicksort_r(i32* %0, i32 %1, i32 %4)
%6 = sext i32 %2 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = getelementptr inbounds i32, i32* %7, i64 -1
%9 = tail call i32 @ins_sort(i32* %0, i32* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_LINES;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex3d(double, double, int /*<<< orphan*/);
void pravac() {
  double t;
  double x1 = (1.0 / 3.0) * -10.0 - 2.5;
  double x2 = (1.0 / 3.0) * 15.0 - 2.5;
  glBegin(GL_LINES);
  glVertex3d(x1, -10.0, 0);
  glVertex3d(x2, 15.0, 0);
  glEnd();
}


x86 assembly (clang, -O0):
<pravac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe9b(%rip),%xmm1
xor    %edi,%edi
call   1030 <glVertex3d@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xe7f(%rip),%xmm1
xor    %edi,%edi
call   1030 <glVertex3d@plt>
mov    $0x0,%al
call   1040 <glEnd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pravac>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
movsd  0xeb9(%rip),%xmm0
movsd  0xeb9(%rip),%xmm1
xor    %edi,%edi
call   1030 <glVertex3d@plt>
movsd  0xeb2(%rip),%xmm0
movsd  0xeb2(%rip),%xmm1
xor    %edi,%edi
call   1030 <glVertex3d@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glEnd@plt>

LLVM IR (-O0):
@GL_LINES = global i32 0
define void @pravac() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
store double 0xC017555555555555, double* %2
store double 2.500000e+00, double* %3
%4 = load i32, i32* @GL_LINES
%5 = call i32 @glBegin(i32 %4)
%6 = load double, double* %2
%7 = call i32 @glVertex3d(double %6, double -1.000000e+01, i32 0)
%8 = load double, double* %3
%9 = call i32 @glVertex3d(double %8, double 1.500000e+01, i32 0)
%10 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_LINES = global i32 0
define void @pravac() {
%1 = load i32, i32* @GL_LINES
%2 = tail call i32 @glBegin(i32 %1)
%3 = tail call i32 @glVertex3d(double 0xC017555555555555, double -1.000000e+01, i32 0)
%4 = tail call i32 @glVertex3d(double 2.500000e+00, double 1.500000e+01, i32 0)
%5 = tail call i32 (...) @glEnd()
ret void
}
int main(void) {
  float c[2] = {1.1, 2.2};
  (1 || 2 ? c[0] : 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.c = [2 x float] [float 0x3FF19999A0000000, float 0x40019999A0000000]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x float]
store i32 0, i32* %1
%3 = bitcast [2 x float]* %2 to i8*
%4 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%5 = load float, float* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}