xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void MessageDataDestructor(void *pData, void *pUserData) {
  {
    if (pData) {
      free(pData);
      (pData) = NULL;
    }
  };
}


x86 assembly (clang, -O0):
<MessageDataDestructor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <MessageDataDestructor+0x2c>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MessageDataDestructor>:
test   %rdi,%rdi
je     111a <MessageDataDestructor+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @MessageDataDestructor(i8* %0, i8* nocapture readnone %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun3(void) { printf("this is fun3\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"this is fun3\0A\00"
define void @fun3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"this is fun3\00"
define void @fun3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
double yardsToFeet(double yards) { return yards * 3.0; }


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

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

LLVM IR (-O0):
define double @yardsToFeet(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @yardsToFeet(double %0) {
%2 = fmul double %0, 3.000000e+00
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ done_making_trace_files();
int /*<<< orphan*/ write_basic_trace_file();
int /*<<< orphan*/ write_error_trace_file();
int main(int argc, char **argv, char **envp) {
  write_basic_trace_file();
  write_error_trace_file();
  done_making_trace_files();
  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    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1050 <write_basic_trace_file@plt>
mov    $0x0,%al
call   1030 <write_error_trace_file@plt>
mov    $0x0,%al
call   1040 <done_making_trace_files@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <write_basic_trace_file@plt>
xor    %eax,%eax
call   1030 <write_error_trace_file@plt>
xor    %eax,%eax
call   1040 <done_making_trace_files@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 (...) @write_basic_trace_file()
%9 = call i32 (...) @write_error_trace_file()
%10 = call i32 (...) @done_making_trace_files()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @write_basic_trace_file()
%5 = tail call i32 (...) @write_error_trace_file()
%6 = tail call i32 (...) @done_making_trace_files()
ret i32 0
}
void json_allocator_free_noop(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @json_allocator_free_noop(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int printusage(void) {
  printf("Validus -s [string]\t: Generates fingerprint for string\n");
  printf("Validus -t\t\t: Performs time-trial\n");
  printf("Validus -x\t\t: Displays test suite\n");
  printf("Validus [file]\t\t: Generates fingerprint for file\n");
  return 0;
}


x86 assembly (clang, -O0):
<printusage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf11(%rip),%rdi
call   1030 <printf@plt>
lea    0xf28(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [56 x i8] c"Validus -s [string]\09: Generates fingerprint for string\0A\00"
@.str.1 = [35 x i8] c"Validus -t\09\09: Performs time-trial\0A\00"
@.str.2 = [35 x i8] c"Validus -x\09\09: Displays test suite\0A\00"
@.str.3 = [50 x i8] c"Validus [file]\09\09: Generates fingerprint for file\0A\00"
define i32 @printusage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [55 x i8] c"Validus -s [string]\09: Generates fingerprint for string\00"
@str.4 = [34 x i8] c"Validus -t\09\09: Performs time-trial\00"
@str.5 = [34 x i8] c"Validus -x\09\09: Displays test suite\00"
@str.6 = [49 x i8] c"Validus [file]\09\09: Generates fingerprint for file\00"
define i32 @printusage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}
int halt(void) { ; }


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

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

LLVM IR (-O0):
define i32 @halt() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @halt() {
ret i32 undef
}
void nrf_802154_lp_timer_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @nrf_802154_lp_timer_deinit() {
ret void
}
/* Variables and functions */
unsigned short check_read(int, char *);
unsigned short int inw(unsigned short int port) {
  return check_read((int)port, "inw");
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
lea    0xed6(%rip),%rsi
call   1030 <check_read@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
lea    0xee9(%rip),%rsi
jmp    1030 <check_read@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"inw\00"
define zeroext i16 @inw(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = call zeroext i16 @check_read(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i16 %5
}

LLVM IR (-O2):
@.str = [4 x i8] c"inw\00"
define zeroext i16 @inw(i16 zeroext %0) {
%2 = zext i16 %0 to i32
%3 = tail call zeroext i16 @check_read(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(char *prog_name) {
  printf("USAGE: %s <input_file> <output_file>\n\n", prog_name);
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"USAGE: %s <input_file> <output_file>\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"USAGE: %s <input_file> <output_file>\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double eqn(double x) { return (x * x * x) - 2.0 * x - 1.0; }


x86 assembly (clang, -O0):
<eqn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xee8(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb4(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<eqn>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm1
addsd  0xee4(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @eqn(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fmul double 2.000000e+00, %7
%9 = fneg double %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = fsub double %10, 1.000000e+00
ret double %11
}

LLVM IR (-O2):
define double @eqn(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %0, -2.000000e+00
%4 = tail call double @llvm.fmuladd.f64(double %2, double %0, double %3)
%5 = fadd double %4, -1.000000e+00
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgpopptr(void) { gen("popq\t%rdx"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"popq\09%rdx\00"
define void @cgpopptr() {
%1 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"popq\09%rdx\00"
define void @cgpopptr() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
void outportb(unsigned short portid, unsigned char value) {
  asm volatile("outb %%al, %%dx" : : "d"(portid), "a"(value));
}


x86 assembly (clang, -O0):
<outportb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x3(%rbp),%al
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outportb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

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

LLVM IR (-O2):
define void @outportb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb %al, %dx", "{dx},{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i8 %1)
ret void
}
void *Tiger_new(void *vtable, int size) {
  int siz = size + sizeof(vtable);
  int *p = (int *)malloc(siz);
  memset(p, 0, siz);
  *p = (int)vtable;
  return p;
}


x86 assembly (clang, -O0):
<Tiger_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
add    $0x8,%rax
mov    %eax,-0x10(%rbp)
movslq -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tiger_new>:
push   %rbx
mov    %rdi,%rbx
add    $0x8,%esi
movslq %esi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Tiger_new(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = add i64 %8, 8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = call i8* @malloc(i64 %12)
%14 = bitcast i8* %13 to i32*
store i32* %14, i32** %6
%15 = load i32*, i32** %6
%16 = bitcast i32* %15 to i8*
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = load i8*, i8** %3
%20 = ptrtoint i8* %19 to i32
%21 = load i32*, i32** %6
store i32 %20, i32* %21
%22 = load i32*, i32** %6
%23 = bitcast i32* %22 to i8*
ret i8* %23
}

LLVM IR (-O2):
define noalias i8* @Tiger_new(i8* %0, i32 %1) {
%3 = add i32 %1, 8
%4 = sext i32 %3 to i64
%5 = call i8* @calloc(i64 1, i64 %4)
%6 = bitcast i8* %5 to i32*
%7 = ptrtoint i8* %0 to i64
%8 = trunc i64 %7 to i32
store i32 %8, i32* %6
ret i8* %5
}
void proc47() {}


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

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

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

LLVM IR (-O2):
define void @proc47() {
ret void
}
void *pmmpf(void *context) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @pmmpf(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void desplazarVentana(char *ventana, int cantidad) {
  memcpy(ventana, ventana + cantidad, 2 * 8192 - cantidad);
}


x86 assembly (clang, -O0):
<desplazarVentana>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    $0x4000,%edx
sub    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<desplazarVentana>:
movslq %esi,%rax
lea    (%rdi,%rax,1),%rsi
mov    $0x4000,%edx
sub    %eax,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @desplazarVentana(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 i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i32, i32* %4
%11 = sub nsw i32 16384, %10
%12 = call i32 @memcpy(i8* %5, i8* %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @desplazarVentana(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = sub nsw i32 16384, %1
%6 = tail call i32 @memcpy(i8* %0, i8* %4, i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_xor_si256(int /*<<< orphan*/, int /*<<< orphan*/);
__attribute__((always_)) __m256i xorv(__m256i a, __m256i b) {
  return _mm256_xor_si256(a, b);
}


x86 assembly (clang, -O0):
<xorv>:
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 <_mm256_xor_si256@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xorv>:
jmp    1030 <_mm256_xor_si256@plt>

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

LLVM IR (-O2):
define i32 @xorv(i32 %0, i32 %1) {
%3 = tail call i32 @_mm256_xor_si256(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
struct SN_env *SN_create_env(int /*<<< orphan*/, int, int);
extern struct SN_env *dutch_UTF_8_create_env(void) {
  return SN_create_env(0, 2, 1);
}


x86 assembly (clang, -O0):
<dutch_UTF_8_create_env>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <SN_create_env@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dutch_UTF_8_create_env>:
xor    %edi,%edi
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1030 <SN_create_env@plt>

LLVM IR (-O0):
%struct.SN_env = type { i32 }
define %struct.SN_env* @dutch_UTF_8_create_env() {
%1 = call %struct.SN_env* @SN_create_env(i32 0, i32 2, i32 1)
ret %struct.SN_env* %1
}

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define %struct.SN_env* @dutch_UTF_8_create_env() {
%1 = tail call %struct.SN_env* @SN_create_env(i32 0, i32 2, i32 1)
ret %struct.SN_env* %1
}
/* Variables and functions */
void *imgnew(char const *);
void *imgload(const char *path, void *_ignrd) { return imgnew(path); }


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

x86 assembly (clang, -O2):
<imgload>:
jmp    1030 <imgnew@plt>

LLVM IR (-O0):
define i8* @imgload(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i8* @imgnew(i8* %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @imgload(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i8* @imgnew(i8* %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int num;
  srand(time(NULL));
  num = rand();
  printf("%d\n", num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <rand@plt>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nondet_int();
int /*<<< orphan*/ rotate(int /*<<< orphan*/);
int main() {
  rotate(nondet_int());
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nondet_int()
%2 = tail call i32 @rotate(i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ twi_start();
int /*<<< orphan*/ twi_stop();
int /*<<< orphan*/ twi_write(int);
void twi_write_2byte(uint16_t buf, uint8_t addr) {
  twi_start();
  twi_write(addr << 1);
  twi_write(0x00);
  twi_write(buf);
  twi_write(buf >> 8);
  twi_stop();
}


x86 assembly (clang, -O0):
<twi_write_2byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <twi_start@plt>
mov    -0x8(%rbp),%edi
shl    $0x1,%edi
call   1040 <twi_write@plt>
xor    %edi,%edi
call   1040 <twi_write@plt>
mov    -0x4(%rbp),%edi
call   1040 <twi_write@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
call   1040 <twi_write@plt>
mov    $0x0,%al
call   1050 <twi_stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twi_write_2byte>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <twi_start@plt>
add    %ebx,%ebx
mov    %ebx,%edi
call   1040 <twi_write@plt>
xor    %edi,%edi
call   1040 <twi_write@plt>
mov    %ebp,%edi
call   1040 <twi_write@plt>
sar    $0x8,%ebp
mov    %ebp,%edi
call   1040 <twi_write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <twi_stop@plt>

LLVM IR (-O0):
define void @twi_write_2byte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @twi_start()
%6 = load i32, i32* %4
%7 = shl i32 %6, 1
%8 = call i32 @twi_write(i32 %7)
%9 = call i32 @twi_write(i32 0)
%10 = load i32, i32* %3
%11 = call i32 @twi_write(i32 %10)
%12 = load i32, i32* %3
%13 = ashr i32 %12, 8
%14 = call i32 @twi_write(i32 %13)
%15 = call i32 (...) @twi_stop()
ret void
}

LLVM IR (-O2):
define void @twi_write_2byte(i32 %0, i32 %1) {
%3 = tail call i32 (...) @twi_start()
%4 = shl i32 %1, 1
%5 = tail call i32 @twi_write(i32 %4)
%6 = tail call i32 @twi_write(i32 0)
%7 = tail call i32 @twi_write(i32 %0)
%8 = ashr i32 %0, 8
%9 = tail call i32 @twi_write(i32 %8)
%10 = tail call i32 (...) @twi_stop()
ret void
}
int digit_count(int v) {
  int i, x;
  for (i = 1, x = 64; v >= x; i++, x <<= 6) {
  }
  return i;
}


x86 assembly (clang, -O0):
<digit_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x40,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     113d <digit_count+0x3d>
jmp    1126 <digit_count+0x26>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x6,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <digit_count+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_count>:
mov    $0x1,%eax
cmp    $0x40,%edi
jl     112a <digit_count+0x2a>
mov    $0x1,%eax
mov    $0x40,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%eax
shl    $0x6,%ecx
cmp    %edi,%ecx
jle    1120 <digit_count+0x20>
ret

LLVM IR (-O0):
define i32 @digit_count(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 64, i32* %4
br label %5
5: ; preds = %10, %1
%6 = load i32, i32* %2
%7 = load i32, i32* %4
%8 = icmp sge i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = shl i32 %13, 6
store i32 %14, i32* %4
br label %5
15: ; preds = %5
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @digit_count(i32 %0) {
%2 = icmp slt i32 %0, 64
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 64, %1 ]
%5 = phi i32 [ %6, %3 ], [ 1, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = shl i32 %4, 6
%8 = icmp sgt i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ oled_SendCommand(unsigned char *, int);
void SetMultiplexRatio(char a) {
  unsigned char d[] = {0xA8, a & 0x3f};
  oled_SendCommand(d, sizeof(d));
}


x86 assembly (clang, -O0):
<SetMultiplexRatio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0xa8,-0x3(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x3f,%eax
mov    %al,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
mov    $0x2,%esi
call   1030 <oled_SendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetMultiplexRatio>:
push   %rax
movb   $0xa8,0x6(%rsp)
and    $0x3f,%dil
mov    %dil,0x7(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <oled_SendCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @SetMultiplexRatio(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 -88, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = and i32 %7, 63
%9 = trunc i32 %8 to i8
store i8 %9, i8* %5
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%11 = call i32 @oled_SendCommand(i8* %10, i32 2)
ret void
}

LLVM IR (-O2):
define void @SetMultiplexRatio(i8 signext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 -88, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%5 = and i8 %0, 63
store i8 %5, i8* %4
%6 = call i32 @oled_SendCommand(i8* %3, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNC_1() {
  long int stat = 99;
  BNCIO(1);
  return (stat);
}


x86 assembly (clang, -O0):
<BNC_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNC_1>:
push   %rax
mov    $0x1,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNC_1() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 1)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNC_1() {
%1 = tail call i32 @BNCIO(i32 1)
ret i64 99
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x = 1;
  int y = 2;
  int sum = x + y;
  printf("%d", ++(sum));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
const char *db_drop_check_total_view_sql(void) {
  static const char *query = "DROP VIEW check_total";
  return query;
}


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

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

LLVM IR (-O0):
@db_drop_check_total_view_sql.query = internal global i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i32 0, i32 0)
@.str = [22 x i8] c"DROP VIEW check_total\00"
define i8* @db_drop_check_total_view_sql() {
%1 = load i8*, i8** @db_drop_check_total_view_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [22 x i8] c"DROP VIEW check_total\00"
define i8* @db_drop_check_total_view_sql() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}
short __max_impl_short(short a, short b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<__max_impl_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cmp    %ecx,%eax
jle    112e <__max_impl_short+0x2e>
movswl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <__max_impl_short+0x35>
movswl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<__max_impl_short>:
mov    %esi,%eax
cmp    %ax,%di
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @__max_impl_short(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
br label %16
13: ; preds = %2
%14 = load i16, i16* %4
%15 = sext i16 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define signext i16 @__max_impl_short(i16 signext %0, i16 signext %1) {
%3 = icmp sgt i16 %0, %1
%4 = select i1 %3, i16 %0, i16 %1
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
void foo() { (void)free(0); }


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

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

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @free(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, float *);
extern void getreal_(const char *string, float *f, int n) {
  sscanf(string, "%f", f);
}


x86 assembly (clang, -O0):
<getreal_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xece(%rip),%rsi
call   1030 <sscanf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define void @getreal_(i8* %0, float* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca float*
%6 = alloca i32
store i8* %0, i8** %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load float*, float** %5
%9 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @getreal_(i8* nocapture %0, float* %1, i32 %2) {
%4 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_inf(char *, char const *);
int stress_tsc_supported(const char *name) {
  pr_inf("%s stressor will be skipped, CPU "
         "does not support the rdtsc instruction.\n",
         name);
  return -1;
}


x86 assembly (clang, -O0):
<stress_tsc_supported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <pr_inf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_tsc_supported>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <pr_inf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [74 x i8] c"%s stressor will be skipped, CPU does not support the rdtsc instruction.\0A\00"
define i32 @stress_tsc_supported(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @pr_inf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 -1
}

LLVM IR (-O2):
@.str = [74 x i8] c"%s stressor will be skipped, CPU does not support the rdtsc instruction.\0A\00"
define i32 @stress_tsc_supported(i8* %0) {
%2 = tail call i32 @pr_inf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 -1
}
void pp(void) {
  int i;
  for (i = 0; i < 256; i++)
    ;
}


x86 assembly (clang, -O0):
<pp>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    112b <pp+0x2b>
jmp    111d <pp+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <pp+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @pp() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 256
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @pp() {
ret void
}
void __pend_sv_handler() {
  for (;;) {
    __asm__ volatile("nop");
  }
}


x86 assembly (clang, -O0):
<__pend_sv_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <__pend_sv_handler+0x9>
nop
jmp    1109 <__pend_sv_handler+0x9>

x86 assembly (clang, -O2):
<__pend_sv_handler>:
nop
jmp    1100 <__pend_sv_handler>

LLVM IR (-O0):
define void @__pend_sv_handler() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @__pend_sv_handler() {
br label %1
1: ; preds = %1, %0
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}
void interrupt_sys_handler(unsigned int irq) {
  uputs(__FUNCTION__);
  putc('\n');
}


x86 assembly (clang, -O0):
<interrupt_sys_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <uputs@plt>
mov    $0xa,%edi
mov    $0x0,%al
call   1040 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt_sys_handler>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <uputs@plt>
mov    $0xa,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <putc@plt>

LLVM IR (-O0):
@__FUNCTION__.interrupt_sys_handler = [22 x i8] c"interrupt_sys_handler\00"
define void @interrupt_sys_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @uputs to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__FUNCTION__.interrupt_sys_handler, i64 0, i64 0))
%4 = call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 10)
ret void
}

LLVM IR (-O2):
@__FUNCTION__.interrupt_sys_handler = [22 x i8] c"interrupt_sys_handler\00"
define void @interrupt_sys_handler(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @uputs to i32 (i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__FUNCTION__.interrupt_sys_handler, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @putc to i32 (i32, ...)*)(i32 10)
ret void
}
void testClosureBDBrV(void (*closure)(char, double, char), char a1, double a2,
                      char a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureBDBrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x9(%rbp),%cl
movsd  -0x18(%rbp),%xmm0
movsbl %cl,%edi
movsbl -0x19(%rbp),%esi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @testClosureBDBrV(void (i8, double, i8)* nocapture %0, i8 signext %1, double %2, i8 signext %3) {
tail call void %0(i8 signext %1, double %2, i8 signext %3)
ret void
}
unsigned huffman_magnitude(const short value) {
  unsigned x = (value < 0) ? -value : value;
  unsigned m = 0;
  while (x >> m)
    ++m;
  return m;
}


x86 assembly (clang, -O0):
<huffman_magnitude>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
jge    1128 <huffman_magnitude+0x28>
movswl -0x2(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    112f <huffman_magnitude+0x2f>
movswl -0x2(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
cmp    $0x0,%eax
je     115b <huffman_magnitude+0x5b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113c <huffman_magnitude+0x3c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<huffman_magnitude>:
mov    %edi,%eax
neg    %ax
cmovs  %di,%ax
movzwl %ax,%eax
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ecx
mov    %eax,%edx
shr    %cl,%edx
test   %edx,%edx
jne    1120 <huffman_magnitude+0x20>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @huffman_magnitude(i16 signext %0) {
%2 = alloca i16
%3 = alloca i32
%4 = alloca i32
store i16 %0, i16* %2
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i16, i16* %2
%10 = sext i16 %9 to i32
%11 = sub nsw i32 0, %10
br label %15
12: ; preds = %1
%13 = load i16, i16* %2
%14 = sext i16 %13 to i32
br label %15
15: ; preds = %12, %8
%16 = phi i32 [ %11, %8 ], [ %14, %12 ]
store i32 %16, i32* %3
store i32 0, i32* %4
br label %17
17: ; preds = %22, %15
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = lshr i32 %18, %19
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = load i32, i32* %4
%24 = add i32 %23, 1
store i32 %24, i32* %4
br label %17
25: ; preds = %17
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @huffman_magnitude(i16 signext %0) {
%2 = tail call i16 @llvm.abs.i16(i16 %0, i1 false)
%3 = zext i16 %2 to i32
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %8, %4 ]
%6 = lshr i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = add i32 %5, 1
br i1 %7, label %9, label %4
9: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_version(void) {
  printf("dec2bin version %s\n", ("1.5"));
  printf("James Hendrie - hendrie.james@gmail.com\n");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee5(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"dec2bin version %s\0A\00"
@.str.1 = [4 x i8] c"1.5\00"
@.str.2 = [41 x i8] c"James Hendrie - hendrie.james@gmail.com\0A\00"
define void @print_version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"dec2bin version %s\0A\00"
@.str.1 = [4 x i8] c"1.5\00"
@str = [40 x i8] c"James Hendrie - hendrie.james@gmail.com\00"
define void @print_version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
char *stpcpy(char *dest, const char *src) {
  register char *d = dest;
  register const char *s = src;
  do
    *d++ = *s;
  while (*s++ != '\0');
  return d - 1;
}


x86 assembly (clang, -O0):
<stpcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    111c <stpcpy+0x1c>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @stpcpy(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %6, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = load i8, i8* %5
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i8* %4
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
long random_offset(long file_length, int blksize) {
  return (long)((rand() / (double)RAND_MAX) * (file_length - blksize));
}


x86 assembly (clang, -O0):
<random_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ebb(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
sub    %rcx,%rax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_offset>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec2(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movslq %ebp,%rax
sub    %rax,%rbx
cvtsi2sd %rbx,%xmm2
divsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm2
cvttsd2si %xmm2,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i64 @random_offset(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = call double (...) @rand()
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to double
%8 = fdiv double %5, %7
%9 = load i64, i64* %3
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = sub nsw i64 %9, %11
%13 = sitofp i64 %12 to double
%14 = fmul double %8, %13
%15 = fptosi double %14 to i64
ret i64 %15
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i64 @random_offset(i64 %0, i32 %1) {
%3 = tail call double (...) @rand()
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = fdiv double %3, %5
%7 = sext i32 %1 to i64
%8 = sub nsw i64 %0, %7
%9 = sitofp i64 %8 to double
%10 = fmul double %6, %9
%11 = fptosi double %10 to i64
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void jos_port_sleep(void) { sleep(1); }


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

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

LLVM IR (-O0):
define void @jos_port_sleep() {
%1 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @jos_port_sleep() {
%1 = tail call i32 @sleep(i32 1)
ret void
}
/* Variables and functions */
unsigned int get_address(char *);
int /*<<< orphan*/ get_default(char *, int);
unsigned int getExternalHostAddressLinux(void) {
  char if_name[16];
  get_default(if_name, 16);
  return get_address(if_name[0] ? if_name : NULL);
}


x86 assembly (clang, -O0):
<getExternalHostAddressLinux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
mov    $0x10,%esi
call   1040 <get_default@plt>
movsbl -0x10(%rbp),%eax
cmp    $0x0,%eax
je     1150 <getExternalHostAddressLinux+0x30>
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    115b <getExternalHostAddressLinux+0x3b>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    115b <getExternalHostAddressLinux+0x3b>
mov    -0x18(%rbp),%rdi
call   1030 <get_address@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getExternalHostAddressLinux>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <get_default@plt>
xor    %edi,%edi
cmpb   $0x0,(%rsp)
cmovne %rbx,%rdi
call   1030 <get_address@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getExternalHostAddressLinux() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_default(i8* %2, i32 16)
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
br label %11
10: ; preds = %0
br label %11
11: ; preds = %10, %8
%12 = phi i8* [ %9, %8 ], [ null, %10 ]
%13 = call i32 @get_address(i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @getExternalHostAddressLinux() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_default(i8* %2, i32 16)
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 0
%6 = select i1 %5, i8* null, i8* %2
%7 = call i32 @get_address(i8* %6)
ret i32 %7
}