xunge/DecIR huggingface dataset:
void CopyEDistList1(Schema, A, B) struct univStruct *Schema;
struct Course *A;
struct Course *B;
{
  AssignCourseEDistList1First(B, AccessCourseEDistList1First(A));
}


x86 assembly (clang, -O0):
<CopyEDistList1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <AccessCourseEDistList1First@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    $0x0,%al
call   1030 <AssignCourseEDistList1First@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyEDistList1>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1040 <AccessCourseEDistList1First@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <AssignCourseEDistList1First@plt>

LLVM IR (-O0):
%struct.univStruct = type opaque
%struct.Course = type opaque
define void @CopyEDistList1(%struct.univStruct* %0, %struct.Course* %1, %struct.Course* %2) {
%4 = alloca %struct.univStruct*
%5 = alloca %struct.Course*
%6 = alloca %struct.Course*
store %struct.univStruct* %0, %struct.univStruct** %4
store %struct.Course* %1, %struct.Course** %5
store %struct.Course* %2, %struct.Course** %6
%7 = load %struct.Course*, %struct.Course** %6
%8 = load %struct.Course*, %struct.Course** %5
%9 = call i32 (%struct.Course*, ...) bitcast (i32 (...)* @AccessCourseEDistList1First to i32 (%struct.Course*, ...)*)(%struct.Course* %8)
%10 = call i32 (%struct.Course*, i32, ...) bitcast (i32 (...)* @AssignCourseEDistList1First to i32 (%struct.Course*, i32, ...)*)(%struct.Course* %7, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.univStruct = type opaque
%struct.Course = type opaque
define void @CopyEDistList1(%struct.univStruct* nocapture readnone %0, %struct.Course* %1, %struct.Course* %2) {
%4 = tail call i32 (%struct.Course*, ...) bitcast (i32 (...)* @AccessCourseEDistList1First to i32 (%struct.Course*, ...)*)(%struct.Course* %1)
%5 = tail call i32 (%struct.Course*, i32, ...) bitcast (i32 (...)* @AssignCourseEDistList1First to i32 (%struct.Course*, i32, ...)*)(%struct.Course* %2, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chaz_ConfWriter_append_conf(char *, char const *,
                                               char const *);
void chaz_ConfWriter_shorten_function(const char *sym) {
  chaz_ConfWriter_append_conf("  #define %s chy_%s\n", sym, sym);
}


x86 assembly (clang, -O0):
<chaz_ConfWriter_shorten_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xed5(%rip),%rdi
call   1030 <chaz_ConfWriter_append_conf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chaz_ConfWriter_shorten_function>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
mov    %rdx,%rsi
jmp    1030 <chaz_ConfWriter_append_conf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c" #define %s chy_%s\0A\00"
define void @chaz_ConfWriter_shorten_function(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @chaz_ConfWriter_append_conf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c" #define %s chy_%s\0A\00"
define void @chaz_ConfWriter_shorten_function(i8* %0) {
%2 = tail call i32 @chaz_ConfWriter_append_conf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_remove(int, int);
void j_remove(int arg0, int arg1) { japi_remove(arg0, arg1); }


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

x86 assembly (clang, -O2):
<j_remove>:
jmp    1030 <japi_remove@plt>

LLVM IR (-O0):
define void @j_remove(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 @japi_remove(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @j_remove(i32 %0, i32 %1) {
%3 = tail call i32 @japi_remove(i32 %0, i32 %1)
ret void
}
int __attribute__((const)) lw6mat_mat2_v_index(int i_column, int j_row) {
  return i_column * 2 + j_row;
}


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

x86 assembly (clang, -O2):
<lw6mat_mat2_v_index>:
lea    (%rsi,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @lw6mat_mat2_v_index(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 = mul nsw i32 %5, 2
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @lw6mat_mat2_v_index(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int var;
  scanf("%d", &var);
  if (var % 400 != 0)
    printf("bissextile");
  else
    printf("nonbissextile");
  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    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1164 <main+0x44>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
jmp    1170 <main+0x50>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
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>
imul   $0xc28f5c29,0x4(%rsp),%eax
c2
add    $0x51eb850,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
lea    0xeb5(%rip),%rax
lea    0xeb1(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"bissextile\00"
@.str.2 = [14 x i8] c"nonbissextile\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)
%4 = load i32, i32* %2
%5 = srem i32 %4, 400
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"bissextile\00"
@.str.2 = [14 x i8] c"nonbissextile\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 = srem i32 %4, 400
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
int test_imm_A6int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xA6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A6int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 166
%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_A6int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 712964571136
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void my_func_2() { puts("hello, world!"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world!\00"
define void @my_func_2() {
%1 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello, world!\00"
define void @my_func_2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
void benchSVML512_DPTrig() {}


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

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

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

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

/* Variables and functions */
uint8_t f_scalar_2(uint8_t x) { return x; }


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

x86 assembly (clang, -O2):
<f_scalar_2>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f_scalar_2(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
void indent(int i, FILE *fl) {
  while (i--)
    putc(' ', fl);
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1146 <indent+0x36>
mov    -0x10(%rbp),%rsi
mov    $0x20,%edi
call   1030 <putc@plt>
jmp    111f <indent+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
je     1132 <indent+0x22>
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax)
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
add    $0xffffffff,%ebp
jne    1120 <indent+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @indent(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, -1
store i32 %7, i32* %3
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32*, i32** %4
%11 = call i32 @putc(i8 signext 32, i32* %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @indent(i32 %0, i32* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 @putc(i8 signext 32, i32* %1)
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ADI32BitsSet(uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val) {
  uint32_t ui32RegOffset;
  ;
  ;
  ui32RegOffset = 0x00000010;
  (*((volatile unsigned long *)(ui32Base + ui32RegOffset + (ui32Reg & 0xFC)))) =
      ui32Val;
}


x86 assembly (clang, -O0):
<ADI32BitsSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x10,-0x10(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
mov    -0x8(%rbp),%edx
and    $0xfc,%edx
add    %edx,%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADI32BitsSet>:
movslq %edx,%rax
movslq %edi,%rcx
and    $0xfc,%esi
mov    %rax,0x10(%rcx,%rsi,1)
ret

LLVM IR (-O0):
define void @ADI32BitsSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 16, i32* %7
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = load i32, i32* %4
%11 = load i32, i32* %7
%12 = add nsw i32 %10, %11
%13 = load i32, i32* %5
%14 = and i32 %13, 252
%15 = add nsw i32 %12, %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i64*
store volatile i64 %9, i64* %17
ret void
}

LLVM IR (-O2):
define void @ADI32BitsSet(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = add nsw i32 %0, 16
%6 = and i32 %1, 252
%7 = add nsw i32 %5, %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i64*
store volatile i64 %4, i64* %9
ret void
}
int pin_config_get(const char *dev_name, const char *name,
                   unsigned long *config) {
  return 0;
}


x86 assembly (clang, -O0):
<pin_config_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @pin_config_get(i8* %0, i8* %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64* %2, i64** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @pin_config_get(i8* nocapture readnone %0, i8* nocapture readnone %1, i64* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int writeInt(char *, unsigned char);
int unexportPWM(unsigned char n) {
  return writeInt("/sys/class/pwm/pwmchip0/unexport", n);
}


x86 assembly (clang, -O0):
<unexportPWM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movzbl -0x1(%rbp),%esi
call   1030 <writeInt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unexportPWM>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <writeInt@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"/sys/class/pwm/pwmchip0/unexport\00"
define i32 @unexportPWM(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @writeInt(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8 zeroext %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [33 x i8] c"/sys/class/pwm/pwmchip0/unexport\00"
define i32 @unexportPWM(i8 zeroext %0) {
%2 = tail call i32 @writeInt(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
ret i32 %2
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int connect_(int *sockfd, struct sockaddr_in *addr) {
  int ret = connect(*sockfd, (struct sockaddr *)addr, sizeof(struct sockaddr));
  if (-1 == ret) {
    perror("connect");
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<connect_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1050 <connect@plt>
mov    %eax,-0x14(%rbp)
mov    $0xffffffff,%eax
cmp    -0x14(%rbp),%eax
jne    117b <connect_+0x4b>
lea    0xe94(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connect_>:
push   %rax
mov    (%rdi),%edi
mov    $0x4,%edx
call   1050 <connect@plt>
cmp    $0xffffffff,%eax
je     1144 <connect_+0x14>
pop    %rcx
ret
lea    0xeb5(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [8 x i8] c"connect\00"
define i32 @connect_(i32* %0, %struct.sockaddr_in* %1) {
%3 = alloca i32*
%4 = alloca %struct.sockaddr_in*
%5 = alloca i32
store i32* %0, i32** %3
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%9 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%10 = call i32 @connect(i32 %7, %struct.sockaddr* %9, i32 4)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp eq i32 -1, %11
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [8 x i8] c"connect\00"
define i32 @connect_(i32* nocapture %0, %struct.sockaddr_in* %1) {
%3 = load i32, i32* %0
%4 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%5 = tail call i32 @connect(i32 %3, %struct.sockaddr* %4, i32 4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret i32 %5
}
void *malloc(unsigned s) { asm("int $0x40" ::"a"(68), "b"(12), "c"(s)); }


x86 assembly (clang, -O0):
<malloc>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x44,%eax
mov    $0xc,%ebx
int    $0x40
mov    -0x10(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc>:
push   %rbx
mov    %edi,%ecx
mov    $0x44,%eax
mov    $0xc,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @malloc(i32 %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 12, i32 %0)
ret i8* undef
}
/* Variables and functions */
int complex_abs_squared(int, int);
int check_for_bail(int real, int imag) {
  if (real > 4000 || imag > 4000) {
    return 0;
  }
  if (1600 > complex_abs_squared(real, imag)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_for_bail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xfa0,-0x8(%rbp)
jg     1138 <check_for_bail+0x28>
cmpl   $0xfa0,-0xc(%rbp)
jle    1144 <check_for_bail+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1171 <check_for_bail+0x61>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <complex_abs_squared@plt>
mov    %eax,%ecx
mov    $0x640,%eax
cmp    %ecx,%eax
jle    116a <check_for_bail+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1171 <check_for_bail+0x61>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_for_bail>:
xor    %eax,%eax
cmp    $0xfa0,%edi
jg     1139 <check_for_bail+0x29>
cmp    $0xfa0,%esi
jg     1139 <check_for_bail+0x29>
push   %rax
call   1030 <complex_abs_squared@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x640,%ecx
setge  %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @check_for_bail(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 4000
%4 = icmp sgt i32 %1, 4000
%5 = or i1 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @complex_abs_squared(i32 %0, i32 %1)
%8 = icmp sgt i32 %7, 1599
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int FD_CLOEXEC;
int /*<<< orphan*/ F_GETFD;
int /*<<< orphan*/ F_SETFD;
int fcntl(int, int /*<<< orphan*/, int);
int coe(int fd) {
  register int flags = fcntl(fd, F_GETFD, 0);
  if (flags < 0)
    return -1;
  return fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
}


x86 assembly (clang, -O0):
<coe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1147 <coe+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <coe+0x57>
mov    -0x8(%rbp),%edi
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    0x2e7b(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coe>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %eax,%eax
js     1143 <coe+0x33>
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%esi
mov    0x2ea1(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFD = global i32 0
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
define i32 @coe(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFD
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %18
11: ; preds = %1
%12 = load i32, i32* %3
%13 = load i32, i32* @F_SETFD
%14 = load i32, i32* %4
%15 = load i32, i32* @FD_CLOEXEC
%16 = or i32 %14, %15
%17 = call i32 @fcntl(i32 %12, i32 %13, i32 %16)
store i32 %17, i32* %2
br label %18
18: ; preds = %11, %10
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@F_GETFD = global i32 0
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
define i32 @coe(i32 %0) {
%2 = load i32, i32* @F_GETFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @F_SETFD
%7 = load i32, i32* @FD_CLOEXEC
%8 = or i32 %7, %3
%9 = tail call i32 @fcntl(i32 %0, i32 %6, i32 %8)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
double drand48();
void vector_init(double *A, const int N, double val) {
  int i;
  for (i = 0; i < N; ++i) {
    A[i] = val * drand48();
  }
}


x86 assembly (clang, -O0):
<vector_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116f <vector_init+0x5f>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x0,%al
call   1030 <drand48@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <vector_init+0x1b>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_init>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %esi,%esi
jle    1150 <vector_init+0x40>
movapd %xmm0,%xmm1
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
movsd  %xmm0,0x8(%rsp)
nop
xor    %eax,%eax
call   1030 <drand48@plt>
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <vector_init+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @vector_init(double* %0, i32 %1, double %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
store double %2, double* %6
store i32 0, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load double, double* %6
%14 = call double (...) @drand48()
%15 = fmul double %13, %14
%16 = load double*, double** %4
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
store double %15, double* %19
br label %20
20: ; preds = %12
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @vector_init(double* nocapture writeonly %0, i32 %1, double %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = tail call double (...) @drand48()
%10 = fmul double %9, %2
%11 = getelementptr inbounds double, double* %0, i64 %8
store double %10, double* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ coins;

/* Variables and functions */
int different_ways(int, int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int coins[] = {200, 100, 50, 20, 10, 5, 2, 1};
  int lenght = sizeof(coins) / sizeof(int);
  int money = 200;
  int answer = different_ways(money, coins, lenght);
  printf("%d\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
movl   $0xc8,-0x38(%rbp)
mov    -0x38(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%edx
call   1040 <different_ways@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0xc8,%edi
mov    $0x8,%edx
call   1040 <different_ways@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.coins = [8 x i32] [i32 200, i32 100, i32 50, i32 20, i32 10, i32 5, i32 2, i32 1]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x i32]
%4 = bitcast [8 x i32]* %3 to i8*
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%6 = call i32 @different_ways(i32 200, i32* %5, i32 8)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
double beta_ei(double x) { return 2.0E-07; }


x86 assembly (clang, -O0):
<beta_ei>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<beta_ei>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @beta_ei(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 2.000000e-07
}

LLVM IR (-O2):
define double @beta_ei(double %0) {
ret double 2.000000e-07
}
/* Variables and functions */
int /*<<< orphan*/ exit(unsigned long);
int /*<<< orphan*/ printf(char *, int, unsigned long);
__attribute__((__noreturn__)) void exitfunc15(int status, void *arg) {
  printf("Executing exitfunc"
         "15"
         " (status=%d, arg=%lu)\n",
         status, (unsigned long)arg);
  exit((unsigned long)arg);
}


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

x86 assembly (clang, -O2):
<exitfunc15>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Executing exitfunc15 (status=%d, arg=%lu)\0A\00"
define void @exitfunc15(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 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @exit(i64 %10)
unreachable
}

LLVM IR (-O2):
@.str = [43 x i8] c"Executing exitfunc15 (status=%d, arg=%lu)\0A\00"
define void @exitfunc15(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %3)
%5 = tail call i32 @exit(i64 %3)
unreachable
}
unsigned char getOddParity(unsigned char p) {
  p = p ^ (p >> 4 | p << 4);
  p = p ^ (p >> 2);
  p = p ^ (p >> 1);
  return p & 1;
}


x86 assembly (clang, -O0):
<getOddParity>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x1(%rbp),%ecx
sar    $0x4,%ecx
movzbl -0x1(%rbp),%edx
shl    $0x4,%edx
or     %edx,%ecx
xor    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x1(%rbp),%ecx
sar    $0x2,%ecx
xor    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x1(%rbp),%ecx
sar    $0x1,%ecx
xor    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getOddParity>:
mov    %edi,%eax
shr    $0x4,%al
xor    %dil,%al
mov    %eax,%ecx
shr    $0x2,%cl
xor    %al,%cl
mov    %ecx,%eax
shr    %al
xor    %cl,%al
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @getOddParity(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = ashr i32 %6, 4
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 4
%11 = or i32 %7, %10
%12 = xor i32 %4, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
%14 = load i8, i8* %2
%15 = zext i8 %14 to i32
%16 = load i8, i8* %2
%17 = zext i8 %16 to i32
%18 = ashr i32 %17, 2
%19 = xor i32 %15, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %2
%21 = load i8, i8* %2
%22 = zext i8 %21 to i32
%23 = load i8, i8* %2
%24 = zext i8 %23 to i32
%25 = ashr i32 %24, 1
%26 = xor i32 %22, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %2
%28 = load i8, i8* %2
%29 = zext i8 %28 to i32
%30 = and i32 %29, 1
%31 = trunc i32 %30 to i8
ret i8 %31
}

LLVM IR (-O2):
define zeroext i8 @getOddParity(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = xor i8 %2, %0
%4 = lshr i8 %3, 2
%5 = xor i8 %4, %3
%6 = lshr i8 %5, 1
%7 = xor i8 %6, %5
%8 = and i8 %7, 1
ret i8 %8
}
double RtoK(double R) {
  double k = (.55556 * ((R - 459.69) - 32)) + 273.15;
  return k;
}


x86 assembly (clang, -O0):
<RtoK>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xf02(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeee(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xece(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<RtoK>:
addsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @RtoK(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 4.596900e+02
%6 = fsub double %5, 3.200000e+01
%7 = call double @llvm.fmuladd.f64(double 5.555600e-01, double %6, double 2.731500e+02)
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @RtoK(double %0) {
%2 = fadd double %0, -4.596900e+02
%3 = fadd double %2, -3.200000e+01
%4 = tail call double @llvm.fmuladd.f64(double %3, double 5.555600e-01, double 2.731500e+02)
ret double %4
}
/* Variables and functions */
int fibo(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, char **argv) {
  int n = 10;
  int res = fibo(n);
  printf("fibo(%d) = %d\n", n, res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <fibo@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <fibo@plt>
lea    0xece(%rip),%rdi
mov    $0xa,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"fibo(%d) = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fibo(i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 10, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ vect_mus_oss_set_buffers(int, int);
void mus_oss_set_buffers(int num, int size) {
  vect_mus_oss_set_buffers(num, size);
}


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

x86 assembly (clang, -O2):
<mus_oss_set_buffers>:
jmp    1030 <vect_mus_oss_set_buffers@plt>

LLVM IR (-O0):
define void @mus_oss_set_buffers(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 @vect_mus_oss_set_buffers(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @mus_oss_set_buffers(i32 %0, i32 %1) {
%3 = tail call i32 @vect_mus_oss_set_buffers(i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpacklo_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_unpacklo_pd(__m128d A, __m128d B) {
  return _mm_unpacklo_pd(A, B);
}


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

x86 assembly (clang, -O2):
<test_mm_unpacklo_pd>:
jmp    1030 <_mm_unpacklo_pd@plt>

LLVM IR (-O0):
define i32 @test_mm_unpacklo_pd(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 @_mm_unpacklo_pd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_unpacklo_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_unpacklo_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sprWriterOptions() {
  printf("\t-8\tgenerate 8x8px sprites\n");
  printf("\t-h\tgenerate half sprites (8x16px, 16b per sprite)\n");
  printf("\t-lh\tlower colors will have higher priority planes (default)\n");
  printf("\t-hl\thigher colors will have higher priority planes\n");
}


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

x86 assembly (clang, -O2):
<sprWriterOptions>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"\09-8\09generate 8x8px sprites\0A\00"
@.str.1 = [52 x i8] c"\09-h\09generate half sprites (8x16px, 16b per sprite)\0A\00"
@.str.2 = [62 x i8] c"\09-lh\09lower colors will have higher priority planes (default)\0A\00"
@.str.3 = [53 x i8] c"\09-hl\09higher colors will have higher priority planes\0A\00"
define void @sprWriterOptions() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"\09-8\09generate 8x8px sprites\00"
@str.4 = [51 x i8] c"\09-h\09generate half sprites (8x16px, 16b per sprite)\00"
@str.5 = [61 x i8] c"\09-lh\09lower colors will have higher priority planes (default)\00"
@str.6 = [52 x i8] c"\09-hl\09higher colors will have higher priority planes\00"
define void @sprWriterOptions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ random;
typedef long long int64_t;

/* Variables and functions */
int /*<<< orphan*/ odhcp6c_random(int *, int);
int64_t dhcpv6_rand_delay(int64_t time) {
  int random;
  odhcp6c_random(&random, sizeof(random));
  return (time * ((int64_t)random % 1000LL)) / 10000LL;
}


x86 assembly (clang, -O0):
<dhcpv6_rand_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
call   1030 <odhcp6c_random@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    -0x18(%rbp),%rax
imul   %rdx,%rax
mov    $0x2710,%ecx
cqto
idiv   %rcx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhcpv6_rand_delay>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
call   1030 <odhcp6c_random@plt>
movslq 0xc(%rsp),%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
cltq
imul   %rbx,%rax
movabs $0x346dc5d63886594b,%rcx
c5 6d 34
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0xb,%rdx
add    %rdx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @dhcpv6_rand_delay(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = call i32 @odhcp6c_random(i32* %3, i32 4)
%5 = load i64, i64* %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = srem i64 %7, 1000
%9 = mul nsw i64 %5, %8
%10 = sdiv i64 %9, 10000
ret i64 %10
}

LLVM IR (-O2):
define i64 @dhcpv6_rand_delay(i64 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @odhcp6c_random(i32* %2, i32 4)
%5 = load i32, i32* %2
%6 = srem i32 %5, 1000
%7 = sext i32 %6 to i64
%8 = mul nsw i64 %7, %0
%9 = sdiv i64 %8, 10000
ret i64 %9
}
/* Type definitions */
struct List {
  int dummy;
};
struct Link {
  int dummy;
};

/* Variables and functions */
int insert(struct List *, struct Link *, struct Link *);
scalar_t__ make_name(char *);
int insert_name(struct List *lst, struct Link *p, char *n) {
  return insert(lst, p, (struct Link *)make_name(n));
}


x86 assembly (clang, -O0):
<insert_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <make_name@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
call   1030 <insert@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_name>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1040 <make_name@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <insert@plt>

LLVM IR (-O0):
%struct.List = type { i32 }
%struct.Link = type { i32 }
define i32 @insert_name(%struct.List* %0, %struct.Link* %1, i8* %2) {
%4 = alloca %struct.List*
%5 = alloca %struct.Link*
%6 = alloca i8*
store %struct.List* %0, %struct.List** %4
store %struct.Link* %1, %struct.Link** %5
store i8* %2, i8** %6
%7 = load %struct.List*, %struct.List** %4
%8 = load %struct.Link*, %struct.Link** %5
%9 = load i8*, i8** %6
%10 = call i64 @make_name(i8* %9)
%11 = inttoptr i64 %10 to %struct.Link*
%12 = call i32 @insert(%struct.List* %7, %struct.Link* %8, %struct.Link* %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.List = type { i32 }
%struct.Link = type { i32 }
define i32 @insert_name(%struct.List* %0, %struct.Link* %1, i8* %2) {
%4 = tail call i64 @make_name(i8* %2)
%5 = inttoptr i64 %4 to %struct.Link*
%6 = tail call i32 @insert(%struct.List* %0, %struct.Link* %1, %struct.Link* %5)
ret i32 %6
}
int Temperature_fn(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Temperature_fn() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int BuildIndex(int argc, char **argv) {
  printf("Calling from BuildIndex\n");
  return 1;
}


x86 assembly (clang, -O0):
<BuildIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"Calling from BuildIndex\0A\00"
define i32 @BuildIndex(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [24 x i8] c"Calling from BuildIndex\00"
define i32 @BuildIndex(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 1
}
void uper_c_source_h_decode_inner(struct decoder_t *decoder_p,
                                  struct uper_c_source_h_t *dst_p) {
  (void)decoder_p;
  (void)dst_p;
}


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

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

LLVM IR (-O0):
%struct.decoder_t = type opaque
%struct.uper_c_source_h_t = type opaque
define void @uper_c_source_h_decode_inner(%struct.decoder_t* %0, %struct.uper_c_source_h_t* %1) {
%3 = alloca %struct.decoder_t*
%4 = alloca %struct.uper_c_source_h_t*
store %struct.decoder_t* %0, %struct.decoder_t** %3
store %struct.uper_c_source_h_t* %1, %struct.uper_c_source_h_t** %4
%5 = load %struct.decoder_t*, %struct.decoder_t** %3
%6 = load %struct.uper_c_source_h_t*, %struct.uper_c_source_h_t** %4
ret void
}

LLVM IR (-O2):
%struct.decoder_t = type opaque
%struct.uper_c_source_h_t = type opaque
define void @uper_c_source_h_decode_inner(%struct.decoder_t* nocapture %0, %struct.uper_c_source_h_t* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
int main(int argc, const char **argv) {
  int i;
  for (i = 0; i < argc; i++)
    printf("argv[%i]: %s\n", i, argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"argv[%i]: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %6
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"argv[%i]: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
void img_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @img_cleanup() {
ret void
}