xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
abc(int i) { printf("\n%d", i); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"\0A%d\00"
define i32 @abc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
define i32 @abc(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ vcall(float *, int);
void v3i(long int *vec) {
  float v[3];
  v[0] = vec[0];
  v[1] = vec[1];
  v[2] = vec[2];
  vcall(v, 3);
}


x86 assembly (clang, -O0):
<v3i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq 0x8(%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq 0x10(%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x3,%esi
call   1030 <vcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v3i>:
sub    $0x18,%rsp
cvtsi2ssq (%rdi),%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ssq 0x8(%rdi),%xmm0
movss  %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ssq 0x10(%rdi),%xmm0
movss  %xmm0,0x14(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x3,%esi
call   1030 <vcall@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @v3i(i64* nocapture %0) {
%2 = alloca [3 x float]
%3 = bitcast [3 x float]* %2 to i8*
%4 = load i64, i64* %0
%5 = sitofp i64 %4 to float
%6 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
store float %5, float* %6
%7 = getelementptr inbounds i64, i64* %0, i64 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to float
%10 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 1
store float %9, float* %10
%11 = getelementptr inbounds i64, i64* %0, i64 2
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to float
%14 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 2
store float %13, float* %14
%15 = call i32 @vcall(float* %6, i32 3)
ret void
}
void encode_artnet_uint32_hilo(unsigned short n, unsigned char *data) {
  data[0] = (n >> 24) & 0xFF;
  data[1] = (n >> 16) & 0xFF;
  data[2] = (n >> 8) & 0xFF;
  data[3] = (n >> 0) & 0xFF;
}


x86 assembly (clang, -O0):
<encode_artnet_uint32_hilo>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x2(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
movzwl -0x2(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_artnet_uint32_hilo>:
mov    %edi,%eax
movw   $0x0,(%rsi)
mov    %ah,0x2(%rsi)
mov    %al,0x3(%rsi)
ret

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

LLVM IR (-O2):
define void @encode_artnet_uint32_hilo(i16 zeroext %0, i8* nocapture writeonly %1) {
store i8 0, i8* %1
%3 = getelementptr inbounds i8, i8* %1, i64 1
store i8 0, i8* %3
%4 = lshr i16 %0, 8
%5 = trunc i16 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %5, i8* %6
%7 = trunc i16 %0 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %7, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ print_int(int);
void println_int(int d) {
  print_int(d);
  newline();
}


x86 assembly (clang, -O0):
<println_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <print_int@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<println_int>:
push   %rax
call   1040 <print_int@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <newline@plt>

LLVM IR (-O0):
define void @println_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @print_int(i32 %3)
%5 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
define void @println_int(i32 %0) {
%2 = tail call i32 @print_int(i32 %0)
%3 = tail call i32 (...) @newline()
ret void
}
int superficiedelaesfera(int r) {
  int sup;
  sup = 4 * 3.141592654 * (r * r);
  return sup;
}


x86 assembly (clang, -O0):
<superficiedelaesfera>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<superficiedelaesfera>:
imul   %edi,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef1(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @superficiedelaesfera(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = sitofp i32 %6 to double
%8 = fmul double 0x402921FB54524550, %7
%9 = fptosi double %8 to i32
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @superficiedelaesfera(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x402921FB54524550
%5 = fptosi double %4 to i32
ret i32 %5
}
int test_imm_1Fuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x1F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Fuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 31
%6 = icmp ne i64 %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_1Fuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 31
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ADI32RegRead(uint32_t ui32Base, uint32_t ui32Reg) {
  ;
  ;
  return ((*((volatile unsigned long *)(ui32Base + (ui32Reg & 0xFC)))));
}


x86 assembly (clang, -O0):
<ADI32RegRead>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0xfc,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ADI32RegRead(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 = and i32 %6, 252
%8 = add nsw i32 %5, %7
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ADI32RegRead(i32 %0, i32 %1) {
%3 = and i32 %1, 252
%4 = add nsw i32 %3, %0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ atrshmlog_init_events(int /*<<< orphan*/);
void atrshmlog_init_events_no_file() { atrshmlog_init_events(0); }


x86 assembly (clang, -O0):
<atrshmlog_init_events_no_file>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <atrshmlog_init_events@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @atrshmlog_init_events_no_file() {
%1 = call i32 @atrshmlog_init_events(i32 0)
ret void
}

LLVM IR (-O2):
define void @atrshmlog_init_events_no_file() {
%1 = tail call i32 @atrshmlog_init_events(i32 0)
ret void
}
int ret_2(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ret_2() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ret_2() {
ret i32 2
}
/* Type definitions */
struct mux_socket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mux_socket_close(struct mux_socket *);
int /*<<< orphan*/ printf(char *, size_t);
void readcb2(struct mux_socket *sock, const char *data, size_t len, void *arg) {
  int *i = (int *)data;
  printf("recv %d\n", *i);
  printf("len %d\n", len);
  mux_socket_close(sock);
}


x86 assembly (clang, -O0):
<readcb2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <mux_socket_close@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readcb2>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
movslq (%rsi),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <mux_socket_close@plt>

LLVM IR (-O0):
%struct.mux_socket = type { i32 }
@.str = [9 x i8] c"recv %d\0A\00"
@.str.1 = [8 x i8] c"len %d\0A\00"
define void @readcb2(%struct.mux_socket* %0, i8* %1, i64 %2, i8* %3) {
%5 = alloca %struct.mux_socket*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32*
store %struct.mux_socket* %0, %struct.mux_socket** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %9
%12 = load i32*, i32** %9
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %14)
%16 = load i64, i64* %7
%17 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 %16)
%18 = load %struct.mux_socket*, %struct.mux_socket** %5
%19 = call i32 @mux_socket_close(%struct.mux_socket* %18)
ret void
}

LLVM IR (-O2):
%struct.mux_socket = type { i32 }
@.str = [9 x i8] c"recv %d\0A\00"
@.str.1 = [8 x i8] c"len %d\0A\00"
define void @readcb2(%struct.mux_socket* %0, i8* nocapture %1, i64 %2, i8* nocapture readnone %3) {
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 %2)
%10 = tail call i32 @mux_socket_close(%struct.mux_socket* %0)
ret void
}
void lunix_protocol_show_packet(struct lunix_protocol_state_struct *state) {}


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

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

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

LLVM IR (-O2):
%struct.lunix_protocol_state_struct = type opaque
define void @lunix_protocol_show_packet(%struct.lunix_protocol_state_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ltoa(long, char *);
int /*<<< orphan*/ report(int, int /*<<< orphan*/);
void lreport(int row, long value) {
  static char buf[20];
  report(row, ltoa(value, buf));
}


x86 assembly (clang, -O0):
<lreport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0x2f00(%rip),%rsi
call   1030 <ltoa@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <report@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lreport>:
push   %rbx
mov    %rsi,%rax
mov    %edi,%ebx
lea    0x2f13(%rip),%rsi
mov    %rax,%rdi
call   1030 <ltoa@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <report@plt>

LLVM IR (-O0):
@lreport.buf = internal global [20 x i8] zeroinitializer
define void @lreport(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = call i32 @ltoa(i64 %6, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @lreport.buf, i64 0, i64 0))
%8 = call i32 @report(i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
@lreport.buf = internal global [20 x i8] zeroinitializer
define void @lreport(i32 %0, i64 %1) {
%3 = tail call i32 @ltoa(i64 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @lreport.buf, i64 0, i64 0))
%4 = tail call i32 @report(i32 %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sla_preces_(char *, double *, double *, double *, double *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void slaPreces(char *system, double ep0, double ep1, double *ra, double *dc) {
  sla_preces_(system, &ep0, &ep1, ra, dc, strlen(system));
}


x86 assembly (clang, -O0):
<slaPreces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    %eax,%r9d
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <sla_preces_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaPreces>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
movsd  %xmm1,(%rsp)
call   1030 <strlen@plt>
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
mov    %r15,%rcx
mov    %r14,%r8
mov    %eax,%r9d
call   1040 <sla_preces_@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @slaPreces(i8* %0, double %1, double %2, double* %3, double* %4) {
%6 = alloca i8*
%7 = alloca double
%8 = alloca double
%9 = alloca double*
%10 = alloca double*
store i8* %0, i8** %6
store double %1, double* %7
store double %2, double* %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load i8*, i8** %6
%12 = load double*, double** %9
%13 = load double*, double** %10
%14 = load i8*, i8** %6
%15 = call i32 @strlen(i8* %14)
%16 = call i32 @sla_preces_(i8* %11, double* %7, double* %8, double* %12, double* %13, i32 %15)
ret void
}

LLVM IR (-O2):
define void @slaPreces(i8* %0, double %1, double %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
store double %1, double* %6
store double %2, double* %7
%8 = tail call i32 @strlen(i8* %0)
%9 = call i32 @sla_preces_(i8* %0, double* %6, double* %7, double* %3, double* %4, i32 %8)
ret void
}
void foo770(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo770(i32 %0) {
ret void
}
/* Type definitions */
typedef char *uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint32_t inl(uint16_t addr) {
  uint32_t val;
  __asm__ __volatile__("inl %%dx,%%eax" : "=a"(val) : "d"(addr));
  return val;
}


x86 assembly (clang, -O0):
<inl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl>:
mov    %edi,%edx
in     (%dx),%eax
ret

LLVM IR (-O0):
define i8* @inl(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "inl %dx,%eax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inl(i32 %0) {
%2 = tail call i8* asm sideeffect "inl %dx,%eax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
/* Variables and functions */
float pow(float, double);
float gamma_correct(float value, float gamma) {
  return pow(value, 1.0 / gamma);
}


x86 assembly (clang, -O0):
<gamma_correct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xec8(%rip),%xmm1
divsd  %xmm2,%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma_correct>:
cvtss2sd %xmm1,%xmm2
movsd  0xee4(%rip),%xmm1
divsd  %xmm2,%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define float @gamma_correct(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fdiv double 1.000000e+00, %7
%9 = call float @pow(float %5, double %8)
ret float %9
}

LLVM IR (-O2):
define float @gamma_correct(float %0, float %1) {
%3 = fpext float %1 to double
%4 = fdiv double 1.000000e+00, %3
%5 = tail call float @pow(float %0, double %4)
ret float %5
}
const char *dev_get_param(struct device_d *dev, const char *name) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.device_d = type opaque
define i8* @dev_get_param(%struct.device_d* %0, i8* %1) {
%3 = alloca %struct.device_d*
%4 = alloca i8*
store %struct.device_d* %0, %struct.device_d** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
%struct.device_d = type opaque
define noalias i8* @dev_get_param(%struct.device_d* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t burn(uint32_t hash) {
  hash ^= hash >> 16;
  hash *= 0x85EBCA6B;
  hash ^= hash >> 13;
  hash *= 0xC2B2AE35;
  hash ^= hash >> 16;
  return hash;
}


x86 assembly (clang, -O0):
<burn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0x85ebca6b,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xd,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0xc2b2ae35,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<burn>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
imul   $0x85ebca6b,%eax,%eax
mov    %eax,%ecx
sar    $0xd,%ecx
xor    %eax,%ecx
imul   $0xc2b2ae35,%ecx,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @burn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = mul i32 %7, -2048144789
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 13
%11 = load i32, i32* %2
%12 = xor i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = mul i32 %13, -1028477387
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 16
%17 = load i32, i32* %2
%18 = xor i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @burn(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = mul i32 %3, -2048144789
%5 = ashr i32 %4, 13
%6 = xor i32 %5, %4
%7 = mul i32 %6, -1028477387
%8 = ashr i32 %7, 16
%9 = xor i32 %8, %7
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_unlock(int /*<<< orphan*/ *);
int evthread_posix_unlock(unsigned mode, void *_lock) {
  pthread_mutex_t *lock = _lock;
  return pthread_mutex_unlock(lock);
}


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

x86 assembly (clang, -O2):
<evthread_posix_unlock>:
mov    %rsi,%rdi
jmp    1030 <pthread_mutex_unlock@plt>

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

LLVM IR (-O2):
define i32 @evthread_posix_unlock(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
%4 = tail call i32 @pthread_mutex_unlock(i32* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ menu(int *);
int *writeInRam();
int main() {
  int *p;
  p = writeInRam();
  menu(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <writeInRam@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <menu@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <writeInRam@plt>
mov    %rax,%rdi
call   1030 <menu@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* (...) @writeInRam()
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @menu(i32* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* (...) @writeInRam()
%2 = tail call i32 @menu(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_syscall(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int *);
void _exit(int code) {
  int error;
  do_syscall(2, code, 0, 0, 0, &error);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
xor    %r8d,%r8d
lea    -0x8(%rbp),%r9
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <do_syscall@plt>
jmp    1135 <_exit+0x25>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
mov    %edi,%esi
lea    0x4(%rsp),%r9
mov    $0x2,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <do_syscall@plt>
nopl   0x0(%rax)
jmp    1130 <_exit+0x20>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @do_syscall(i32 2, i32 %4, i32 0, i32 0, i32 0, i32* %3)
br label %6
6: ; preds = %1, %6
br label %6
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @do_syscall(i32 2, i32 %0, i32 0, i32 0, i32 0, i32* %2)
br label %5
5: ; preds = %5, %1
br label %5
}
/* Variables and functions */
char con_getc();
int /*<<< orphan*/ pci_scan();
int /*<<< orphan*/ printf(char *, char);
void main(int ac, char *av[]) {
  char c;
  do {
    pci_scan();
    c = con_getc();
    printf("-------- %c\n", c);
  } while (c != 'q');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pci_scan@plt>
mov    $0x0,%al
call   1030 <con_getc@plt>
mov    %al,-0x11(%rbp)
lea    0xea9(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1040 <printf@plt>
movsbl -0x11(%rbp),%eax
cmp    $0x71,%eax
jne    113f <main+0xf>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rbx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <pci_scan@plt>
xor    %eax,%eax
call   1030 <con_getc@plt>
movsbl %al,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
cmp    $0x71,%bpl
jne    1140 <main+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"-------- %c\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8
store i32 %0, i32* %3
store i8** %1, i8*** %4
br label %6
6: ; preds = %11, %2
%7 = call i32 (...) @pci_scan()
%8 = call signext i8 (...) @con_getc()
store i8 %8, i8* %5
%9 = load i8, i8* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext %9)
br label %11
11: ; preds = %6
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 113
br i1 %14, label %6, label %15
15: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"-------- %c\0A\00"
define void @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 (...) @pci_scan()
%5 = tail call signext i8 (...) @con_getc()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext %5)
%7 = icmp eq i8 %5, 113
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_or_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_slli_epi16(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_srli_epi16(int /*<<< orphan*/, int);
__m128i _mm_bswap_epi16(__m128i x) {
  return _mm_or_si128(_mm_slli_epi16(x, 8), _mm_srli_epi16(x, 8));
}


x86 assembly (clang, -O0):
<_mm_bswap_epi16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1050 <_mm_slli_epi16@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1030 <_mm_srli_epi16@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <_mm_or_si128@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_bswap_epi16>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x8,%esi
call   1050 <_mm_slli_epi16@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <_mm_srli_epi16@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_mm_or_si128@plt>

LLVM IR (-O0):
define i32 @_mm_bswap_epi16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_mm_slli_epi16(i32 %3, i32 8)
%5 = load i32, i32* %2
%6 = call i32 @_mm_srli_epi16(i32 %5, i32 8)
%7 = call i32 @_mm_or_si128(i32 %4, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_mm_bswap_epi16(i32 %0) {
%2 = tail call i32 @_mm_slli_epi16(i32 %0, i32 8)
%3 = tail call i32 @_mm_srli_epi16(i32 %0, i32 8)
%4 = tail call i32 @_mm_or_si128(i32 %2, i32 %3)
ret i32 %4
}
/* Type definitions */
struct drand48_data {
  int dummy;
};

/* Variables and functions */
double laplace(double, struct drand48_data *);
double laplace_mechanism(double x, double eps, double sens,
                         struct drand48_data *buffer) {
  return x + laplace(sens / eps, buffer);
}


x86 assembly (clang, -O0):
<laplace_mechanism>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%rdi
call   1030 <laplace@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<laplace_mechanism>:
push   %rax
movsd  %xmm0,(%rsp)
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
call   1030 <laplace@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.drand48_data = type { i32 }
define double @laplace_mechanism(double %0, double %1, double %2, %struct.drand48_data* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca %struct.drand48_data*
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store %struct.drand48_data* %3, %struct.drand48_data** %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = load double, double* %6
%12 = fdiv double %10, %11
%13 = load %struct.drand48_data*, %struct.drand48_data** %8
%14 = call double @laplace(double %12, %struct.drand48_data* %13)
%15 = fadd double %9, %14
ret double %15
}

LLVM IR (-O2):
%struct.drand48_data = type { i32 }
define double @laplace_mechanism(double %0, double %1, double %2, %struct.drand48_data* %3) {
%5 = fdiv double %2, %1
%6 = tail call double @laplace(double %5, %struct.drand48_data* %3)
%7 = fadd double %6, %0
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ JobInterrupt(int, int);
void JobPassSig_int(int signo) { JobInterrupt(1, signo); }


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

x86 assembly (clang, -O2):
<JobPassSig_int>:
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <JobInterrupt@plt>

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

LLVM IR (-O2):
define void @JobPassSig_int(i32 %0) {
%2 = tail call i32 @JobInterrupt(i32 1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SHOULDNT_HAPPEN();
int libbf_gen_asm_ppc_not_expected() {
  SHOULDNT_HAPPEN();
  return 0;
}


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

x86 assembly (clang, -O2):
<libbf_gen_asm_ppc_not_expected>:
push   %rax
xor    %eax,%eax
call   1030 <SHOULDNT_HAPPEN@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @libbf_gen_asm_ppc_not_expected() {
%1 = call i32 (...) @SHOULDNT_HAPPEN()
ret i32 0
}

LLVM IR (-O2):
define i32 @libbf_gen_asm_ppc_not_expected() {
%1 = tail call i32 (...) @SHOULDNT_HAPPEN()
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int governor_enter_lve_light(uint32_t *u1) {
  printf("%d, governor_enter_lve_light\n", *u1);
  return 0;
}


x86 assembly (clang, -O0):
<governor_enter_lve_light>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<governor_enter_lve_light>:
push   %rax
mov    (%rdi),%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"%d, governor_enter_lve_light\0A\00"
define i32 @governor_enter_lve_light(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"%d, governor_enter_lve_light\0A\00"
define i32 @governor_enter_lve_light(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Para ver como se comportan los distintos tipos de "
         "ordenamiento.\nCorre los distintos ejecutables.\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 = [98 x i8] c"Para ver como se comportan los distintos tipos de ordenamiento.\0ACorre los distintos ejecutables.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [97 x i8] c"Para ver como se comportan los distintos tipos de ordenamiento.\0ACorre los distintos ejecutables.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @str, i64 0, i64 0))
ret i32 0
}
const char *locale_charset(void) { return "UTF-8"; }


x86 assembly (clang, -O0):
<locale_charset>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"UTF-8\00"
define i8* @locale_charset() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int mdp4_lcdc_on(struct platform_device *pdev) { return 0; }


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

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

LLVM IR (-O0):
%struct.platform_device = type opaque
define i32 @mdp4_lcdc_on(%struct.platform_device* %0) {
%2 = alloca %struct.platform_device*
store %struct.platform_device* %0, %struct.platform_device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @mdp4_lcdc_on(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
signed char foo_char(_Complex signed char x) { return __real__ x; }


x86 assembly (clang, -O0):
<foo_char>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @foo_char(i16 %0) {
%2 = alloca { i8, i8 }
%3 = bitcast { i8, i8 }* %2 to i16*
store i16 %0, i16* %3
%4 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %2, i32 0, i32 0
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @foo_char(i16 %0) {
%2 = trunc i16 %0 to i8
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void recurse() {
  static int depth = 0;
  printf("depth = %d\n", depth);
  depth++;
  recurse();
}


x86 assembly (clang, -O0):
<recurse>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0a(%rip),%esi
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
mov    0x2ef8(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eef(%rip)
call   1030 <recurse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurse>:
push   %rbx
mov    0x2f15(%rip),%esi
lea    0xee2(%rip),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2efe(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2ef5(%rip)
jmp    1120 <recurse+0x10>

LLVM IR (-O0):
@recurse.depth = internal global i32 0
@.str = [12 x i8] c"depth = %d\0A\00"
define void @recurse() {
%1 = load i32, i32* @recurse.depth
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @recurse.depth
%4 = add nsw i32 %3, 1
store i32 %4, i32* @recurse.depth
ret void
}

LLVM IR (-O2):
@recurse.depth = internal unnamed_addr global i32 0
@.str = [12 x i8] c"depth = %d\0A\00"
define void @recurse() {
%1 = load i32, i32* @recurse.depth
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ %6, %2 ], [ %1, %0 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @recurse.depth
%6 = add nsw i32 %5, 1
store i32 %6, i32* @recurse.depth
br label %2
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int clock_t;

/* Variables and functions */
__attribute__((__weak__)) clock_t _times(struct tms *buf
                                         __attribute__((unused))) {
  return -1;
}


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

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

LLVM IR (-O0):
%struct.tms = type { i32 }
define weak i32 @_times(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define weak i32 @_times(%struct.tms* %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int myFunc(int i) {
  i += 1;
  printf("[htf] myFunc() line: %d.\n", 24);
  return i * 3;
}


x86 assembly (clang, -O0):
<myFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x18,%esi
call   1030 <printf@plt>
imul   $0x3,-0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myFunc>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    $0x18,%esi
call   1030 <printf@plt>
lea    (%rbx,%rbx,2),%eax
add    $0x3,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"[htf] myFunc() line: %d.\0A\00"
define i32 @myFunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 24)
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 3
ret i32 %7
}

LLVM IR (-O2):
@.str = [26 x i8] c"[htf] myFunc() line: %d.\0A\00"
define i32 @myFunc(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 24)
%3 = mul i32 %0, 3
%4 = add i32 %3, 3
ret i32 %4
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ fnmatch(char *, char *, int);
int do_path(char *path, char *pattern) {
  int flags = 0;
  if (fnmatch(pattern, path, flags) == 0) {
    return EXIT_SUCCESS;
  }
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<do_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <fnmatch@plt>
cmp    $0x0,%rax
jne    1152 <do_path+0x42>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <do_path+0x4e>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_path>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
xor    %edx,%edx
call   1030 <fnmatch@plt>
test   %rax,%rax
jne    112f <do_path+0x1f>
mov    0x2eab(%rip),%rax
jmp    1136 <do_path+0x26>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @do_path(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = call i64 @fnmatch(i8* %7, i8* %8, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i32, i32* @EXIT_SUCCESS
store i32 %13, i32* %3
br label %16
14: ; preds = %2
%15 = load i32, i32* @EXIT_FAILURE
store i32 %15, i32* %3
br label %16
16: ; preds = %14, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @do_path(i8* %0, i8* %1) {
%3 = tail call i64 @fnmatch(i8* %1, i8* %0, i32 0)
%4 = icmp eq i64 %3, 0
%5 = load i32, i32* @EXIT_SUCCESS
%6 = load i32, i32* @EXIT_FAILURE
%7 = select i1 %4, i32 %5, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void callme(int i) { printf("callme\n"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"callme\0A\00"
define void @callme(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"callme\00"
define void @callme(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_5Duint16_mem(unsigned short *val) {
  return ((*val) & (-0x5D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Duint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffffa3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Duint16_mem>:
movzwl (%rdi),%eax
test   $0xffa3,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Duint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -93
%7 = icmp ne i32 %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_5Duint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -93
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char);
void byteBaseHexadecimalPut(FILE *fd, unsigned char byte) {
  fprintf(fd, "%02X", byte);
}


x86 assembly (clang, -O0):
<byteBaseHexadecimalPut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteBaseHexadecimalPut>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%02X\00"
define void @byteBaseHexadecimalPut(i32* %0, i8 zeroext %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 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02X\00"
define void @byteBaseHexadecimalPut(i32* nocapture %0, i8 zeroext %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
int testaMult3e7(int num) {
  if (((num % 3) == 0) || ((num % 7) == 0))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<testaMult3e7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     112f <testaMult3e7+0x2f>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113b <testaMult3e7+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <testaMult3e7+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testaMult3e7>:
imul   $0xaaaaaaab,%edi,%eax
add    $0x2aaaaaaa,%eax
cmp    $0x55555555,%eax
setb   %al
imul   $0xb6db6db7,%edi,%ecx
add    $0x12492492,%ecx
cmp    $0x24924925,%ecx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @testaMult3e7(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 3
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 7
%10 = icmp eq i32 %9, 0
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 @testaMult3e7(i32 %0) {
%2 = srem i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 7
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ jenkins_hash_uint32(int /*<<< orphan*/);
uint32_t jenkins_hash_int32(int32_t x) { return jenkins_hash_uint32(x); }


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

x86 assembly (clang, -O2):
<jenkins_hash_int32>:
jmp    1030 <jenkins_hash_uint32@plt>

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

LLVM IR (-O2):
define i32 @jenkins_hash_int32(i32 %0) {
%2 = tail call i32 @jenkins_hash_uint32(i32 %0)
ret i32 %2
}