xunge/DecIR huggingface dataset:
/* Variables and functions */
float tgammaf(float);
float futrts_gamma32(float x) { return tgammaf(x); }


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

x86 assembly (clang, -O2):
<futrts_gamma32>:
jmp    1030 <tgammaf@plt>

LLVM IR (-O0):
define float @futrts_gamma32(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @tgammaf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @futrts_gamma32(float %0) {
%2 = tail call float @tgammaf(float %0)
ret float %2
}
void event_handle_instruction(s) char *s;
{}


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

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

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

LLVM IR (-O2):
define void @event_handle_instruction(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void alarm_handler() {
  printf("Test FAILED\n");
  exit(1);
}


x86 assembly (clang, -O0):
<alarm_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [13 x i8] c"Test FAILED\0A\00"
define void @alarm_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [12 x i8] c"Test FAILED\00"
define void @alarm_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
AX0AX1(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (((float *)10000000)[x0]) = (((float *)11111111)[x1]); }


x86 assembly (clang, -O0):
<AX0AX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa98ac7,%eax
movss  (%rax,%rcx,4),%xmm0
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
movss  %xmm0,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0AX1>:
movslq %esi,%rax
movss  0xa98ac7(,%rax,4),%xmm0
movslq %edi,%rax
movss  %xmm0,0x989680(,%rax,4)
ret

LLVM IR (-O0):
define i32 @AX0AX1(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* inttoptr (i64 11111111 to float*), i64 %17
%19 = load float, float* %18
%20 = load i32, i32* %10
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds float, float* inttoptr (i64 10000000 to float*), i64 %21
store float %19, float* %22
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @AX0AX1(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds float, float* inttoptr (i64 11111111 to float*), i64 %7
%9 = load float, float* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds float, float* inttoptr (i64 10000000 to float*), i64 %10
store float %9, float* %11
ret i32 undef
}
int alpha_dist(unsigned char a, unsigned char b) {
  return (a - (int)b) * (a - (int)b);
}


x86 assembly (clang, -O0):
<alpha_dist>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
sub    %ecx,%eax
movzbl -0x1(%rbp),%ecx
movzbl -0x2(%rbp),%edx
sub    %edx,%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha_dist>:
mov    %edi,%eax
sub    %esi,%eax
imul   %eax,%eax
ret

LLVM IR (-O0):
define i32 @alpha_dist(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = sub nsw i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = sub nsw i32 %11, %13
%15 = mul nsw i32 %9, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @alpha_dist(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = sub nsw i32 %3, %4
%6 = mul nsw i32 %5, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ kill_connection(int);
int /*<<< orphan*/ user_return(int, int);
void handle_timeout(int nr) {
  user_return(nr, 15);
  kill_connection(nr);
}


x86 assembly (clang, -O0):
<handle_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xf,%esi
call   1040 <user_return@plt>
mov    -0x4(%rbp),%edi
call   1030 <kill_connection@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_timeout>:
push   %rbx
mov    %edi,%ebx
mov    $0xf,%esi
call   1040 <user_return@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <kill_connection@plt>

LLVM IR (-O0):
define void @handle_timeout(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @user_return(i32 %3, i32 15)
%5 = load i32, i32* %2
%6 = call i32 @kill_connection(i32 %5)
ret void
}

LLVM IR (-O2):
define void @handle_timeout(i32 %0) {
%2 = tail call i32 @user_return(i32 %0, i32 15)
%3 = tail call i32 @kill_connection(i32 %0)
ret void
}
unsigned char unsignedchar_ignoring_unsignedshortint(unsigned char x,
                                                     unsigned short int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedchar_ignoring_unsignedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @unsignedchar_ignoring_unsignedshortint(i8 returned zeroext %0, i16 zeroext %1) {
ret i8 %0
}
void gtk_tree_view_column_sizing_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_sizing_get_type() {
ret void
}
/* Variables and functions */
size_t m_strlen(char *str) {
  size_t len;
  len = 0;
  while (str[len] != '\0') {
    len += 1;
  }
  return (len);
}


x86 assembly (clang, -O0):
<m_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <m_strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <m_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @m_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
int get_operand(unsigned char *s) {
  int x;
  x = *(s + 1);
  x |= *(s + 2) << 8;
  return x;
}


x86 assembly (clang, -O0):
<get_operand>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_operand(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
ret i32 %9
}
_Complex double test_cproj(_Complex double x) { return __builtin_cproj(x); }


x86 assembly (clang, -O0):
<test_cproj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <cproj@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cproj>:
jmp    1030 <cproj@plt>

LLVM IR (-O0):
define { double, double } @test_cproj(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca { double, double }
%5 = alloca { double, double }
%6 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %0, double* %6
%7 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %1, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%9 = load double, double* %8
%10 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%13 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %9, double* %12
store double %11, double* %13
%14 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%15 = load double, double* %14
%16 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%17 = load double, double* %16
%18 = call { double, double } @cproj(double %15, double %17)
%19 = extractvalue { double, double } %18, 0
%20 = extractvalue { double, double } %18, 1
%21 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%22 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %19, double* %21
store double %20, double* %22
%23 = load { double, double }, { double, double }* %3
ret { double, double } %23
}

LLVM IR (-O2):
define { double, double } @test_cproj(double %0, double %1) {
%3 = tail call { double, double } @cproj(double %0, double %1)
ret { double, double } %3
}
int test_imm_12uint16_reg(unsigned short val) {
  return ((val) & (0x12 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_12uint16_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, 18
%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_12uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 18
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void usage(void) { die("Usage: build setup system [> image]"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Usage: build setup system [> image]\00"
define void @usage() {
%1 = call i32 @die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Usage: build setup system [> image]\00"
define void @usage() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
char *hux(s)
char *s;
{
  static char string[500];
  strcpy(string, "TOTO IS HAPPY");
  return string;
}


x86 assembly (clang, -O0):
<hux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0x2f1d(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2f0a(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hux>:
movabs $0x59505041482053,%rax
mov    %rax,0x2f25(%rip)
movabs $0x205349204f544f54,%rax
49 53 20
mov    %rax,0x2f0e(%rip)
lea    0x2f07(%rip),%rax
ret

LLVM IR (-O0):
@hux.string = internal global [500 x i8] zeroinitializer
@.str = [14 x i8] c"TOTO IS HAPPY\00"
define i8* @hux(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* @strcpy(i8* getelementptr inbounds ([500 x i8], [500 x i8]* @hux.string, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([500 x i8], [500 x i8]* @hux.string, i64 0, i64 0)
}

LLVM IR (-O2):
@hux.string = internal global [500 x i8] zeroinitializer
@.str = [14 x i8] c"TOTO IS HAPPY\00"
define i8* @hux(i8* nocapture readnone %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 dereferenceable(14) getelementptr inbounds ([500 x i8], [500 x i8]* @hux.string, i64 0, i64 0), i8* align 1 dereferenceable(14) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 14, i1 false)
ret i8* getelementptr inbounds ([500 x i8], [500 x i8]* @hux.string, i64 0, i64 0)
}
/* Type definitions */
struct tm {
  int tm_min;
};

/* Variables and functions */
int tm_getminute(struct tm date) { return date.tm_min; }


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

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

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @tm_getminute(i32 %0) {
%2 = alloca %struct.tm
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
store i32 %0, i32* %3
%4 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @tm_getminute(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int mrf24j40_read_short_ctrl_reg(int);
int /*<<< orphan*/ mrf24j40_write_short_ctrl_reg(int, int);
void mrf24j40_set_coordinator(void) {
  mrf24j40_write_short_ctrl_reg(0x00,
                                mrf24j40_read_short_ctrl_reg(0x00) | (1 << 3));
}


x86 assembly (clang, -O0):
<mrf24j40_set_coordinator>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <mrf24j40_read_short_ctrl_reg@plt>
mov    %eax,%esi
or     $0x8,%esi
xor    %edi,%edi
call   1040 <mrf24j40_write_short_ctrl_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrf24j40_set_coordinator>:
push   %rax
xor    %edi,%edi
call   1030 <mrf24j40_read_short_ctrl_reg@plt>
or     $0x8,%eax
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <mrf24j40_write_short_ctrl_reg@plt>

LLVM IR (-O0):
define void @mrf24j40_set_coordinator() {
%1 = call i32 @mrf24j40_read_short_ctrl_reg(i32 0)
%2 = or i32 %1, 8
%3 = call i32 @mrf24j40_write_short_ctrl_reg(i32 0, i32 %2)
ret void
}

LLVM IR (-O2):
define void @mrf24j40_set_coordinator() {
%1 = tail call i32 @mrf24j40_read_short_ctrl_reg(i32 0)
%2 = or i32 %1, 8
%3 = tail call i32 @mrf24j40_write_short_ctrl_reg(i32 0, i32 %2)
ret void
}
/* Type definitions */
struct timeval {
  unsigned int tv_sec;
  unsigned int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ srand(unsigned int);
void seed_randomness() {
  struct timeval t;
  gettimeofday(&t, NULL);
  unsigned int time_in_sec = t.tv_sec;
  unsigned int time_micro_sec = t.tv_usec;
  unsigned int seed;
  seed = time_in_sec;
  seed = time_micro_sec >> 7;
  srand(seed);
}


x86 assembly (clang, -O0):
<seed_randomness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
shr    $0x7,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <srand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seed_randomness>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x4(%rsp),%edi
shr    $0x7,%edi
pop    %rax
jmp    1040 <srand@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @seed_randomness() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i32, i32* %6
store i32 %7, i32* %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load i32, i32* %8
store i32 %9, i32* %3
%10 = load i32, i32* %2
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = lshr i32 %11, 7
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @srand(i32 %13)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @seed_randomness() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i32, i32* %4
%6 = lshr i32 %5, 7
%7 = tail call i32 @srand(i32 %6)
ret void
}
/* Type definitions */
struct archive {
  int dummy;
};

/* Variables and functions */
int archive_compression(struct archive *);
int _alpm_archive_filter_code(struct archive *archive) {
  return archive_compression(archive);
}


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

x86 assembly (clang, -O2):
<_alpm_archive_filter_code>:
jmp    1030 <archive_compression@plt>

LLVM IR (-O0):
%struct.archive = type { i32 }
define i32 @_alpm_archive_filter_code(%struct.archive* %0) {
%2 = alloca %struct.archive*
store %struct.archive* %0, %struct.archive** %2
%3 = load %struct.archive*, %struct.archive** %2
%4 = call i32 @archive_compression(%struct.archive* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.archive = type { i32 }
define i32 @_alpm_archive_filter_code(%struct.archive* %0) {
%2 = tail call i32 @archive_compression(%struct.archive* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ AUTH;

/* Variables and functions */
void authunix_nextverf(AUTH *auth) {}


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

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

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

LLVM IR (-O2):
define void @authunix_nextverf(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cl_int;
typedef scalar_t__ cl_context;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_int clRetainContext(cl_context context) {
  unsigned int sys_args[1];
  sys_args[0] = (unsigned int)context;
  return (cl_int)syscall(325, 1006, sys_args);
}


x86 assembly (clang, -O0):
<clRetainContext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdx
mov    $0x145,%edi
mov    $0x3ee,%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clRetainContext>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x145,%edi
mov    $0x3ee,%esi
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clRetainContext(i64 %0) {
%2 = alloca i64
%3 = alloca [1 x i32]
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%8 = call i32 @syscall(i32 325, i32 1006, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @clRetainContext(i64 %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = trunc i64 %0 to i32
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 %4, i32* %5
%6 = call i32 @syscall(i32 325, i32 1006, i32* %5)
ret i32 %6
}
void testClosureSFSrV(void (*closure)(short, float, short), short a1, float a2,
                      short a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureSFSrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
movss  %xmm0,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xa(%rbp),%cx
movss  -0x10(%rbp),%xmm0
movswl %cx,%edi
movswl -0x12(%rbp),%esi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureSFSrV>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureSFSrV(void (i16, float, i16)* %0, i16 signext %1, float %2, i16 signext %3) {
%5 = alloca void (i16, float, i16)*
%6 = alloca i16
%7 = alloca float
%8 = alloca i16
store void (i16, float, i16)* %0, void (i16, float, i16)** %5
store i16 %1, i16* %6
store float %2, float* %7
store i16 %3, i16* %8
%9 = load void (i16, float, i16)*, void (i16, float, i16)** %5
%10 = load i16, i16* %6
%11 = load float, float* %7
%12 = load i16, i16* %8
ret void
}

LLVM IR (-O2):
define void @testClosureSFSrV(void (i16, float, i16)* nocapture %0, i16 signext %1, float %2, i16 signext %3) {
tail call void %0(i16 signext %1, float %2, i16 signext %3)
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *basename(const char *path) {
  const char *base = strrchr(path, '/');
  return base ? base + 1 : path;
}


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

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

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

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
unsigned int endian_swap(unsigned int x) {
  return (x >> 24) | ((x << 8) & 0x00FF0000) | ((x >> 8) & 0x0000FF00) |
         (x << 24);
}


x86 assembly (clang, -O0):
<endian_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @endian_swap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 24
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = and i32 %6, 16711680
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = lshr i32 %9, 8
%11 = and i32 %10, 65280
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = shl i32 %13, 24
%15 = or i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @endian_swap(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int isblank2(char c) {
  if (c == ' ' || c == '\t')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isblank2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1124 <isblank2+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    1130 <isblank2+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <isblank2+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isblank2>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isblank2(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 9
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @isblank2(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void x64_case(int i, unsigned tar, unsigned arg1, unsigned arg2) {}


x86 assembly (clang, -O0):
<x64_case>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @x64_case(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @x64_case(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int unshare(int /*<<< orphan*/);
int main(void) { return unshare(0); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
jmp    1030 <unshare@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @unshare(i32 0)
ret i32 %1
}
int twist_r_on_sliceedge(sliceedge)
int sliceedge;
{
  int temp_arr[12];
  sliceedge_unpack(sliceedge, temp_arr);
  four_cycle(temp_arr, 8, 5, 10, 1);
  return sliceedge_pack(temp_arr);
}


x86 assembly (clang, -O0):
<twist_r_on_sliceedge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1050 <sliceedge_unpack@plt>
lea    -0x40(%rbp),%rdi
mov    $0x8,%esi
mov    $0x5,%edx
mov    $0xa,%ecx
mov    $0x1,%r8d
mov    $0x0,%al
call   1040 <four_cycle@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1030 <sliceedge_pack@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twist_r_on_sliceedge>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <sliceedge_unpack@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x5,%edx
mov    $0xa,%ecx
mov    $0x1,%r8d
xor    %eax,%eax
call   1040 <four_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sliceedge_pack@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @twist_r_on_sliceedge(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @sliceedge_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %7, i32 8, i32 5, i32 10, i32 1)
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @sliceedge_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @twist_r_on_sliceedge(i32 %0) {
%2 = alloca [12 x i32]
%3 = bitcast [12 x i32]* %2 to i8*
%4 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @sliceedge_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 8, i32 5, i32 10, i32 1)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @sliceedge_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ ncpu;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ sysctlbyname(char *, int /*<<< orphan*/ *, size_t *,
                                int /*<<< orphan*/ *, int /*<<< orphan*/);
int32_t countOfCPU(void) {
  int32_t ncpu = 0;
  size_t len = sizeof(ncpu);
  sysctlbyname("hw.ncpu", &ncpu, &len, NULL, 0);
  return ncpu;
}


x86 assembly (clang, -O0):
<countOfCPU>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x4,-0x10(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <sysctlbyname@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countOfCPU>:
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
movq   $0x4,0x10(%rsp)
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <sysctlbyname@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"hw.ncpu\00"
define i32 @countOfCPU() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 4, i64* %2
%3 = call i32 @sysctlbyname(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %1, i64* %2, i32* null, i32 0)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"hw.ncpu\00"
define i32 @countOfCPU() {
%1 = alloca i32
%2 = alloca i64
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i64* %2 to i8*
store i64 4, i64* %2
%5 = call i32 @sysctlbyname(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %1, i64* %2, i32* null, i32 0)
%6 = load i32, i32* %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ dac_timer_update();
void dac_update_now(void) { dac_timer_update(); }


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

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

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

LLVM IR (-O2):
define void @dac_update_now() {
%1 = tail call i32 (...) @dac_timer_update()
ret void
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};
struct hostent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
struct hostent *gethostbyaddr(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ str_to_addr(char const *);
struct hostent *gethostbyaddr_wrapper(const char *address) {
  struct in_addr addr;
  addr.s_addr = str_to_addr(address);
  return gethostbyaddr((char *)&addr, 4, AF_INET);
}


x86 assembly (clang, -O0):
<gethostbyaddr_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <str_to_addr@plt>
mov    %eax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%esi
call   1040 <gethostbyaddr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethostbyaddr_wrapper>:
push   %rax
call   1030 <str_to_addr@plt>
mov    %eax,(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <gethostbyaddr@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.hostent = type { i32 }
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
define %struct.hostent* @gethostbyaddr_wrapper(i8* %0) {
%2 = alloca %struct.in_addr
%3 = bitcast %struct.in_addr* %2 to i8*
%4 = tail call i32 @str_to_addr(i8* %0)
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* @AF_INET
%7 = call %struct.hostent* @gethostbyaddr(i8* %3, i32 4, i32 %6)
ret %struct.hostent* %7
}
float toPower(float baseNum, int exponentNum) {
  if (exponentNum == 1) {
    return baseNum;
  } else {
    return baseNum * toPower(baseNum, exponentNum - 1);
  }
}


x86 assembly (clang, -O0):
<toPower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1139 <toPower+0x29>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1164 <toPower+0x54>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <toPower@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toPower>:
cmp    $0x1,%edi
je     1144 <toPower+0x34>
push   %rax
add    $0xffffffff,%edi
movss  %xmm0,0x4(%rsp)
movss  0x4(%rsp),%xmm0
call   1030 <toPower@plt>
movss  0x4(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
movss  0x4(%rsp),%xmm0
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define float @toPower(float %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2, %6
%5 = phi float [ %9, %6 ], [ %0, %2 ]
ret float %5
6: ; preds = %2
%7 = add nsw i32 %1, -1
%8 = tail call float @toPower(float %0, i32 %7)
%9 = fmul float %8, %0
br label %4
}
/* Variables and functions */
char *strchr(char *, char);
char *strunc(char *str) {
  char *comment = strchr(str, '#');
  if (comment)
    *comment = '\0';
  return str;
}


x86 assembly (clang, -O0):
<strunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <strunc+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strunc>:
push   %rbx
mov    %rdi,%rbx
mov    $0x23,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1126 <strunc+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strunc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 35)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @strunc(i8* returned %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 35)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret i8* %0
}
unsigned int ps_geta(int c) { return (c >> 24) & 0xff; }


x86 assembly (clang, -O0):
<ps_geta>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_geta>:
mov    %edi,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @ps_geta(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 24
%5 = and i32 %4, 255
ret i32 %5
}

LLVM IR (-O2):
define i32 @ps_geta(i32 %0) {
%2 = lshr i32 %0, 24
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ cdrom_sysctl_unregister();
int /*<<< orphan*/ printk(char *);
void __attribute__((__section__(".exit.text"))) __attribute__((__cold__))
cdrom_exit(void) {
  printk("<6>"
         "Uniform CD-ROM driver unloaded\n");
  cdrom_sysctl_unregister();
}


x86 assembly (clang, -O0):
<cdrom_exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printk@plt>
mov    $0x0,%al
call   1040 <cdrom_sysctl_unregister@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdrom_exit>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <printk@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cdrom_sysctl_unregister@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"<6>Uniform CD-ROM driver unloaded\0A\00"
define void @cdrom_exit() section ".exit.text" {
%1 = call i32 @printk(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @cdrom_sysctl_unregister()
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"<6>Uniform CD-ROM driver unloaded\0A\00"
define void @cdrom_exit() section ".exit.text" {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @cdrom_sysctl_unregister()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putchar_fd(char c, int fd) { write(fd, &c, 1); }


x86 assembly (clang, -O0):
<ft_putchar_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putchar_fd>:
push   %rax
mov    %esi,%eax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @ft_putchar_fd(i8 signext %0, i32 %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i32 @write(i32 %1, i8* %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int tiffMetadataPrint(char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    fprintf(stderr, "usage: %s tiffFile\n", argv[0]);
    return 1;
  }
  return tiffMetadataPrint(argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1168 <main+0x48>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1178 <main+0x58>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <tiffMetadataPrint@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1145 <main+0x25>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1040 <tiffMetadataPrint@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"usage: %s tiffFile\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %12
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @tiffMetadataPrint(i8* %10)
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ 1, %4 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ ChangeString(char *, char);
int /*<<< orphan*/ InputString(char *);
int /*<<< orphan*/ PrintResult(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char m[256];
  char key;
  InputString(m);
  scanf("%c", &key);
  ChangeString(m, key);
  PrintResult(m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
call   1040 <InputString@plt>
lea    0xe9b(%rip),%rdi
lea    -0x111(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x110(%rbp),%rdi
movsbl -0x111(%rbp),%esi
call   1030 <ChangeString@plt>
lea    -0x110(%rbp),%rdi
call   1060 <PrintResult@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x110,%rsp
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <InputString@plt>
lea    0xea4(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <ChangeString@plt>
mov    %rbx,%rdi
call   1060 <PrintResult@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i8
store i32 0, i32* %1
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i32 @InputString(i8* %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%8 = load i8, i8* %3
%9 = call i32 @ChangeString(i8* %7, i8 signext %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%11 = call i32 @PrintResult(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @InputString(i8* %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %2
%7 = call i32 @ChangeString(i8* %3, i8 signext %6)
%8 = call i32 @PrintResult(i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World, this is a Travis build test\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"Hello World, this is a Travis build test\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [41 x i8] c"Hello World, this is a Travis build test\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 0
}
char *strerror(int err) {
  return "strerror() is not defined on WinCE. Use native I/O.";
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [52 x i8] c"strerror() is not defined on WinCE. Use native I/O.\00"
define i8* @strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [52 x i8] c"strerror() is not defined on WinCE. Use native I/O.\00"
define i8* @strerror(i32 %0) {
ret i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0)
}
void CloseDLL(void) {}


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

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

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

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