xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void *s_malloc(size_t size) {
  void *retval;
  retval = malloc(size);
  if (!retval) {
    fprintf(stderr, "Fatal system error : %s", strerror(errno));
    exit(-2);
  };
  return retval;
}


x86 assembly (clang, -O0):
<s_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    119a <s_malloc+0x5a>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rdx
lea    0xe75(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_malloc>:
push   %rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     114d <s_malloc+0xd>
pop    %rbx
ret
mov    0x2e8c(%rip),%rax
mov    (%rax),%ebx
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe95(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Fatal system error : %s\00"
@errno = global i32 0
define i8* @s_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* @errno
%11 = call i8* @strerror(i32 %10)
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 -2)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Fatal system error : %s\00"
@errno = global i32 0
define noalias i8* @s_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i32 @exit(i32 -2)
unreachable
10: ; preds = %1
ret i8* %2
}
/* Variables and functions */
float const expf(float);
float gaussian_dx(float const sigma, float const x) {
  float const u = x / sigma;
  return -u / sigma * expf(-0.5f * u * u);
}


x86 assembly (clang, -O0):
<gaussian_dx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
divss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xeab(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
call   1030 <expf@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaussian_dx>:
sub    $0x18,%rsp
divss  %xmm0,%xmm1
movaps 0xee1(%rip),%xmm2
xorps  %xmm1,%xmm2
divss  %xmm0,%xmm2
movaps %xmm2,(%rsp)
movss  0xede(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
call   1030 <expf@plt>
mulss  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @gaussian_dx(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %4
%7 = load float, float* %3
%8 = fdiv float %6, %7
store float %8, float* %5
%9 = load float, float* %5
%10 = fneg float %9
%11 = load float, float* %3
%12 = fdiv float %10, %11
%13 = load float, float* %5
%14 = fmul float -5.000000e-01, %13
%15 = load float, float* %5
%16 = fmul float %14, %15
%17 = call float @expf(float %16)
%18 = fmul float %12, %17
ret float %18
}

LLVM IR (-O2):
define float @gaussian_dx(float %0, float %1) {
%3 = fdiv float %1, %0
%4 = fneg float %3
%5 = fdiv float %4, %0
%6 = fmul float %3, -5.000000e-01
%7 = fmul float %3, %6
%8 = tail call float @expf(float %7)
%9 = fmul float %5, %8
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ vt100_EscSeq0(unsigned char *, long long);
void vt100_SCP(void) { vt100_EscSeq0((unsigned char *)"s", (long long)2); }


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

x86 assembly (clang, -O2):
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <vt100_EscSeq0@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"s\00"
define void @vt100_SCP() {
%1 = call i32 @vt100_EscSeq0(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 2)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"s\00"
define void @vt100_SCP() {
%1 = tail call i32 @vt100_EscSeq0(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 2)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int hash_rot(int, int);
uint32_t mhash_add__(uint32_t hash, uint32_t data) {
  data *= 0xcc9e2d51;
  data = hash_rot(data, 15);
  data *= 0x1b873593;
  return hash ^ data;
}


x86 assembly (clang, -O0):
<mhash_add__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0xcc9e2d51,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0xf,%esi
call   1030 <hash_rot@plt>
mov    %eax,-0x8(%rbp)
imul   $0x1b873593,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mhash_add__>:
push   %rbx
mov    %edi,%ebx
imul   $0xcc9e2d51,%esi,%edi
mov    $0xf,%esi
call   1030 <hash_rot@plt>
imul   $0x1b873593,%eax,%eax
xor    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mhash_add__(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = mul i32 %5, -862048943
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @hash_rot(i32 %7, i32 15)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = mul nsw i32 %9, 461845907
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = xor i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @mhash_add__(i32 %0, i32 %1) {
%3 = mul i32 %1, -862048943
%4 = tail call i32 @hash_rot(i32 %3, i32 15)
%5 = mul nsw i32 %4, 461845907
%6 = xor i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ arg_int2(int, int);
void arg_int1(int i) { arg_int2(i, i + 1); }


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

x86 assembly (clang, -O2):
<arg_int1>:
lea    0x1(%rdi),%esi
jmp    1030 <arg_int2@plt>

LLVM IR (-O0):
define void @arg_int1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = call i32 @arg_int2(i32 %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @arg_int1(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @arg_int2(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
int /*<<< orphan*/ set_halt_until_mbus_rx();
int /*<<< orphan*/ set_halt_until_mbus_tx();
int /*<<< orphan*/ set_pmu_sar_override(int);
void flash_turn_on() {
  set_pmu_sar_override(48);
  set_halt_until_mbus_rx();
  mbus_remote_register_write(0x7, 0x11, 0x00003F);
  set_halt_until_mbus_tx();
}


x86 assembly (clang, -O0):
<flash_turn_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30,%edi
call   1030 <set_pmu_sar_override@plt>
mov    $0x0,%al
call   1040 <set_halt_until_mbus_rx@plt>
mov    $0x7,%edi
mov    $0x11,%esi
mov    $0x3f,%edx
call   1060 <mbus_remote_register_write@plt>
mov    $0x0,%al
call   1050 <set_halt_until_mbus_tx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_turn_on>:
push   %rax
mov    $0x30,%edi
call   1030 <set_pmu_sar_override@plt>
xor    %eax,%eax
call   1040 <set_halt_until_mbus_rx@plt>
mov    $0x7,%edi
mov    $0x11,%esi
mov    $0x3f,%edx
call   1060 <mbus_remote_register_write@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <set_halt_until_mbus_tx@plt>

LLVM IR (-O0):
define void @flash_turn_on() {
%1 = call i32 @set_pmu_sar_override(i32 48)
%2 = call i32 (...) @set_halt_until_mbus_rx()
%3 = call i32 @mbus_remote_register_write(i32 7, i32 17, i32 63)
%4 = call i32 (...) @set_halt_until_mbus_tx()
ret void
}

LLVM IR (-O2):
define void @flash_turn_on() {
%1 = tail call i32 @set_pmu_sar_override(i32 48)
%2 = tail call i32 (...) @set_halt_until_mbus_rx()
%3 = tail call i32 @mbus_remote_register_write(i32 7, i32 17, i32 63)
%4 = tail call i32 (...) @set_halt_until_mbus_tx()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_bpm_lower_bound();
int /*<<< orphan*/ test_bpm_nominal_value();
int /*<<< orphan*/ test_bpm_upper_bound();
void execute_tests() {
  test_bpm_upper_bound();
  test_bpm_lower_bound();
  test_bpm_nominal_value();
}


x86 assembly (clang, -O0):
<execute_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_bpm_upper_bound@plt>
mov    $0x0,%al
call   1050 <test_bpm_lower_bound@plt>
mov    $0x0,%al
call   1040 <test_bpm_nominal_value@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_tests>:
push   %rax
xor    %eax,%eax
call   1030 <test_bpm_upper_bound@plt>
xor    %eax,%eax
call   1050 <test_bpm_lower_bound@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_bpm_nominal_value@plt>

LLVM IR (-O0):
define void @execute_tests() {
%1 = call i32 (...) @test_bpm_upper_bound()
%2 = call i32 (...) @test_bpm_lower_bound()
%3 = call i32 (...) @test_bpm_nominal_value()
ret void
}

LLVM IR (-O2):
define void @execute_tests() {
%1 = tail call i32 (...) @test_bpm_upper_bound()
%2 = tail call i32 (...) @test_bpm_lower_bound()
%3 = tail call i32 (...) @test_bpm_nominal_value()
ret void
}
int gi1(int j, unsigned char *b, int i) { return j + b[i]; }


x86 assembly (clang, -O0):
<gi1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gi1>:
movslq %edx,%rax
movzbl (%rsi,%rax,1),%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @gi1(i32 %0, i8* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = add nsw i32 %7, %0
ret i32 %8
}
fallowc(c) char c;
{ return 0; }


x86 assembly (clang, -O0):
<fallowc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fallowc(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @fallowc(i32 %0) {
ret i32 0
}
/* Variables and functions */
int PAPI_accum_counters(long long *, int);
void papif_accum_counters_(long long *values, int *array_len, int *check) {
  *check = PAPI_accum_counters(values, *array_len);
}


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

x86 assembly (clang, -O2):
<papif_accum_counters_>:
push   %rbx
mov    %rdx,%rbx
mov    (%rsi),%esi
call   1030 <PAPI_accum_counters@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_accum_counters_(i64* %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @PAPI_accum_counters(i64* %0, i32 %4)
store i32 %5, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
char *normalize(char *);
int /*<<< orphan*/ sflap_send(char *, int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void serv_add_buddy(char *name) {
  char buf[1024];
  snprintf(buf, sizeof(buf), "toc_add_buddy %s", normalize(name));
  sflap_send(buf, -1, 2);
}


x86 assembly (clang, -O0):
<serv_add_buddy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x418(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <normalize@plt>
mov    -0x418(%rbp),%rdi
mov    %rax,%rcx
mov    $0x400,%esi
lea    0xe94(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x410(%rbp),%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1050 <sflap_send@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serv_add_buddy>:
push   %rbx
sub    $0x400,%rsp
call   1040 <normalize@plt>
lea    0xebc(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %rax,%rcx
call   1030 <snprintf@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0x2,%edx
call   1050 <sflap_send@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"toc_add_buddy %s\00"
define void @serv_add_buddy(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i8* @normalize(i8* %5)
%7 = call i32 @snprintf(i8* %4, i32 1024, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = call i32 @sflap_send(i8* %8, i32 -1, i32 2)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"toc_add_buddy %s\00"
define void @serv_add_buddy(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i8* @normalize(i8* %0)
%5 = call i32 @snprintf(i8* %3, i32 1024, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @sflap_send(i8* %3, i32 -1, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ register_io();
void register_std() { register_io(); }


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

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

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

LLVM IR (-O2):
define void @register_std() {
%1 = tail call i32 (...) @register_io()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int /*<<< orphan*/ executeSQLCommand(int /*<<< orphan*/ *, char *);
char *sqlite3_mprintf(char *, int, char *, char *);
void addUser(sqlite3 *db, int isAdmin, char *username, char *password) {
  char *sql =
      sqlite3_mprintf("Insert into Database values "
                      "((Select max(ID) From Database)+1, %d, '%q', '%q');",
                      isAdmin, username, password);
  executeSQLCommand(db, sql);
}


x86 assembly (clang, -O0):
<addUser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xeb7(%rip),%rdi
call   1040 <sqlite3_mprintf@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <executeSQLCommand@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addUser>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <sqlite3_mprintf@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <executeSQLCommand@plt>

LLVM IR (-O0):
@.str = [80 x i8] c"Insert into Database values ((Select max(ID) From Database)+1, %d, '%q', '%q');\00"
define void @addUser(i32* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i8* @sqlite3_mprintf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %11, i8* %12)
store i8* %13, i8** %9
%14 = load i32*, i32** %5
%15 = load i8*, i8** %9
%16 = call i32 @executeSQLCommand(i32* %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [80 x i8] c"Insert into Database values ((Select max(ID) From Database)+1, %d, '%q', '%q');\00"
define void @addUser(i32* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i8* @sqlite3_mprintf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2, i8* %3)
%6 = tail call i32 @executeSQLCommand(i32* %0, i8* %5)
ret void
}
int iszero(void *ptr, int n) {
  char *bptr = (char *)ptr;
  while (n--)
    if (*bptr++) {
      return 0;
    }
  return 1;
}


x86 assembly (clang, -O0):
<iszero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1150 <iszero+0x50>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
cmpb   $0x0,(%rax)
je     114b <iszero+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1157 <iszero+0x57>
jmp    1113 <iszero+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iszero>:
mov    %esi,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    %ecx,%eax
je     1121 <iszero+0x21>
cmpb   $0x0,(%rdi,%rcx,1)
lea    0x1(%rcx),%rcx
je     1110 <iszero+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @iszero(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i32 [ %1, %2 ], [ %8, %7 ]
%5 = phi i8* [ %0, %2 ], [ %9, %7 ]
%6 = icmp eq i32 %4, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = getelementptr inbounds i8, i8* %5, i64 1
%10 = load i8, i8* %5
%11 = icmp eq i8 %10, 0
br i1 %11, label %3, label %12
12: ; preds = %3, %7
%13 = phi i32 [ 0, %7 ], [ 1, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ interface_fatal(char *, int const, char const *);
void theme_parse_error(const int line, const char *msg) {
  interface_fatal("Parse error in theme file line %d: %s", line, msg);
}


x86 assembly (clang, -O0):
<theme_parse_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <interface_fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<theme_parse_error>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <interface_fatal@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Parse error in theme file line %d: %s\00"
define void @theme_parse_error(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @interface_fatal(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Parse error in theme file line %d: %s\00"
define void @theme_parse_error(i32 %0, i8* %1) {
%3 = tail call i32 @interface_fatal(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bcm2835_gpio_clr_multi(int);
int /*<<< orphan*/ bcm2835_gpio_set_multi(int);
void bcm2835_gpio_write_mask(uint32_t value, uint32_t mask) {
  bcm2835_gpio_set_multi(value & mask);
  bcm2835_gpio_clr_multi((~value) & mask);
}


x86 assembly (clang, -O0):
<bcm2835_gpio_write_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
and    -0x8(%rbp),%edi
call   1030 <bcm2835_gpio_set_multi@plt>
mov    -0x4(%rbp),%edi
xor    $0xffffffff,%edi
and    -0x8(%rbp),%edi
call   1040 <bcm2835_gpio_clr_multi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcm2835_gpio_write_mask>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
and    %ebp,%edi
call   1030 <bcm2835_gpio_set_multi@plt>
not    %ebp
and    %ebx,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <bcm2835_gpio_clr_multi@plt>

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

LLVM IR (-O2):
define void @bcm2835_gpio_write_mask(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = tail call i32 @bcm2835_gpio_set_multi(i32 %3)
%5 = xor i32 %0, -1
%6 = and i32 %5, %1
%7 = tail call i32 @bcm2835_gpio_clr_multi(i32 %6)
ret void
}
/* Variables and functions */
int munmap(void *, size_t);
int memzone_unmap(void *addr, size_t len) { return (munmap(addr, len)); }


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

x86 assembly (clang, -O2):
<memzone_unmap>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define i32 @memzone_unmap(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret i32 %3
}
dotname(s) char *s;
{
  if (s[0] == '.')
    if (s[1] == '.')
      if (s[2] == '\0')
        return (1);
      else
        return (0);
    else if (s[1] == '\0')
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<dotname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1179 <dotname+0x79>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2e,%eax
jne    1152 <dotname+0x52>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
jne    1146 <dotname+0x46>
movl   $0x1,-0x4(%rbp)
jmp    1180 <dotname+0x80>
movl   $0x0,-0x4(%rbp)
jmp    1180 <dotname+0x80>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    116f <dotname+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    1180 <dotname+0x80>
jmp    1174 <dotname+0x74>
jmp    1179 <dotname+0x79>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotname>:
cmpb   $0x2e,(%rdi)
jne    111a <dotname+0x1a>
mov    0x1(%rdi),%al
test   %al,%al
je     111d <dotname+0x1d>
cmp    $0x2e,%al
jne    111a <dotname+0x1a>
xor    %eax,%eax
cmpb   $0x0,0x2(%rdi)
sete   %al
ret
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @dotname(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 46
br i1 %8, label %9, label %32
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 46
br i1 %14, label %15, label %23
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %15
store i32 1, i32* %2
br label %33
22: ; preds = %15
store i32 0, i32* %2
br label %33
23: ; preds = %9
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 1
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %23
store i32 1, i32* %2
br label %33
30: ; preds = %23
br label %31
31: ; preds = %30
br label %32
32: ; preds = %31, %1
store i32 0, i32* %2
br label %33
33: ; preds = %32, %29, %22, %21
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @dotname(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
switch i8 %6, label %12 [
i8 46, label %7
i8 0, label %13
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i32
br label %13
12: ; preds = %4, %1
br label %13
13: ; preds = %4, %7, %12
%14 = phi i32 [ 0, %12 ], [ %11, %7 ], [ 1, %4 ]
ret i32 %14
}
int dict_eq_int(const int *key1, const int *key2) { return *key1 == *key2; }


x86 assembly (clang, -O0):
<dict_eq_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dict_eq_int>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @dict_eq_int(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = icmp eq i32 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @dict_eq_int(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct xrow_header {
  int dummy;
};
struct tt_uuid {
  int dummy;
};

/* Variables and functions */
void xrow_decode_sudirribe(struct xrow_header *, int /*<<< orphan*/ *,
                           struct tt_uuid *, int /*<<< orphan*/ *);
void xrow_decode_join(struct xrow_header *row, struct tt_uuid *server_uuid) {
  return xrow_decode_sudirribe(row, NULL, server_uuid, NULL);
}


x86 assembly (clang, -O0):
<xrow_decode_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rsi
call   1030 <xrow_decode_sudirribe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrow_decode_join>:
mov    %rsi,%rdx
xor    %esi,%esi
xor    %ecx,%ecx
jmp    1030 <xrow_decode_sudirribe@plt>

LLVM IR (-O0):
%struct.xrow_header = type { i32 }
%struct.tt_uuid = type { i32 }
define void @xrow_decode_join(%struct.xrow_header* %0, %struct.tt_uuid* %1) {
%3 = alloca %struct.xrow_header*
%4 = alloca %struct.tt_uuid*
store %struct.xrow_header* %0, %struct.xrow_header** %3
store %struct.tt_uuid* %1, %struct.tt_uuid** %4
%5 = load %struct.xrow_header*, %struct.xrow_header** %3
%6 = load %struct.tt_uuid*, %struct.tt_uuid** %4
ret void
}

LLVM IR (-O2):
%struct.xrow_header = type { i32 }
%struct.tt_uuid = type { i32 }
define void @xrow_decode_join(%struct.xrow_header* %0, %struct.tt_uuid* %1) {
tail call void @xrow_decode_sudirribe(%struct.xrow_header* %0, i32* null, %struct.tt_uuid* %1, i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mesh;

/* Variables and functions */
size_t get_grid_point_single_mesh(const int address[3], const int mesh[3]) {
  return (address[2] * mesh[0] * (size_t)(mesh[1]) + address[1] * mesh[0] +
          address[0]);
}


x86 assembly (clang, -O0):
<get_grid_point_single_mesh>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x10(%rbp),%rcx
imul   (%rcx),%eax
cltq
mov    -0x10(%rbp),%rcx
movslq 0x4(%rcx),%rcx
imul   %rcx,%rax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
imul   (%rdx),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
movslq (%rcx),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_grid_point_single_mesh>:
movslq 0x8(%rdi),%rax
movslq (%rsi),%rcx
imul   %rcx,%rax
movslq 0x4(%rsi),%rdx
imul   %rax,%rdx
movslq 0x4(%rdi),%rsi
imul   %rcx,%rsi
add    %rdx,%rsi
movslq (%rdi),%rax
add    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @get_grid_point_single_mesh(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 = getelementptr inbounds i32, i32* %5, i64 2
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = mul nsw i32 %7, %10
%12 = sext i32 %11 to i64
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = sext i32 %15 to i64
%17 = mul i64 %12, %16
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 0
%23 = load i32, i32* %22
%24 = mul nsw i32 %20, %23
%25 = sext i32 %24 to i64
%26 = add i64 %17, %25
%27 = load i32*, i32** %3
%28 = getelementptr inbounds i32, i32* %27, i64 0
%29 = load i32, i32* %28
%30 = sext i32 %29 to i64
%31 = add i64 %26, %30
ret i64 %31
}

LLVM IR (-O2):
define i64 @get_grid_point_single_mesh(i32* nocapture %0, i32* nocapture %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 2
%4 = load i32, i32* %3
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %1, i64 1
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = mul nsw i64 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 1
%13 = load i32, i32* %12
%14 = mul nsw i32 %13, %5
%15 = sext i32 %14 to i64
%16 = add nsw i64 %11, %15
%17 = load i32, i32* %0
%18 = sext i32 %17 to i64
%19 = add nsw i64 %16, %18
ret i64 %19
}
unsigned hexval(int c) {
  if ('0' <= c && c <= '9')
    return (unsigned)(c - '0');
  else if ('a' <= c && c <= 'f')
    return (unsigned)(c - 'a' + 10);
  else if ('A' <= c && c <= 'F')
    return (unsigned)(c - 'A' + 10);
  else
    return 0;
}


x86 assembly (clang, -O0):
<hexval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x30,%eax
cmp    -0x8(%rbp),%eax
jg     112d <hexval+0x2d>
cmpl   $0x39,-0x8(%rbp)
jg     112d <hexval+0x2d>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <hexval+0x86>
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     1156 <hexval+0x56>
cmpl   $0x66,-0x8(%rbp)
jg     1156 <hexval+0x56>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <hexval+0x86>
mov    $0x41,%eax
cmp    -0x8(%rbp),%eax
jg     117f <hexval+0x7f>
cmpl   $0x46,-0x8(%rbp)
jg     117f <hexval+0x7f>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <hexval+0x86>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexval>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1124 <hexval+0x24>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <hexval+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%ecx
add    $0xffffffc9,%edi
xor    %eax,%eax
cmp    $0x6,%ecx
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @hexval(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sle i32 97, %13
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 102
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 97
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sle i32 65, %23
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 70
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 65
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 0, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @hexval(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -97
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -87
br label %14
9: ; preds = %4
%10 = add i32 %0, -65
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -55
%13 = select i1 %11, i32 %12, i32 0
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ init_io();
int /*<<< orphan*/ spi_read(int, int, int);
void stub1();
main() {
  void *up;
  init_io();
  spi_read(0x2000, 0x18000, 0xd1000000);
  ((void (*)())0xd1000000)();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <init_io@plt>
mov    $0x2000,%edi
mov    $0x18000,%esi
mov    $0xd1000000,%edx
call   1030 <spi_read@plt>
mov    $0xd1000000,%ecx
mov    $0x0,%al
call   *%rcx
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init_io@plt>
mov    $0x2000,%edi
mov    $0x18000,%esi
mov    $0xd1000000,%edx
call   1030 <spi_read@plt>
mov    $0xd1000000,%ecx
xor    %eax,%eax
call   *%rcx
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
%2 = call i32 (...) @init_io()
%3 = call i32 @spi_read(i32 8192, i32 98304, i32 -788529152)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init_io()
%2 = tail call i32 @spi_read(i32 8192, i32 98304, i32 -788529152)
tail call void (...) inttoptr (i64 3506438144 to void (...)*)()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void die(void) {
  perror("FATAL");
  exit(2);
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"FATAL\00"
define void @die() {
%1 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"FATAL\00"
define void @die() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int consecones(long long);
long long convertToBinary(long long);
long long int findNextBinary(long long int dec, long long int bin, int dig) {
  int consec = 0;
  long long int newBin = 0;
  while (consec != dig) {
    consec = consecones(bin);
    newBin = bin;
    dec++;
    bin = convertToBinary(dec);
  }
  return newBin;
}


x86 assembly (clang, -O0):
<findNextBinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1180 <findNextBinary+0x60>
mov    -0x10(%rbp),%rdi
call   1040 <consecones@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <convertToBinary@plt>
mov    %rax,-0x10(%rbp)
jmp    1142 <findNextBinary+0x22>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findNextBinary>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
je     1161 <findNextBinary+0x41>
mov    %edx,%r14d
mov    %rsi,%rax
mov    %rdi,%rbx
add    $0x1,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rax,%rbp
mov    %rax,%rdi
call   1040 <consecones@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1030 <convertToBinary@plt>
add    $0x1,%rbx
cmp    %r14d,%r15d
jne    1140 <findNextBinary+0x20>
jmp    1163 <findNextBinary+0x43>
xor    %ebp,%ebp
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @findNextBinary(i64 %0, i64 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %3, %5
%6 = phi i64 [ %9, %5 ], [ %0, %3 ]
%7 = phi i64 [ %10, %5 ], [ %1, %3 ]
%8 = tail call i32 @consecones(i64 %7)
%9 = add nsw i64 %6, 1
%10 = tail call i64 @convertToBinary(i64 %9)
%11 = icmp eq i32 %8, %2
br i1 %11, label %12, label %5
12: ; preds = %5, %3
%13 = phi i64 [ 0, %3 ], [ %7, %5 ]
ret i64 %13
}
void vibro_bump(float level) {}


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

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

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

LLVM IR (-O2):
define void @vibro_bump(float %0) {
ret void
}
void _infix_operator_mult_i8_i8(signed char lhs, signed char rhs,
                                signed char *__rval_1) {
  *__rval_1 = lhs * rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_mult_i8_i8>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
imul   %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_mult_i8_i8>:
mov    %esi,%eax
mul    %dil
mov    %al,(%rdx)
ret

LLVM IR (-O0):
define void @_infix_operator_mult_i8_i8(i8 signext %0, i8 signext %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8*
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = mul nsw i32 %8, %10
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %6
store i8 %12, i8* %13
ret void
}

LLVM IR (-O2):
define void @_infix_operator_mult_i8_i8(i8 signext %0, i8 signext %1, i8* nocapture writeonly %2) {
%4 = mul i8 %1, %0
store i8 %4, i8* %2
ret void
}
int left_child(int parent) {
  int left_child = parent * 2;
  return left_child;
}


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

x86 assembly (clang, -O2):
<left_child>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @left_child(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
char *strchr(char *, char);
char *split_space(char *line) {
  line = strchr(line, ' ');
  if (line == NULL)
    return NULL;
  *line = '\0';
  line++;
  return line;
}


x86 assembly (clang, -O0):
<split_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <split_space+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1161 <split_space+0x51>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<split_space>:
push   %rax
mov    $0x20,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1129 <split_space+0x19>
movb   $0x0,(%rax)
add    $0x1,%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @split_space(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 32)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
store i8 0, i8* %2
%5 = getelementptr inbounds i8, i8* %2, i64 1
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ const *);
int be64toh(int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
uint64_t knot_wire_read_u48(const uint8_t *pos) {
  assert(pos);
  uint64_t input = 0;
  memcpy((uint8_t *)&input + 1, pos, 6);
  return be64toh(input) >> 8;
}


x86 assembly (clang, -O0):
<knot_wire_read_u48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
movl   $0x0,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
add    $0x4,%rdi
mov    -0x8(%rbp),%rsi
mov    $0x6,%edx
call   1050 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1040 <be64toh@plt>
sar    $0x8,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<knot_wire_read_u48>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <assert@plt>
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x6,%edx
call   1050 <memcpy@plt>
mov    0xc(%rsp),%edi
call   1040 <be64toh@plt>
sar    $0x8,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @knot_wire_read_u48(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @assert(i32* %4)
store i32 0, i32* %3
%6 = getelementptr inbounds i32, i32* %3, i64 1
%7 = load i32*, i32** %2
%8 = call i32 @memcpy(i32* %6, i32* %7, i32 6)
%9 = load i32, i32* %3
%10 = call i32 @be64toh(i32 %9)
%11 = ashr i32 %10, 8
ret i32 %11
}

LLVM IR (-O2):
define i32 @knot_wire_read_u48(i32* %0) {
%2 = alloca i32
%3 = tail call i32 @assert(i32* %0)
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = getelementptr inbounds i32, i32* %2, i64 1
%6 = call i32 @memcpy(i32* %5, i32* %0, i32 6)
%7 = load i32, i32* %2
%8 = call i32 @be64toh(i32 %7)
%9 = ashr i32 %8, 8
ret i32 %9
}
void __attribute__((no, noclone)) foo(int j, int n, int *a) {
#pragma omp parallel
  {
#pragma omp single
    {
      int i;
#pragma omp target
#pragma omp teams
#pragma omp distribute parallel for shared(a) firstprivate(n) private(i)       \
    firstprivate(j)
      for (i = j + 1; i < n; i += 3)
        a[i] = i;
    }
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113f <foo+0x3f>
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <foo+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
add    $0x1,%edi
cmp    %esi,%edi
jge    111c <foo+0x1c>
movslq %edi,%rax
movslq %esi,%rcx
nopl   (%rax)
mov    %eax,(%rdx,%rax,4)
add    $0x3,%rax
cmp    %rcx,%rax
jl     1110 <foo+0x10>
ret

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

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = add i32 %0, 1
%5 = icmp slt i32 %4, %1
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = sext i32 %4 to i64
%8 = sext i32 %1 to i64
br label %9
9: ; preds = %6, %9
%10 = phi i64 [ %7, %6 ], [ %13, %9 ]
%11 = getelementptr inbounds i32, i32* %2, i64 %10
%12 = trunc i64 %10 to i32
store i32 %12, i32* %11
%13 = add nsw i64 %10, 3
%14 = icmp slt i64 %13, %8
br i1 %14, label %9, label %15
15: ; preds = %9, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int ph_unknown_udp_destroy(void *handler) {
  free(handler);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ph_unknown_udp_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}