xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Log(char *, char *);
int sscanf(char *, char *, float *, float *);
int DoTexrep(char *s) {
  float texrep[2];
  if (2 != sscanf(s, "%f %f", &texrep[0], &texrep[1]))
    Log("DoTextrep: Illegal texrep record: %s", s);
  return 0;
}


x86 assembly (clang, -O0):
<DoTexrep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rdx
lea    -0x10(%rbp),%rcx
add    $0x4,%rcx
lea    0xebd(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,%ecx
mov    $0x2,%eax
cmp    %ecx,%eax
je     1167 <DoTexrep+0x47>
mov    -0x8(%rbp),%rsi
lea    0xea4(%rip),%rdi
call   1040 <Log@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoTexrep>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rcx
lea    0xecc(%rip),%rsi
lea    0x8(%rsp),%rdx
call   1030 <sscanf@plt>
cmp    $0x2,%eax
je     1152 <DoTexrep+0x32>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
call   1040 <Log@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [37 x i8] c"DoTextrep: Illegal texrep record: %s\00"
define i32 @DoTexrep(i8* %0) {
%2 = alloca i8*
%3 = alloca [2 x float]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 0
%6 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 1
%7 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %5, float* %6)
%8 = icmp ne i32 2, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @Log(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %1
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [37 x i8] c"DoTextrep: Illegal texrep record: %s\00"
define i32 @DoTexrep(i8* %0) {
%2 = alloca [2 x float]
%3 = bitcast [2 x float]* %2 to i8*
%4 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
%5 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 1
%6 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %4, float* %5)
%7 = icmp eq i32 %6, 2
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @Log(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %10
10: ; preds = %8, %1
ret i32 0
}
void endPrefixMapping(char *prefix) {
  if (prefix == (void *)0)
    prefix = "@@@@ BAD NULL";
  printf("endPrefixMapping...prefix=%s\n", prefix);
}


x86 assembly (clang, -O0):
<endPrefixMapping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1132 <endPrefixMapping+0x22>
lea    0xed2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endPrefixMapping>:
test   %rdi,%rdi
lea    0xee6(%rip),%rsi
cmovne %rdi,%rsi
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"@@@@ BAD NULL\00"
@.str.1 = [30 x i8] c"endPrefixMapping...prefix=%s\0A\00"
define void @endPrefixMapping(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %6
6: ; preds = %5, %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"@@@@ BAD NULL\00"
@.str.1 = [30 x i8] c"endPrefixMapping...prefix=%s\0A\00"
define void @endPrefixMapping(i8* %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int genrand_int32();
uint8_t prng_rand_byte(void) {
  uint32_t rand = 0;
  do {
    rand = genrand_int32() >> 23;
  } while (rand > 255);
  return rand;
}


x86 assembly (clang, -O0):
<prng_rand_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <genrand_int32@plt>
sar    $0x17,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jg     111f <prng_rand_byte+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prng_rand_byte>:
push   %rax
xor    %eax,%eax
call   1030 <genrand_int32@plt>
sar    $0x17,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @prng_rand_byte() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = call i32 (...) @genrand_int32()
%4 = ashr i32 %3, 23
store i32 %4, i32* %1
br label %5
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 255
br i1 %7, label %2, label %8
8: ; preds = %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @prng_rand_byte() {
%1 = tail call i32 (...) @genrand_int32()
%2 = ashr i32 %1, 23
ret i32 %2
}
/* Variables and functions */
void *CHICKEN_new_gc_root_2(int);
void *CHICKEN_new_finalizable_gc_root() { return CHICKEN_new_gc_root_2(1); }


x86 assembly (clang, -O0):
<CHICKEN_new_finalizable_gc_root>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <CHICKEN_new_gc_root_2@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @CHICKEN_new_finalizable_gc_root() {
%1 = call i8* @CHICKEN_new_gc_root_2(i32 1)
ret i8* %1
}

LLVM IR (-O2):
define i8* @CHICKEN_new_finalizable_gc_root() {
%1 = tail call i8* @CHICKEN_new_gc_root_2(i32 1)
ret i8* %1
}
/* Type definitions */
typedef int ushort;

/* Variables and functions */
unsigned char msg_send(int, unsigned char *, int);
unsigned char ANT_SetChannelPeriod(unsigned char chan, ushort period) {
  unsigned char buf[3];
  buf[0] = chan;
  buf[1] = period % 256;
  buf[2] = period / 256;
  return msg_send(0x43, buf, 3);
}


x86 assembly (clang, -O0):
<ANT_SetChannelPeriod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %al,-0x9(%rbp)
lea    -0xb(%rbp),%rsi
mov    $0x43,%edi
mov    $0x3,%edx
call   1030 <msg_send@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANT_SetChannelPeriod>:
push   %rax
mov    %dil,0x5(%rsp)
mov    %sil,0x6(%rsp)
lea    0xff(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %ah,0x7(%rsp)
lea    0x5(%rsp),%rsi
mov    $0x43,%edi
mov    $0x3,%edx
call   1030 <msg_send@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @ANT_SetChannelPeriod(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca [3 x i8]
store i8 %0, i8* %3
store i32 %1, i32* %4
%6 = load i8, i8* %3
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = load i32, i32* %4
%9 = srem i32 %8, 256
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 1
store i8 %10, i8* %11
%12 = load i32, i32* %4
%13 = sdiv i32 %12, 256
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 2
store i8 %14, i8* %15
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%17 = call zeroext i8 @msg_send(i32 67, i8* %16, i32 3)
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @ANT_SetChannelPeriod(i8 zeroext %0, i32 %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
store i8 %0, i8* %4
%5 = trunc i32 %1 to i8
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 %5, i8* %6
%7 = sdiv i32 %1, 256
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 %8, i8* %9
%10 = call zeroext i8 @msg_send(i32 67, i8* %4, i32 3)
ret i8 %10
}
/* Variables and functions */
scalar_t__ SEGGER_RTT_Read(unsigned int, char *, unsigned int);
int SEGGER_RTT_GetKey(void) {
  char c;
  int r;
  r = (int)SEGGER_RTT_Read(0u, &c, 1u);
  if (r == 1) {
    r = (int)(unsigned char)c;
  } else {
    r = -1;
  }
  return r;
}


x86 assembly (clang, -O0):
<SEGGER_RTT_GetKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <SEGGER_RTT_Read@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1141 <SEGGER_RTT_GetKey+0x31>
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <SEGGER_RTT_GetKey+0x38>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SEGGER_RTT_GetKey>:
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <SEGGER_RTT_Read@plt>
cmp    $0x1,%eax
movzbl 0x7(%rsp),%ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @SEGGER_RTT_GetKey() {
%1 = alloca i8
%2 = alloca i32
%3 = call i64 @SEGGER_RTT_Read(i32 0, i8* %1, i32 1)
%4 = trunc i64 %3 to i32
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i8, i8* %1
%9 = zext i8 %8 to i32
store i32 %9, i32* %2
br label %11
10: ; preds = %0
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @SEGGER_RTT_GetKey() {
%1 = alloca i8
%2 = call i64 @SEGGER_RTT_Read(i32 0, i8* %1, i32 1)
%3 = trunc i64 %2 to i32
%4 = icmp eq i32 %3, 1
%5 = load i8, i8* %1
%6 = zext i8 %5 to i32
%7 = select i1 %4, i32 %6, i32 -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(const char *progname) { printf("Usage:  ./conv_server portnum\n"); }


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

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

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

LLVM IR (-O2):
@str = [30 x i8] c"Usage: ./conv_server portnum\00"
define void @usage(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ prj_get_buildoptions();
int prj_getlistsize(void **);
int prj_get_numbuildoptions() {
  return prj_getlistsize((void **)prj_get_buildoptions());
}


x86 assembly (clang, -O0):
<prj_get_numbuildoptions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <prj_get_buildoptions@plt>
mov    %rax,%rdi
call   1030 <prj_getlistsize@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prj_get_numbuildoptions>:
push   %rax
xor    %eax,%eax
call   1040 <prj_get_buildoptions@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <prj_getlistsize@plt>

LLVM IR (-O0):
define i32 @prj_get_numbuildoptions() {
%1 = call i64 (...) @prj_get_buildoptions()
%2 = inttoptr i64 %1 to i8**
%3 = call i32 @prj_getlistsize(i8** %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @prj_get_numbuildoptions() {
%1 = tail call i64 (...) @prj_get_buildoptions()
%2 = inttoptr i64 %1 to i8**
%3 = tail call i32 @prj_getlistsize(i8** %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ mgrSendMessageToSndModule(int, char *, int /*<<< orphan*/ *);
int mgrPlayStop(int code, void *arg1, void *arg2) {
  ;
  mgrSendMessageToSndModule((8003), "/player/playback/stop", NULL);
  return 0;
}


x86 assembly (clang, -O0):
<mgrPlayStop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1f43,%edi
lea    0xed1(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <mgrSendMessageToSndModule@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mgrPlayStop>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1f43,%edi
xor    %edx,%edx
call   1030 <mgrSendMessageToSndModule@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"/player/playback/stop\00"
define i32 @mgrPlayStop(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @mgrSendMessageToSndModule(i32 8003, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"/player/playback/stop\00"
define i32 @mgrPlayStop(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @mgrSendMessageToSndModule(i32 8003, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32* null)
ret i32 0
}
/* Variables and functions */
scalar_t__ inw(int);
void mach_prepare_counter(void) {
  while (inw(0x5c))
    ;
}


x86 assembly (clang, -O0):
<mach_prepare_counter>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <mach_prepare_counter+0x9>
mov    $0x5c,%edi
call   1030 <inw@plt>
cmp    $0x0,%rax
je     1132 <mach_prepare_counter+0x22>
jmp    1119 <mach_prepare_counter+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mach_prepare_counter>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x5c,%edi
call   1030 <inw@plt>
test   %rax,%rax
jne    1120 <mach_prepare_counter+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @mach_prepare_counter() {
br label %1
1: ; preds = %4, %0
%2 = call i64 @inw(i32 92)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @mach_prepare_counter() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 @inw(i32 92)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
double exp(int /*<<< orphan*/);
int /*<<< orphan*/ log_combination_k_r(unsigned int, double);
double combination_k_r(unsigned int k, double r) {
  return exp(log_combination_k_r(k, r));
}


x86 assembly (clang, -O0):
<combination_k_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
call   1040 <log_combination_k_r@plt>
mov    %eax,%edi
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<combination_k_r>:
push   %rax
call   1040 <log_combination_k_r@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @combination_k_r(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
%5 = load i32, i32* %3
%6 = load double, double* %4
%7 = call i32 @log_combination_k_r(i32 %5, double %6)
%8 = call double @exp(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @combination_k_r(i32 %0, double %1) {
%3 = tail call i32 @log_combination_k_r(i32 %0, double %1)
%4 = tail call double @exp(i32 %3)
ret double %4
}
/* Variables and functions */
int _Nios2_ISR_Get_status_mask();
bool _Nios2_Has_internal_interrupt_controller(void) {
  return _Nios2_ISR_Get_status_mask() == 0xfffffffe;
}


x86 assembly (clang, -O0):
<_Nios2_Has_internal_interrupt_controller>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_Nios2_ISR_Get_status_mask@plt>
cmp    $0xfffffffe,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Nios2_Has_internal_interrupt_controller>:
push   %rax
xor    %eax,%eax
call   1030 <_Nios2_ISR_Get_status_mask@plt>
xor    %ecx,%ecx
cmp    $0xfffffffe,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_Nios2_Has_internal_interrupt_controller() {
%1 = call i32 (...) @_Nios2_ISR_Get_status_mask()
%2 = icmp eq i32 %1, -2
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @_Nios2_Has_internal_interrupt_controller() {
%1 = tail call i32 (...) @_Nios2_ISR_Get_status_mask()
%2 = icmp eq i32 %1, -2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int open(char const *, int);
int INT123_compat_open(const char *filename, int mode) {
  int ret;
  ret = open(filename, mode);
  return ret;
}


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

x86 assembly (clang, -O2):
<INT123_compat_open>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @INT123_compat_open(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int __aeabi_idivmod(int, int);
signed int __aeabi_idiv(signed int numerator, signed int denominator) {
  return __aeabi_idivmod(numerator, denominator);
}


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

x86 assembly (clang, -O2):
<__aeabi_idiv>:
jmp    1030 <__aeabi_idivmod@plt>

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

LLVM IR (-O2):
define i32 @__aeabi_idiv(i32 %0, i32 %1) {
%3 = tail call i32 @__aeabi_idivmod(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DirectIndexedXE0(int);
int /*<<< orphan*/ INC8(int /*<<< orphan*/);
void OpF6E0M1(void) { INC8(DirectIndexedXE0(3)); }


x86 assembly (clang, -O0):
<OpF6E0M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <DirectIndexedXE0@plt>
mov    %eax,%edi
call   1040 <INC8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpF6E0M1>:
push   %rax
mov    $0x3,%edi
call   1030 <DirectIndexedXE0@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <INC8@plt>

LLVM IR (-O0):
define void @OpF6E0M1() {
%1 = call i32 @DirectIndexedXE0(i32 3)
%2 = call i32 @INC8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OpF6E0M1() {
%1 = tail call i32 @DirectIndexedXE0(i32 3)
%2 = tail call i32 @INC8(i32 %1)
ret void
}
void SWAP_char(char *a, char *b) {
  char temp = *a;
  *a = *b;
  *b = temp;
}


x86 assembly (clang, -O0):
<SWAP_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SWAP_char>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @SWAP_char(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @SWAP_char(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
void nseel_asm_fcall_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_fcall_end() {
ret void
}
/* Variables and functions */
int S_IRUSR;
int S_IWUSR;
int __gen_tempname(char *, int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int mkstemps(char *template, int suffixlen) {
  return __gen_tempname(template, 0, 0, suffixlen, S_IRUSR | S_IWUSR);
}


x86 assembly (clang, -O0):
<mkstemps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    0x2eab(%rip),%rax
mov    (%rax),%r8d
mov    0x2eb1(%rip),%rax
or     (%rax),%r8d
xor    %edx,%edx
mov    %edx,%esi
call   1030 <__gen_tempname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkstemps>:
mov    %esi,%ecx
mov    0x2ebf(%rip),%rax
mov    0x2ec8(%rip),%rdx
mov    (%rdx),%r8d
or     (%rax),%r8d
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <__gen_tempname@plt>

LLVM IR (-O0):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define i32 @mkstemps(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = load i32, i32* @S_IRUSR
%8 = load i32, i32* @S_IWUSR
%9 = or i32 %7, %8
%10 = call i32 @__gen_tempname(i8* %5, i32 0, i32 0, i32 %6, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define i32 @mkstemps(i8* %0, i32 %1) {
%3 = load i32, i32* @S_IRUSR
%4 = load i32, i32* @S_IWUSR
%5 = or i32 %4, %3
%6 = tail call i32 @__gen_tempname(i8* %0, i32 0, i32 0, i32 %1, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ cffti1(int, double *, int *);
void cffti(int n, double wsave[]) {
  int iw1, iw2;
  if (n == 1)
    return;
  iw1 = 2 * n;
  iw2 = iw1 + 2 * n;
  cffti1(n, wsave + iw1, (int *)(wsave + iw2));
}


x86 assembly (clang, -O0):
<cffti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    112e <cffti+0x1e>
jmp    116b <cffti+0x5b>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
call   1030 <cffti1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cffti>:
cmp    $0x1,%edi
jne    1116 <cffti+0x6>
ret
lea    (%rdi,%rdi,1),%eax
lea    0x0(,%rdi,4),%ecx
cltq
lea    (%rsi,%rax,8),%rax
movslq %ecx,%rcx
lea    (%rsi,%rcx,8),%rdx
mov    %rax,%rsi
jmp    1030 <cffti1@plt>

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

LLVM IR (-O2):
define void @cffti(i32 %0, double* %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = shl nsw i32 %0, 1
%6 = shl nsw i32 %0, 2
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds double, double* %1, i64 %7
%9 = sext i32 %6 to i64
%10 = getelementptr inbounds double, double* %1, i64 %9
%11 = bitcast double* %10 to i32*
%12 = tail call i32 @cffti1(i32 %0, double* %8, i32* %11)
br label %13
13: ; preds = %2, %4
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dsum(int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dsum(N, x, stride);
  printf("sum: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%edx
call   1040 <stdlib_strided_dsum@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dsum@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dsum(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dsum(i32 4, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
void PGMPhysSimpleReadGCPtr(void) {}


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

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

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

LLVM IR (-O2):
define void @PGMPhysSimpleReadGCPtr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ comment();
int /*<<< orphan*/ nl();
int /*<<< orphan*/ ol(char *);
int /*<<< orphan*/ outstr(char *);
header() {
  comment();
  outstr("Small-c Compiler rev 1.1 re:NASM c0.1.5 Aug 2008");
  nl();
  ol("[MAP ALL SCCN.MAP]");
  ol("SECTION .text vstart=0100h");
  nl();
}


x86 assembly (clang, -O0):
<header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <comment@plt>
lea    0xeaa(%rip),%rdi
call   1040 <outstr@plt>
mov    $0x0,%al
call   1030 <nl@plt>
lea    0xec8(%rip),%rdi
call   1060 <ol@plt>
lea    0xecf(%rip),%rdi
call   1060 <ol@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<header>:
push   %rax
xor    %eax,%eax
call   1050 <comment@plt>
lea    0xeb1(%rip),%rdi
call   1040 <outstr@plt>
xor    %eax,%eax
call   1030 <nl@plt>
lea    0xecf(%rip),%rdi
call   1060 <ol@plt>
lea    0xed6(%rip),%rdi
call   1060 <ol@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Small-c Compiler rev 1.1 re:NASM c0.1.5 Aug 2008\00"
@.str.1 = [19 x i8] c"[MAP ALL SCCN.MAP]\00"
@.str.2 = [27 x i8] c"SECTION .text vstart=0100h\00"
define i32 @header() {
%1 = alloca i32
%2 = call i32 (...) @comment()
%3 = call i32 @outstr(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @nl()
%5 = call i32 @ol(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @ol(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (...) @nl()
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [49 x i8] c"Small-c Compiler rev 1.1 re:NASM c0.1.5 Aug 2008\00"
@.str.1 = [19 x i8] c"[MAP ALL SCCN.MAP]\00"
@.str.2 = [27 x i8] c"SECTION .text vstart=0100h\00"
define i32 @header() {
%1 = tail call i32 (...) @comment()
%2 = tail call i32 @outstr(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @nl()
%4 = tail call i32 @ol(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @ol(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (...) @nl()
ret i32 undef
}
void sde_rotator_put_sync_fence(struct sde_rot_sync_fence *fence) {}


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

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

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

LLVM IR (-O2):
%struct.sde_rot_sync_fence = type opaque
define void @sde_rotator_put_sync_fence(%struct.sde_rot_sync_fence* nocapture %0) {
ret void
}
void osd_render(void) {}


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

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

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

LLVM IR (-O2):
define void @osd_render() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ list_remove(void *);
void list_delete(void *data) {
  list_remove(data);
  free(data);
}


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

x86 assembly (clang, -O2):
<list_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <list_remove@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @list_delete(i8* %0) {
%2 = tail call i32 @list_remove(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
void gui_create_form_select_menu(struct browser_window *bw,
                                 struct form_control *control) {}


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

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

LLVM IR (-O0):
%struct.browser_window = type opaque
%struct.form_control = type opaque
define void @gui_create_form_select_menu(%struct.browser_window* %0, %struct.form_control* %1) {
%3 = alloca %struct.browser_window*
%4 = alloca %struct.form_control*
store %struct.browser_window* %0, %struct.browser_window** %3
store %struct.form_control* %1, %struct.form_control** %4
ret void
}

LLVM IR (-O2):
%struct.browser_window = type opaque
%struct.form_control = type opaque
define void @gui_create_form_select_menu(%struct.browser_window* nocapture %0, %struct.form_control* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, char const *, char *, size_t);
ssize_t listxattr(const char *path, char *list, size_t size) {
  return syscall(232, path, list, size);
}


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

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

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

LLVM IR (-O2):
define i32 @listxattr(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @syscall(i32 232, i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
const char *bootcode_path(const char *part_type) { return (NULL); }


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

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

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

LLVM IR (-O2):
define noalias i8* @bootcode_path(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int const rand();
int rand_int(const int min, const int max) {
  return rand() % (max - min + 1) + min;
}


x86 assembly (clang, -O0):
<rand_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_int>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rand_int(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ FetchRands(int, double *);
double PRand(double *randoms, long int *currentRandom) {
  if (*(currentRandom) >= 100000) {
    FetchRands(100000, randoms);
    *(currentRandom) = 0;
  }
  double out = randoms[*(currentRandom)];
  *(currentRandom) += 1;
  return out;
}


x86 assembly (clang, -O0):
<PRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x186a0,(%rax)
jl     114a <PRand+0x3a>
mov    -0x8(%rbp),%rsi
mov    $0x186a0,%edi
call   1030 <FetchRands@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRand>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%rax
cmp    $0x186a0,%rax
jl     1134 <PRand+0x24>
mov    $0x186a0,%edi
mov    %r14,%rsi
call   1030 <FetchRands@plt>
xor    %eax,%eax
movsd  (%r14,%rax,8),%xmm0
add    $0x1,%rax
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define double @PRand(double* %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = icmp sgt i64 %3, 99999
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @FetchRands(i32 100000, double* %0)
br label %7
7: ; preds = %5, %2
%8 = phi i64 [ 0, %5 ], [ %3, %2 ]
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = add nsw i64 %8, 1
store i64 %11, i64* %1
ret double %10
}
/* Type definitions */
struct timeval {
  int tv_sec;
  size_t tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
size_t elapsed_time(size_t us) {
  struct timeval t;
  gettimeofday(&t, NULL);
  return t.tv_sec * 1000000 + t.tv_usec - us;
}


x86 assembly (clang, -O0):
<elapsed_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x18(%rbp),%eax
cltq
add    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elapsed_time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0xf4240,%rax,%rcx
mov    0x8(%rsp),%rax
sub    %rbx,%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @elapsed_time(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timeval
store i64 %0, i64* %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%10 = load i64, i64* %9
%11 = add i64 %8, %10
%12 = load i64, i64* %2
%13 = sub i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @elapsed_time(i64 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%10 = load i64, i64* %9
%11 = sub i64 %10, %0
%12 = add i64 %11, %8
ret i64 %12
}
/* Variables and functions */
int check_translation(char *, char const *, int /*<<< orphan*/ *, char const *);
int /*<<< orphan*/ lou_free();
int main(int argc, char **argv) {
  int result = 0;
  const char *text = "---.com";
  const char *expected = "";
  result |= check_translation("tables/UEBC-g2.ctb", text, NULL, expected);
  lou_free();
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rcx
lea    0xea6(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <check_translation@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <lou_free@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee0(%rip),%rdi
lea    0xed1(%rip),%rsi
lea    0xee4(%rip),%rcx
xor    %edx,%edx
call   1030 <check_translation@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <lou_free@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"---.com\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [19 x i8] c"tables/UEBC-g2.ctb\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %8
%9 = load i8*, i8** %7
%10 = load i8*, i8** %8
%11 = call i32 @check_translation(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %9, i32* null, i8* %10)
%12 = load i32, i32* %6
%13 = or i32 %12, %11
store i32 %13, i32* %6
%14 = call i32 (...) @lou_free()
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
@.str = [8 x i8] c"---.com\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [19 x i8] c"tables/UEBC-g2.ctb\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_translation(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @lou_free()
ret i32 %3
}
/* Type definitions */
struct Cyc_PP_Doc {
  int dummy;
};
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
struct Cyc_PP_Doc *Cyc_Absynpp_exp2doc_prec(int /*<<< orphan*/,
                                            struct Cyc_Absyn_Exp *);
struct Cyc_PP_Doc *Cyc_Absynpp_exp2doc(struct Cyc_Absyn_Exp *e) {
  struct Cyc_PP_Doc *_T0;
  _T0 = Cyc_Absynpp_exp2doc_prec(0, e);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_Absynpp_exp2doc>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <Cyc_Absynpp_exp2doc_prec@plt>

LLVM IR (-O0):
%struct.Cyc_PP_Doc = type { i32 }
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_PP_Doc* @Cyc_Absynpp_exp2doc(%struct.Cyc_Absyn_Exp* %0) {
%2 = alloca %struct.Cyc_Absyn_Exp*
%3 = alloca %struct.Cyc_PP_Doc*
store %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp** %2
%4 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %2
%5 = call %struct.Cyc_PP_Doc* @Cyc_Absynpp_exp2doc_prec(i32 0, %struct.Cyc_Absyn_Exp* %4)
store %struct.Cyc_PP_Doc* %5, %struct.Cyc_PP_Doc** %3
%6 = load %struct.Cyc_PP_Doc*, %struct.Cyc_PP_Doc** %3
ret %struct.Cyc_PP_Doc* %6
}

LLVM IR (-O2):
%struct.Cyc_PP_Doc = type { i32 }
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_PP_Doc* @Cyc_Absynpp_exp2doc(%struct.Cyc_Absyn_Exp* %0) {
%2 = tail call %struct.Cyc_PP_Doc* @Cyc_Absynpp_exp2doc_prec(i32 0, %struct.Cyc_Absyn_Exp* %0)
ret %struct.Cyc_PP_Doc* %2
}
void byte_set(const void *dst, unsigned int len, char ch) {
  char *d = (char *)dst;
  while (len) {
    --len;
    d[len] = ch;
  }
}


x86 assembly (clang, -O0):
<byte_set>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113d <byte_set+0x3d>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xd(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
jmp    1118 <byte_set+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_set>:
test   %esi,%esi
je     1126 <byte_set+0x16>
push   %rax
mov    %esi,%eax
movzbl %dl,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @byte_set(i8* nocapture writeonly %0, i32 %1, i8 signext %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void poe_die(int status) {
  cleanup();
  syslog(LOG_INFO, "Exit.");
  exit(status);
}


x86 assembly (clang, -O0):
<poe_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <cleanup@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
call   1030 <syslog@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<poe_die>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <cleanup@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1030 <syslog@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [6 x i8] c"Exit.\00"
define void @poe_die(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cleanup()
%4 = load i32, i32* @LOG_INFO
%5 = call i32 @syslog(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [6 x i8] c"Exit.\00"
define void @poe_die(i32 %0) {
%2 = tail call i32 (...) @cleanup()
%3 = load i32, i32* @LOG_INFO
%4 = tail call i32 @syslog(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ binky(int);
int rand();
int main(int argc, char *argv[]) {
  int i = rand() % 3;
  binky(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <binky@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rdi
imul   $0x55555556,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%edi
call   1030 <binky@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 3
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @binky(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 3
%5 = tail call i32 @binky(i32 %4)
ret i32 0
}
int fun1064() { return 1064; }


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

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

LLVM IR (-O0):
define i32 @fun1064() {
ret i32 1064
}

LLVM IR (-O2):
define i32 @fun1064() {
ret i32 1064
}