xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pac_nacepin(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  printf("Enter number of bottles of nacepin :");
  scanf(" %d", &a);
  pac_nacepin(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <pac_nacepin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <pac_nacepin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Enter number of bottles of nacepin :\00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @pac_nacepin(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Enter number of bottles of nacepin :\00"
@.str.1 = [4 x i8] c" %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @pac_nacepin(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("Hello world.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *kino_MemMan_wrapped_malloc(size_t count) {
  void *pointer = malloc(count);
  if (pointer == NULL && count != 0) {
    fprintf(stderr, "Out of memory.\n");
    exit(1);
  }
  return pointer;
}


x86 assembly (clang, -O0):
<kino_MemMan_wrapped_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117e <kino_MemMan_wrapped_malloc+0x4e>
cmpq   $0x0,-0x8(%rbp)
je     117e <kino_MemMan_wrapped_malloc+0x4e>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kino_MemMan_wrapped_malloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rbx,%rbx
je     1143 <kino_MemMan_wrapped_malloc+0x13>
test   %rax,%rax
je     1145 <kino_MemMan_wrapped_malloc+0x15>
pop    %rbx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory.\0A\00"
define noalias i8* @kino_MemMan_wrapped_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret i8* %2
}
char *arrayGetCString(char **values, int i) { return values[i]; }


x86 assembly (clang, -O0):
<arrayGetCString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrayGetCString>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
define i8* @arrayGetCString(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
ret i8* %9
}

LLVM IR (-O2):
define i8* @arrayGetCString(i8** nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
ret i8* %5
}
unsigned int mb_ver(void) {
  return ((1 * 0x01000000) + (0 * 0x00010000) + (42));
}


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

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

LLVM IR (-O0):
define i32 @mb_ver() {
ret i32 16777258
}

LLVM IR (-O2):
define i32 @mb_ver() {
ret i32 16777258
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int get_uint16(int /*<<< orphan*/ *, int);
unsigned log_sense_data_len(uint8_t *data) { return get_uint16(data, 2); }


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

x86 assembly (clang, -O2):
<log_sense_data_len>:
mov    $0x2,%esi
jmp    1030 <get_uint16@plt>

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

LLVM IR (-O2):
define i32 @log_sense_data_len(i32* %0) {
%2 = tail call i32 @get_uint16(i32* %0, i32 2)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int nrf_802154_request_energy_detection(int, int /*<<< orphan*/);
bool nrf_802154_energy_detection(uint32_t time_us) {
  bool result;
  (void)(0x0004UL);
  result = nrf_802154_request_energy_detection(0x00, time_us);
  (void)(0x0004UL);
  return result;
}


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

x86 assembly (clang, -O2):
<nrf_802154_energy_detection>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <nrf_802154_request_energy_detection@plt>

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

LLVM IR (-O2):
define i32 @nrf_802154_energy_detection(i32 %0) {
%2 = tail call i32 @nrf_802154_request_energy_detection(i32 0, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ port_byte_out(int, int);
void pic_send_eoi(unsigned char irq) {
  ;
  if (irq >= 8)
    port_byte_out(0xA0, 0x20);
  port_byte_out(0x20, 0x20);
}


x86 assembly (clang, -O0):
<pic_send_eoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x8,%eax
jl     113a <pic_send_eoi+0x2a>
mov    $0xa0,%edi
mov    $0x20,%esi
call   1030 <port_byte_out@plt>
mov    $0x20,%esi
mov    %esi,%edi
call   1030 <port_byte_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_send_eoi>:
cmp    $0x8,%dil
jb     112a <pic_send_eoi+0x1a>
push   %rax
mov    $0xa0,%edi
mov    $0x20,%esi
call   1030 <port_byte_out@plt>
add    $0x8,%rsp
mov    $0x20,%edi
mov    $0x20,%esi
jmp    1030 <port_byte_out@plt>

LLVM IR (-O0):
define void @pic_send_eoi(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 8
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @port_byte_out(i32 160, i32 32)
br label %8
8: ; preds = %6, %1
%9 = call i32 @port_byte_out(i32 32, i32 32)
ret void
}

LLVM IR (-O2):
define void @pic_send_eoi(i8 zeroext %0) {
%2 = icmp ugt i8 %0, 7
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @port_byte_out(i32 160, i32 32)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @port_byte_out(i32 32, i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(unsigned int *);
scalar_t__ calloc(size_t const, int);
unsigned int *uivector(const size_t n) {
  unsigned int *v = (unsigned int *)calloc(n, sizeof(unsigned int));
  assert(v);
  return v;
}


x86 assembly (clang, -O0):
<uivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uivector>:
push   %rbx
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @uivector(i64 %0) {
%2 = alloca i64
%3 = alloca i32*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @calloc(i64 %4, i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = call i32 @assert(i32* %7)
%9 = load i32*, i32** %3
ret i32* %9
}

LLVM IR (-O2):
define i32* @uivector(i64 %0) {
%2 = tail call i64 @calloc(i64 %0, i32 4)
%3 = inttoptr i64 %2 to i32*
%4 = tail call i32 @assert(i32* %3)
ret i32* %3
}
/* Variables and functions */
size_t index_bounds(size_t, int, size_t);
size_t strnlen(char const *, size_t);
size_t strn_index_bounds(const char *str, size_t size,
                         int is_terminator_out_of_bounds, size_t index) {
  index =
      index_bounds(strnlen(str, size) + 1, is_terminator_out_of_bounds, index);
  index = index_bounds(size, is_terminator_out_of_bounds, index);
  return index;
}


x86 assembly (clang, -O0):
<strn_index_bounds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strnlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <index_bounds@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1030 <index_bounds@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strn_index_bounds>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <strnlen@plt>
lea    0x1(%rax),%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1030 <index_bounds@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rax,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <index_bounds@plt>

LLVM IR (-O0):
define i64 @strn_index_bounds(i8* %0, i64 %1, i32 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @strnlen(i8* %9, i64 %10)
%12 = add i64 %11, 1
%13 = load i32, i32* %7
%14 = load i64, i64* %8
%15 = call i64 @index_bounds(i64 %12, i32 %13, i64 %14)
store i64 %15, i64* %8
%16 = load i64, i64* %6
%17 = load i32, i32* %7
%18 = load i64, i64* %8
%19 = call i64 @index_bounds(i64 %16, i32 %17, i64 %18)
store i64 %19, i64* %8
%20 = load i64, i64* %8
ret i64 %20
}

LLVM IR (-O2):
define i64 @strn_index_bounds(i8* nocapture %0, i64 %1, i32 %2, i64 %3) {
%5 = tail call i64 @strnlen(i8* %0, i64 %1)
%6 = add i64 %5, 1
%7 = tail call i64 @index_bounds(i64 %6, i32 %2, i64 %3)
%8 = tail call i64 @index_bounds(i64 %1, i32 %2, i64 %7)
ret i64 %8
}
void f_floatcomplex_insufficient_fprs2(float a, float __complex__ b,
                                       float __complex__ c, float __complex__ d,
                                       float __complex__ e) {}


x86 assembly (clang, -O0):
<f_floatcomplex_insufficient_fprs2>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm1,-0x8(%rbp)
movlpd %xmm2,-0x10(%rbp)
movlpd %xmm3,-0x18(%rbp)
movlpd %xmm4,-0x20(%rbp)
movss  %xmm0,-0x24(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f_floatcomplex_insufficient_fprs2(float %0, <2 x float> %1, <2 x float> %2, <2 x float> %3, <2 x float> %4) {
%6 = alloca { float, float }
%7 = alloca { float, float }
%8 = alloca { float, float }
%9 = alloca { float, float }
%10 = alloca float
%11 = bitcast { float, float }* %6 to <2 x float>*
store <2 x float> %1, <2 x float>* %11
%12 = bitcast { float, float }* %7 to <2 x float>*
store <2 x float> %2, <2 x float>* %12
%13 = bitcast { float, float }* %8 to <2 x float>*
store <2 x float> %3, <2 x float>* %13
%14 = bitcast { float, float }* %9 to <2 x float>*
store <2 x float> %4, <2 x float>* %14
store float %0, float* %10
ret void
}

LLVM IR (-O2):
define void @f_floatcomplex_insufficient_fprs2(float %0, <2 x float> %1, <2 x float> %2, <2 x float> %3, <2 x float> %4) {
ret void
}
void print_XY(char ch, int x, int y) {
  int int_num = 1;
  __asm__("int $0x80" ::"a"(int_num), "b"(ch), "c"(y * 80 + x));
}


x86 assembly (clang, -O0):
<print_XY>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %dil,%al
mov    %al,-0x9(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x9(%rbp),%bl
imul   $0x50,-0x14(%rbp),%ecx
add    -0x10(%rbp),%ecx
int    $0x80
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_XY>:
push   %rbx
mov    %edi,%ebx
lea    (%rdx,%rdx,4),%ecx
shl    $0x4,%ecx
add    %esi,%ecx
mov    $0x1,%eax
int    $0x80
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_XY(i8 signext %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, 80
%5 = add nsw i32 %4, %1
tail call void asm sideeffect "int $$0x80", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 1, i8 %0, i32 %5)
ret void
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ FUTEX_WAIT_PRIVATE;
int /*<<< orphan*/ SYS_futex;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int *, int /*<<< orphan*/,
                           int /*<<< orphan*/, struct timespec *);
void mysleep(unsigned int sec) {
  int futex_var = 0;
  struct timespec timeout;
  timeout.tv_sec = sec;
  timeout.tv_nsec = 0;
  syscall(SYS_futex, &futex_var, FUTEX_WAIT_PRIVATE, 0, &timeout);
}


x86 assembly (clang, -O0):
<mysleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rsi
xor    %ecx,%ecx
lea    -0x18(%rbp),%r8
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysleep>:
sub    $0x18,%rsp
movl   $0x0,0x4(%rsp)
mov    %edi,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%r8
xor    %ecx,%ecx
call   1030 <syscall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@SYS_futex = global i32 0
@FUTEX_WAIT_PRIVATE = global i32 0
define void @mysleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.timespec
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
store i32 %5, i32* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 1
store i64 0, i64* %7
%8 = load i32, i32* @SYS_futex
%9 = load i32, i32* @FUTEX_WAIT_PRIVATE
%10 = call i32 @syscall(i32 %8, i32* %3, i32 %9, i32 0, %struct.timespec* %4)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@SYS_futex = global i32 0
@FUTEX_WAIT_PRIVATE = global i32 0
define void @mysleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = bitcast %struct.timespec* %3 to i8*
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
store i32 %0, i32* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 1
store i64 0, i64* %7
%8 = load i32, i32* @SYS_futex
%9 = load i32, i32* @FUTEX_WAIT_PRIVATE
%10 = call i32 @syscall(i32 %8, i32* %2, i32 %9, i32 0, %struct.timespec* %3)
ret void
}
void e() { return; }


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

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

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

LLVM IR (-O2):
define void @e() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t make_vga_entry(char c, uint8_t color) {
  uint16_t c16 = c;
  uint16_t color16 = color;
  return c16 | color16 << 8;
}


x86 assembly (clang, -O0):
<make_vga_entry>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_vga_entry>:
mov    %esi,%eax
shl    $0x8,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @make_vga_entry(i8 signext %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 i8, i8* %3
%8 = sext i8 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %4
store i32 %9, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = shl i32 %11, 8
%13 = or i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @make_vga_entry(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = shl i32 %1, 8
%5 = or i32 %4, %3
ret i32 %5
}
int cmp_short_lt(const void *a, const void *b) {
  short a_ = *(short *)a;
  short b_ = *(short *)b;
  if (a_ < b_)
    return -1;
  if (a_ > b_)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_short_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1a(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1c(%rbp)
movswl -0x1a(%rbp),%eax
movswl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jge    113e <cmp_short_lt+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <cmp_short_lt+0x61>
movswl -0x1a(%rbp),%eax
movswl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jle    115a <cmp_short_lt+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <cmp_short_lt+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_short_lt>:
movzwl (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%ax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_short_lt(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i16*
%10 = load i16, i16* %9
store i16 %10, i16* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i16*
%13 = load i16, i16* %12
store i16 %13, i16* %7
%14 = load i16, i16* %6
%15 = sext i16 %14 to i32
%16 = load i16, i16* %7
%17 = sext i16 %16 to i32
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 -1, i32* %3
br label %28
20: ; preds = %2
%21 = load i16, i16* %6
%22 = sext i16 %21 to i32
%23 = load i16, i16* %7
%24 = sext i16 %23 to i32
%25 = icmp sgt i32 %22, %24
br i1 %25, label %26, label %27
26: ; preds = %20
store i32 1, i32* %3
br label %28
27: ; preds = %20
store i32 0, i32* %3
br label %28
28: ; preds = %27, %26, %19
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @cmp_short_lt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i16*
%4 = load i16, i16* %3
%5 = bitcast i8* %1 to i16*
%6 = load i16, i16* %5
%7 = icmp slt i16 %4, %6
%8 = icmp sgt i16 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ SysTickDisable();
int /*<<< orphan*/ SysTickIntDisable();
void TimeDeinit(void) {
  SysTickIntDisable();
  SysTickDisable();
}


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

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

LLVM IR (-O0):
define void @TimeDeinit() {
%1 = call i32 (...) @SysTickIntDisable()
%2 = call i32 (...) @SysTickDisable()
ret void
}

LLVM IR (-O2):
define void @TimeDeinit() {
%1 = tail call i32 (...) @SysTickIntDisable()
%2 = tail call i32 (...) @SysTickDisable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setproctitle(char *, char const *);
void spt_setproctitle(const char *title) { setproctitle("%s", title); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @spt_setproctitle(i8* %0) {
%2 = tail call i32 @setproctitle(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *str_malloc(char *buf) {
  char *ptr;
  ptr = (char *)malloc(sizeof(char) * strlen(buf) + 1);
  strcpy(ptr, buf);
  return ptr;
}


x86 assembly (clang, -O0):
<str_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cltq
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @str_malloc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = mul i64 1, %6
%8 = add i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @str_malloc(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
void warn() {}


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

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

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

LLVM IR (-O2):
define void @warn() {
ret void
}
/* Variables and functions */
int write(int, char *, int);
int ft_putchar_fd(char c, int fd) { return (write(fd, &c, 1)); }


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

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

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

LLVM IR (-O2):
define i32 @ft_putchar_fd(i8 signext %0, i32 %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i32 @write(i32 %1, i8* %3, i32 1)
ret i32 %4
}
/* Variables and functions */
float back_out(float, float, float);
float back_f_out(float step, float max_steps, float max_val) {
  return back_out(step, max_steps, max_val);
}


x86 assembly (clang, -O0):
<back_f_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <back_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<back_f_out>:
jmp    1030 <back_out@plt>

LLVM IR (-O0):
define float @back_f_out(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @back_out(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @back_f_out(float %0, float %1, float %2) {
%4 = tail call float @back_out(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_Vec2_init(void) {
  _hmt_register_covercase("HMM_Vec2", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_Vec2_init>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"HMM_Vec2\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Vec2_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double const HUGE_VAL;
bool stdlib_base_is_finite(const double x) {
  return (x == x && x < HUGE_VAL && x > -HUGE_VAL);
}


x86 assembly (clang, -O0):
<stdlib_base_is_finite>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
ucomisd -0x8(%rbp),%xmm0
mov    %al,-0x9(%rbp)
jne    1174 <stdlib_base_is_finite+0x74>
jp     1174 <stdlib_base_is_finite+0x74>
movsd  -0x8(%rbp),%xmm1
mov    0x2eb8(%rip),%rax
movsd  (%rax),%xmm0
xor    %eax,%eax
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jbe    1174 <stdlib_base_is_finite+0x74>
movsd  -0x8(%rbp),%xmm0
mov    0x2e99(%rip),%rax
movsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@HUGE_VAL = constant double 0.000000e+00
define i32 @stdlib_base_is_finite(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp oeq double %3, %4
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load double, double* %2
%8 = load double, double* @HUGE_VAL
%9 = fcmp olt double %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load double, double* %2
%12 = load double, double* @HUGE_VAL
%13 = fneg double %12
%14 = fcmp ogt double %11, %13
br label %15
15: ; preds = %10, %6, %1
%16 = phi i1 [ false, %6 ], [ false, %1 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@HUGE_VAL = constant double 0.000000e+00
define i32 @stdlib_base_is_finite(double %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ myprint_char(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void myprint(int a) {
  char *output = malloc(60);
  sprintf(output, "output = %i", a);
  myprint_char(output);
  free(output);
}


x86 assembly (clang, -O0):
<myprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3c,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe99(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <myprint_char@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myprint>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x3c,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xea7(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <myprint_char@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"output = %i\00"
define void @myprint(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 60)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
%9 = call i32 @myprint_char(i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"output = %i\00"
define void @myprint(i32 %0) {
%2 = tail call dereferenceable_or_null(60) i8* @malloc(i32 60)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @myprint_char(i8* %2)
%5 = tail call i32 @free(i8* %2)
ret void
}
unsigned int Thrd_Get_Bits1(signed int t) {
  unsigned int return_value_Thrd_Get_Bits$1;
  return_value_Thrd_Get_Bits$1 = Thrd_Get_Bits(t, 1);
  return return_value_Thrd_Get_Bits$1;
}


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

x86 assembly (clang, -O2):
<Thrd_Get_Bits1>:
mov    $0x1,%esi
xor    %eax,%eax
jmp    1030 <Thrd_Get_Bits@plt>

LLVM IR (-O0):
define i32 @Thrd_Get_Bits1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @Thrd_Get_Bits to i32 (i32, i32, ...)*)(i32 %4, i32 1)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @Thrd_Get_Bits1(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @Thrd_Get_Bits to i32 (i32, i32, ...)*)(i32 %0, i32 1)
ret i32 %2
}
int cw1200_itp_init(struct cw1200_common *priv) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.cw1200_common = type opaque
define i32 @cw1200_itp_init(%struct.cw1200_common* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_shell_sort(int *, int, int);
void insert_sort(int arr[], int n) { do_shell_sort(arr, n, 1); }


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

x86 assembly (clang, -O2):
<insert_sort>:
mov    $0x1,%edx
jmp    1030 <do_shell_sort@plt>

LLVM IR (-O0):
define void @insert_sort(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 @do_shell_sort(i32* %5, i32 %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @insert_sort(i32* %0, i32 %1) {
%3 = tail call i32 @do_shell_sort(i32* %0, i32 %1, i32 1)
ret void
}
int smallest(int x, int y, int z) {
  return ((x < y) ? ((x < z) ? x : z) : ((z < y) ? z : y));
}


x86 assembly (clang, -O0):
<smallest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1141 <smallest+0x41>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1130 <smallest+0x30>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <smallest+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <smallest+0x64>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <smallest+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    115e <smallest+0x5e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smallest>:
mov    %edx,%eax
cmp    %edx,%edi
cmovl  %edi,%eax
cmp    %esi,%eax
cmovge %esi,%eax
ret

LLVM IR (-O0):
define i32 @smallest(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i32, i32* %4
br label %18
16: ; preds = %10
%17 = load i32, i32* %6
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
br label %30
20: ; preds = %3
%21 = load i32, i32* %6
%22 = load i32, i32* %5
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = load i32, i32* %6
br label %28
26: ; preds = %20
%27 = load i32, i32* %5
br label %28
28: ; preds = %26, %24
%29 = phi i32 [ %25, %24 ], [ %27, %26 ]
br label %30
30: ; preds = %28, %18
%31 = phi i32 [ %19, %18 ], [ %29, %28 ]
ret i32 %31
}

LLVM IR (-O2):
define i32 @smallest(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %2
%5 = select i1 %4, i32 %0, i32 %2
%6 = icmp slt i32 %5, %1
%7 = select i1 %6, i32 %5, i32 %1
ret i32 %7
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
uid_t getuid(void) {
  ;
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @getuid() {
ret i32 1
}

LLVM IR (-O2):
define i32 @getuid() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x2b() {
  Assert_real((isgraph(43)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              220, ("isgraph should be 1 for +"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x2b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xdc,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x2b>:
push   %rax
mov    $0x2b,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xdc,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for +\00"
define void @t_isgraph_0x2b() {
%1 = call i32 @isgraph(i32 43)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 220, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for +\00"
define void @t_isgraph_0x2b() {
%1 = tail call i32 @isgraph(i32 43)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 220, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float _accumulate_for_summing(float total_so_far, float increment) {
  return (total_so_far + increment);
}


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

x86 assembly (clang, -O2):
<_accumulate_for_summing>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @_accumulate_for_summing(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @_accumulate_for_summing(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
int ASCII_TO_INT(unsigned char ascii_text[2]) {
  ascii_text[1] -= 0x30;
  ascii_text[0] -= 0x30;
  return (int)ascii_text[0] * 10 + ascii_text[1];
}


x86 assembly (clang, -O0):
<ASCII_TO_INT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
sub    $0x30,%ecx
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
sub    $0x30,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
imul   $0xa,%eax,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASCII_TO_INT>:
mov    (%rdi),%al
mov    0x1(%rdi),%cl
add    $0xd0,%cl
mov    %cl,0x1(%rdi)
add    $0xd0,%al
mov    %al,(%rdi)
movzbl %al,%eax
lea    (%rax,%rax,4),%eax
movzbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @ASCII_TO_INT(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = sub nsw i32 %6, 48
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = sub nsw i32 %12, 48
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = mul nsw i32 %18, 10
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = add nsw i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @ASCII_TO_INT(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = add i8 %3, -48
store i8 %4, i8* %2
%5 = load i8, i8* %0
%6 = add i8 %5, -48
store i8 %6, i8* %0
%7 = zext i8 %6 to i32
%8 = mul nuw nsw i32 %7, 10
%9 = zext i8 %4 to i32
%10 = add nuw nsw i32 %8, %9
ret i32 %10
}
/* Variables and functions */
int mkopt(int /*<<< orphan*/);
int /*<<< orphan*/ mkposcl(int);
int mkclos(int state) { return mkopt(mkposcl(state)); }


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

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

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

LLVM IR (-O2):
define i32 @mkclos(i32 %0) {
%2 = tail call i32 @mkposcl(i32 %0)
%3 = tail call i32 @mkopt(i32 %2)
ret i32 %3
}
void t_getsize(int *lines, int *cols) {
  *cols = 80;
  *lines = 24;
}


x86 assembly (clang, -O0):
<t_getsize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x50,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x18,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_getsize>:
movl   $0x50,(%rsi)
movl   $0x18,(%rdi)
ret

LLVM IR (-O0):
define void @t_getsize(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
store i32 80, i32* %5
%6 = load i32*, i32** %3
store i32 24, i32* %6
ret void
}

LLVM IR (-O2):
define void @t_getsize(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 80, i32* %1
store i32 24, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ scanf(char *, char *);
int main(void) {
  char buf[100];
  while (scanf("%s", buf) != EOF) {
    printf("hello, %s\n", buf);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     1164 <main+0x44>
lea    -0x70(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xece(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    0x2ea7(%rip),%r12
cmp    (%r12),%rax
je     117c <main+0x5c>
lea    0xeb5(%rip),%r14
mov    %rsp,%rbx
lea    0xea8(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [11 x i8] c"hello, %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i64, i64* @EOF
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [11 x i8] c"hello, %s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %0, %6
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%8 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %6
11: ; preds = %6, %0
ret i32 0
}
int ascii85_decode(char *encoded, int length, void *buffer) {}


x86 assembly (clang, -O0):
<ascii85_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ascii85_decode(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 undef
}