xunge/DecIR huggingface dataset:
/* Type definitions */
struct genlist {
  int dummy;
};
struct fileinfo_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_sort(struct genlist *,
                                int (*)(void const *, void const *));
void fileinfo_list_sort(struct fileinfo_list *tthis,
                        int (*compar)(const struct fileinfo *const *,
                                      const struct fileinfo *const *)) {
  genlist_sort((struct genlist *)tthis,
               (int (*)(const void *, const void *))compar);
}


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

x86 assembly (clang, -O2):
<fileinfo_list_sort>:
jmp    1030 <genlist_sort@plt>

LLVM IR (-O0):
%struct.fileinfo_list = type { i32 }
%struct.fileinfo = type opaque
%struct.genlist = type { i32 }
define void @fileinfo_list_sort(%struct.fileinfo_list* %0, i32 (%struct.fileinfo**, %struct.fileinfo**)* %1) {
%3 = alloca %struct.fileinfo_list*
%4 = alloca i32 (%struct.fileinfo**, %struct.fileinfo**)*
store %struct.fileinfo_list* %0, %struct.fileinfo_list** %3
store i32 (%struct.fileinfo**, %struct.fileinfo**)* %1, i32 (%struct.fileinfo**, %struct.fileinfo**)** %4
%5 = load %struct.fileinfo_list*, %struct.fileinfo_list** %3
%6 = bitcast %struct.fileinfo_list* %5 to %struct.genlist*
%7 = load i32 (%struct.fileinfo**, %struct.fileinfo**)*, i32 (%struct.fileinfo**, %struct.fileinfo**)** %4
%8 = bitcast i32 (%struct.fileinfo**, %struct.fileinfo**)* %7 to i32 (i8*, i8*)*
%9 = call i32 @genlist_sort(%struct.genlist* %6, i32 (i8*, i8*)* %8)
ret void
}

LLVM IR (-O2):
%struct.fileinfo_list = type { i32 }
%struct.fileinfo = type opaque
%struct.genlist = type { i32 }
define void @fileinfo_list_sort(%struct.fileinfo_list* %0, i32 (%struct.fileinfo**, %struct.fileinfo**)* %1) {
%3 = bitcast %struct.fileinfo_list* %0 to %struct.genlist*
%4 = bitcast i32 (%struct.fileinfo**, %struct.fileinfo**)* %1 to i32 (i8*, i8*)*
%5 = tail call i32 @genlist_sort(%struct.genlist* %3, i32 (i8*, i8*)* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_int_set();
int main(int argc, char *argv[]) {
  test_int_set();
  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)
mov    $0x0,%al
call   1030 <test_int_set@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_int_set()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_int_set()
ret i32 0
}
void SysTickIntDisable(void) {
  (*((volatile unsigned long *)(0xE000E010))) &= ~(0x00000002);
}


x86 assembly (clang, -O0):
<SysTickIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e010,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    $0xe000e010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysTickIntDisable>:
mov    $0xe000e010,%eax
andq   $0xfffffffffffffffd,(%rax)
ret

LLVM IR (-O0):
define void @SysTickIntDisable() {
%1 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 3758153744 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysTickIntDisable() {
%1 = load volatile i64, i64* inttoptr (i64 3758153744 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 3758153744 to i64*)
ret void
}
/* Variables and functions */
scalar_t__ ETIMEDOUT;
scalar_t__ errno;
int ir_hash_match(unsigned char *);
unsigned char *ir_poll_code();
int ir_poll_command(void) {
  unsigned char *code;
  code = ir_poll_code();
  if (code) {
    return ir_hash_match(code);
  } else {
    if (errno == ETIMEDOUT) {
      return 0;
    } else {
      return -1;
    }
  }
}


x86 assembly (clang, -O0):
<ir_poll_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ir_poll_code@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114f <ir_poll_command+0x2f>
mov    -0x10(%rbp),%rdi
call   1040 <ir_hash_match@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <ir_poll_command+0x5c>
mov    0x2e8a(%rip),%rax
mov    (%rax),%rax
mov    0x2e78(%rip),%rcx
cmp    (%rcx),%rax
jne    1175 <ir_poll_command+0x55>
movl   $0x0,-0x4(%rbp)
jmp    117c <ir_poll_command+0x5c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ir_poll_command>:
push   %rax
xor    %eax,%eax
call   1030 <ir_poll_code@plt>
test   %rax,%rax
je     1136 <ir_poll_command+0x16>
mov    %rax,%rdi
pop    %rax
jmp    1040 <ir_hash_match@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%rcx
mov    0x2e91(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
setne  %al
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i64 0
@ETIMEDOUT = global i64 0
define i32 @ir_poll_command() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* (...) @ir_poll_code()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = call i32 @ir_hash_match(i8* %7)
store i32 %8, i32* %1
br label %15
9: ; preds = %0
%10 = load i64, i64* @errno
%11 = load i64, i64* @ETIMEDOUT
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 0, i32* %1
br label %15
14: ; preds = %9
store i32 -1, i32* %1
br label %15
15: ; preds = %14, %13, %6
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@errno = global i64 0
@ETIMEDOUT = global i64 0
define i32 @ir_poll_command() {
%1 = tail call i8* (...) @ir_poll_code()
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @ir_hash_match(i8* %1)
br label %10
5: ; preds = %0
%6 = load i64, i64* @errno
%7 = load i64, i64* @ETIMEDOUT
%8 = icmp ne i64 %6, %7
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %5, %3
%11 = phi i32 [ %4, %3 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void bit_test_main() {
  int bits = 0000;
  bits |= 0x2;
  printf("%s\n", "HELLO");
  printf("%d\n", bits);
}


x86 assembly (clang, -O0):
<bit_test_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x4(%rbp)
lea    0xed1(%rip),%rdi
lea    0xece(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_test_main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed2(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"HELLO\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define void @bit_test_main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int munmap(void *addr, size_t len) {
  free(addr);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @munmap(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void i2c_usleep(unsigned int useconds) { usleep(useconds); }


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

x86 assembly (clang, -O2):
<i2c_usleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @i2c_usleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ function();
void function2() { function(); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ bswap_16(int /*<<< orphan*/);
Elf32_Half read_elf_half(Elf32_Half half, bool swap) {
  return swap ? bswap_16(half) : half;
}


x86 assembly (clang, -O0):
<read_elf_half>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1138 <read_elf_half+0x28>
mov    -0x4(%rbp),%edi
call   1030 <bswap_16@plt>
mov    %eax,-0xc(%rbp)
jmp    113e <read_elf_half+0x2e>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_elf_half>:
test   %esi,%esi
je     1119 <read_elf_half+0x9>
jmp    1030 <bswap_16@plt>
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @read_elf_half(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @bswap_16(i32 %8)
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %9, %7 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @read_elf_half(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @bswap_16(i32 %0)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ %0, %2 ]
ret i32 %7
}
unsigned long hash(unsigned char *str) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hash+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ RamWrite32A(int, int);
unsigned char RdStatus(int);
void SetStill(void) {
  unsigned char UcStRd = 1;
  RamWrite32A(0xF013, 0x00000001);
  while (UcStRd) {
    UcStRd = RdStatus(1);
  }
}


x86 assembly (clang, -O0):
<SetStill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x1,-0x1(%rbp)
mov    $0xf013,%edi
mov    $0x1,%esi
call   1030 <RamWrite32A@plt>
cmpb   $0x0,-0x1(%rbp)
je     1157 <SetStill+0x37>
mov    $0x1,%edi
call   1040 <RdStatus@plt>
mov    %al,-0x1(%rbp)
jmp    113b <SetStill+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetStill>:
push   %rax
mov    $0xf013,%edi
mov    $0x1,%esi
call   1030 <RamWrite32A@plt>
mov    $0x1,%edi
call   1040 <RdStatus@plt>
test   %al,%al
jne    1130 <SetStill+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @SetStill() {
%1 = alloca i8
store i8 1, i8* %1
%2 = call i32 @RamWrite32A(i32 61459, i32 1)
br label %3
3: ; preds = %6, %0
%4 = load i8, i8* %1
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call zeroext i8 @RdStatus(i32 1)
store i8 %7, i8* %1
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @SetStill() {
%1 = tail call i32 @RamWrite32A(i32 61459, i32 1)
br label %2
2: ; preds = %0, %2
%3 = tail call zeroext i8 @RdStatus(i32 1)
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void null_load(uint8_t id) {}


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

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

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

LLVM IR (-O2):
define void @null_load(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lv_rec_start();
int /*<<< orphan*/ msleep(int);
void lv_rec_menu_start() {
  msleep(2000);
  lv_rec_start();
}


x86 assembly (clang, -O0):
<lv_rec_menu_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7d0,%edi
call   1040 <msleep@plt>
mov    $0x0,%al
call   1030 <lv_rec_start@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lv_rec_menu_start>:
push   %rax
mov    $0x7d0,%edi
call   1040 <msleep@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <lv_rec_start@plt>

LLVM IR (-O0):
define void @lv_rec_menu_start() {
%1 = call i32 @msleep(i32 2000)
%2 = call i32 (...) @lv_rec_start()
ret void
}

LLVM IR (-O2):
define void @lv_rec_menu_start() {
%1 = tail call i32 @msleep(i32 2000)
%2 = tail call i32 (...) @lv_rec_start()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_string_hex(char *b, int n) {
  while (n-- != 0) {
    printf("%x ", *(b++));
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_string_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1158 <print_string_hex+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111f <print_string_hex+0xf>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string_hex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     1158 <print_string_hex+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1140 <print_string_hex+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x \00"
define void @print_string_hex(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = sext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp eq i32 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
int count(int n) {
  int bit = 0;
  while (n > 0) {
    bit += n & 1;
    n >>= 1;
  }
  return bit;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1132 <count+0x32>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <count+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
xor    %eax,%eax
test   %edi,%edi
jle    1120 <count+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <count+0x10>
ret

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

LLVM IR (-O2):
define i32 @count(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
int validateCardAndPin(char atmCardNumber[], int atmPin) { return 1; }


x86 assembly (clang, -O0):
<validateCardAndPin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @validateCardAndPin(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 1
}

LLVM IR (-O2):
define i32 @validateCardAndPin(i8* nocapture readnone %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ sa_teardown_all();
void ui_teardown_all(char *cmd) { sa_teardown_all(); }


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

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

LLVM IR (-O0):
define void @ui_teardown_all(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @sa_teardown_all()
ret void
}

LLVM IR (-O2):
define void @ui_teardown_all(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @sa_teardown_all()
ret void
}
void _vDispAssert(unsigned char *pszFileName, unsigned long ulLineNo) {}


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

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

LLVM IR (-O0):
define void @_vDispAssert(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @_vDispAssert(i8* nocapture %0, i64 %1) {
ret void
}
/* Type definitions */
struct _term_docs {
  int dummy;
};
struct _term {
  int dummy;
};
struct _index_reader {
  int dummy;
};

/* Variables and functions */
struct _term_docs *term_docs_initial(struct _index_reader *);
int /*<<< orphan*/ term_docs_seek_term(struct _term_docs *, struct _term *);
struct _term_docs *index_reader_term_docs(struct _index_reader *ir,
                                          struct _term *term) {
  struct _term_docs *term_docs = term_docs_initial(ir);
  term_docs_seek_term(term_docs, term);
  return term_docs;
}


x86 assembly (clang, -O0):
<index_reader_term_docs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <term_docs_initial@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <term_docs_seek_term@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_reader_term_docs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <term_docs_initial@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <term_docs_seek_term@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct._term_docs = type { i32 }
%struct._index_reader = type { i32 }
%struct._term = type { i32 }
define %struct._term_docs* @index_reader_term_docs(%struct._index_reader* %0, %struct._term* %1) {
%3 = alloca %struct._index_reader*
%4 = alloca %struct._term*
%5 = alloca %struct._term_docs*
store %struct._index_reader* %0, %struct._index_reader** %3
store %struct._term* %1, %struct._term** %4
%6 = load %struct._index_reader*, %struct._index_reader** %3
%7 = call %struct._term_docs* @term_docs_initial(%struct._index_reader* %6)
store %struct._term_docs* %7, %struct._term_docs** %5
%8 = load %struct._term_docs*, %struct._term_docs** %5
%9 = load %struct._term*, %struct._term** %4
%10 = call i32 @term_docs_seek_term(%struct._term_docs* %8, %struct._term* %9)
%11 = load %struct._term_docs*, %struct._term_docs** %5
ret %struct._term_docs* %11
}

LLVM IR (-O2):
%struct._term_docs = type { i32 }
%struct._index_reader = type { i32 }
%struct._term = type { i32 }
define %struct._term_docs* @index_reader_term_docs(%struct._index_reader* %0, %struct._term* %1) {
%3 = tail call %struct._term_docs* @term_docs_initial(%struct._index_reader* %0)
%4 = tail call i32 @term_docs_seek_term(%struct._term_docs* %3, %struct._term* %1)
ret %struct._term_docs* %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ height;
};
struct TYPE_4__ {
  TYPE_1__ xcreatewindow;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xcreatewindow_height(void *_p) {
  return (int)((XEvent *)_p)->xcreatewindow.height;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xcreatewindow_height>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xcreatewindow_height(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xcreatewindow_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 14;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xe,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xece(%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    $0xa,%esi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0xe,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 14, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 14)
ret i32 0
}
/* Variables and functions */
int fastio_read(int, double *, int);
int fastio_read_doubles(int fd, double *val, int size) {
  return fastio_read(fd, val, sizeof(double) * size);
}


x86 assembly (clang, -O0):
<fastio_read_doubles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <fastio_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastio_read_doubles>:
shl    $0x3,%edx
jmp    1030 <fastio_read@plt>

LLVM IR (-O0):
define i32 @fastio_read_doubles(i32 %0, double* %1, i32 %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca i32
store i32 %0, i32* %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load double*, double** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 8, %10
%12 = trunc i64 %11 to i32
%13 = call i32 @fastio_read(i32 %7, double* %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @fastio_read_doubles(i32 %0, double* %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = tail call i32 @fastio_read(i32 %0, double* %1, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ LOG_PID;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
int write_log(char *log) {
  openlog("SDK ", LOG_PID, LOG_USER);
  syslog(LOG_INFO, "Debug programm SDK: %s", log);
  closelog();
  return 0;
}


x86 assembly (clang, -O0):
<write_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
lea    0xeab(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe97(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_log>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
lea    0xeb3(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xea3(%rip),%rsi
mov    %rbx,%rdx
call   1040 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"SDK \00"
@LOG_PID = global i32 0
@LOG_USER = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [23 x i8] c"Debug programm SDK: %s\00"
define i32 @write_log(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_PID
%4 = load i32, i32* @LOG_USER
%5 = call i32 @openlog(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* @LOG_INFO
%7 = load i8*, i8** %2
%8 = call i32 @syslog(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = call i32 (...) @closelog()
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"SDK \00"
@LOG_PID = global i32 0
@LOG_USER = global i32 0
@LOG_INFO = global i32 0
@.str.1 = [23 x i8] c"Debug programm SDK: %s\00"
define i32 @write_log(i8* %0) {
%2 = load i32, i32* @LOG_PID
%3 = load i32, i32* @LOG_USER
%4 = tail call i32 @openlog(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = load i32, i32* @LOG_INFO
%6 = tail call i32 @syslog(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%7 = tail call i32 (...) @closelog()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void cr_dump_string_line(char *s) { fprintf(stderr, "%s\n", s); }


x86 assembly (clang, -O0):
<cr_dump_string_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cr_dump_string_line>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @cr_dump_string_line(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SADD16(uint32_t x, uint32_t y) {
  int32_t r = 0, s = 0;
  r = ((((int32_t)x << 16) >> 16) + (((int32_t)y << 16) >> 16)) &
      (int32_t)0x0000FFFF;
  s = ((((int32_t)x) >> 16) + (((int32_t)y) >> 16)) & (int32_t)0x0000FFFF;
  return ((uint32_t)((s << 16) | (r)));
}


x86 assembly (clang, -O0):
<__SADD16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
sar    $0x10,%ecx
add    %ecx,%eax
and    $0xffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
sar    $0x10,%ecx
add    %ecx,%eax
and    $0xffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x10,%eax
or     -0x14(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SADD16>:
lea    (%rsi,%rdi,1),%eax
movzwl %ax,%eax
and    $0xffff0000,%edi
add    %esi,%edi
and    $0xffff0000,%edi
or     %eax,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @__SADD16(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 16
%14 = ashr i32 %13, 16
%15 = add nsw i32 %10, %14
%16 = and i32 %15, 65535
store i32 %16, i32* %5
%17 = load i64, i64* %3
%18 = trunc i64 %17 to i32
%19 = ashr i32 %18, 16
%20 = load i64, i64* %4
%21 = trunc i64 %20 to i32
%22 = ashr i32 %21, 16
%23 = add nsw i32 %19, %22
%24 = and i32 %23, 65535
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = shl i32 %25, 16
%27 = load i32, i32* %5
%28 = or i32 %26, %27
%29 = sext i32 %28 to i64
ret i64 %29
}

LLVM IR (-O2):
define i64 @__SADD16(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = and i64 %3, 65535
%5 = and i64 %0, 4294901760
%6 = add i64 %5, %1
%7 = and i64 %6, 4294901760
%8 = or i64 %7, %4
%9 = shl nuw i64 %8, 32
%10 = ashr exact i64 %9, 32
ret i64 %10
}
void exitI8k(void) {}


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

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

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

LLVM IR (-O2):
define void @exitI8k() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct abr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ affiche_huffman_rec(struct abr *, int /*<<< orphan*/ *,
                                       int /*<<< orphan*/);
void affiche_huffman(struct abr *huff) {
  if (huff) {
    uint8_t code[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    uint8_t nbits = 0;
    affiche_huffman_rec(huff, code, nbits);
  }
}


x86 assembly (clang, -O0):
<affiche_huffman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115e <affiche_huffman+0x3e>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movl   $0x0,-0x54(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    -0x54(%rbp),%edx
call   1040 <affiche_huffman_rec@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<affiche_huffman>:
test   %rdi,%rdi
je     113d <affiche_huffman+0x2d>
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <affiche_huffman_rec@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
%struct.abr = type { i32 }
define void @affiche_huffman(%struct.abr* %0) {
%2 = alloca %struct.abr*
%3 = alloca [16 x i32]
%4 = alloca i32
store %struct.abr* %0, %struct.abr** %2
%5 = load %struct.abr*, %struct.abr** %2
%6 = icmp ne %struct.abr* %5, null
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = bitcast [16 x i32]* %3 to i8*
store i32 0, i32* %4
%9 = load %struct.abr*, %struct.abr** %2
%10 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%11 = load i32, i32* %4
%12 = call i32 @affiche_huffman_rec(%struct.abr* %9, i32* %10, i32 %11)
br label %13
13: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
%struct.abr = type { i32 }
define void @affiche_huffman(%struct.abr* %0) {
%2 = alloca [16 x i32]
%3 = icmp eq %struct.abr* %0, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = bitcast [16 x i32]* %2 to i8*
%6 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%7 = call i32 @affiche_huffman_rec(%struct.abr* %0, i32* %6, i32 0)
br label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int fcntl(int, int /*<<< orphan*/, int);
int clr_flag(int fd, int flags) {
  int val = -1;
  if ((val = fcntl(fd, F_GETFL, 0)) >= 0) {
    val &= ~flags;
    val = fcntl(fd, F_SETFL, val);
  }
  return (val >= 0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<clr_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1167 <clr_flag+0x57>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovge %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_flag>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
test   %eax,%eax
js     1141 <clr_flag+0x31>
not    %ebp
and    %ebp,%eax
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
call   1030 <fcntl@plt>
not    %eax
shr    $0x1f,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
define i32 @clr_flag(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 -1, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* @F_GETFL
%8 = call i32 @fcntl(i32 %6, i32 %7, i32 0)
store i32 %8, i32* %5
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %2
%11 = load i32, i32* %4
%12 = xor i32 %11, -1
%13 = load i32, i32* %5
%14 = and i32 %13, %12
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = load i32, i32* @F_SETFL
%17 = load i32, i32* %5
%18 = call i32 @fcntl(i32 %15, i32 %16, i32 %17)
store i32 %18, i32* %5
br label %19
19: ; preds = %10, %2
%20 = load i32, i32* %5
%21 = icmp sge i32 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 1, i32 0
ret i32 %23
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
define i32 @clr_flag(i32 %0, i32 %1) {
%3 = load i32, i32* @F_GETFL
%4 = tail call i32 @fcntl(i32 %0, i32 %3, i32 0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = xor i32 %1, -1
%8 = and i32 %4, %7
%9 = load i32, i32* @F_SETFL
%10 = tail call i32 @fcntl(i32 %0, i32 %9, i32 %8)
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ %10, %6 ], [ %4, %2 ]
%13 = xor i32 %12, -1
%14 = lshr i32 %13, 31
ret i32 %14
}
void get_xyz(const double *x, double *xyz) {
  xyz[0] = x[0];
  xyz[1] = x[1];
  xyz[2] = x[2];
}


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

x86 assembly (clang, -O2):
<get_xyz>:
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
movsd  0x8(%rdi),%xmm0
movsd  %xmm0,0x8(%rsi)
movsd  0x10(%rdi),%xmm0
movsd  %xmm0,0x10(%rsi)
ret

LLVM IR (-O0):
define void @get_xyz(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %3
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %4
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double*, double** %3
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
%18 = load double*, double** %4
%19 = getelementptr inbounds double, double* %18, i64 2
store double %17, double* %19
ret void
}

LLVM IR (-O2):
define void @get_xyz(double* nocapture %0, double* nocapture writeonly %1) {
%3 = load double, double* %0
store double %3, double* %1
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %1, i64 1
store double %5, double* %6
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 2
store double %8, double* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_null(void *, char *, int);
scalar_t__ sieve_create(int);
void __ctest_sieve_create_returns_NULL_for_upper_bound_less_than_2_run() {
  assert_null((void *)sieve_create(1),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/kjmj/c-sieve/refs/heads/master/src/"
              "test/test_sieve.c",
              28);
}


x86 assembly (clang, -O0):
<__ctest_sieve_create_returns_NULL_for_upper_bound_less_than_2_run>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <sieve_create@plt>
mov    %rax,%rdi
lea    0xec8(%rip),%rsi
mov    $0x1c,%edx
call   1030 <assert_null@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ctest_sieve_create_returns_NULL_for_upper_bound_less_than_2_run>:
push   %rax
mov    $0x1,%edi
call   1040 <sieve_create@plt>
lea    0xece(%rip),%rsi
mov    %rax,%rdi
mov    $0x1c,%edx
pop    %rax
jmp    1030 <assert_null@plt>

LLVM IR (-O0):
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kjmj/c-sieve/refs/heads/master/src/test/test_sieve.c\00"
define void @__ctest_sieve_create_returns_NULL_for_upper_bound_less_than_2_run() {
%1 = call i64 @sieve_create(i32 1)
%2 = inttoptr i64 %1 to i8*
%3 = call i32 @assert_null(i8* %2, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 28)
ret void
}

LLVM IR (-O2):
@.str = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/kjmj/c-sieve/refs/heads/master/src/test/test_sieve.c\00"
define void @__ctest_sieve_create_returns_NULL_for_upper_bound_less_than_2_run() {
%1 = tail call i64 @sieve_create(i32 1)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @assert_null(i8* %2, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str, i64 0, i64 0), i32 28)
ret void
}
/* Variables and functions */
size_t get_pdp_index(uintptr_t virt_address) {
  return (virt_address >> 30) & 0x1FF;
}


x86 assembly (clang, -O0):
<get_pdp_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1e,%rax
and    $0x1ff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pdp_index>:
mov    %rdi,%rax
shr    $0x1e,%rax
and    $0x1ff,%eax
ret

LLVM IR (-O0):
define i64 @get_pdp_index(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 30
%5 = and i64 %4, 511
ret i64 %5
}

LLVM IR (-O2):
define i64 @get_pdp_index(i64 %0) {
%2 = lshr i64 %0, 30
%3 = and i64 %2, 511
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ link_error0();
void test1(int x, int y) {
  if ((x == y) && (x != y))
    link_error0();
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113d <test1+0x2d>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     113d <test1+0x2d>
mov    $0x0,%al
call   1030 <link_error0@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test1(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 = icmp eq i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (...) @link_error0()
br label %14
14: ; preds = %12, %8, %2
ret void
}

LLVM IR (-O2):
define void @test1(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
unsigned char *cbor_write_type_long_size(unsigned char *, unsigned int, int,
                                         unsigned long long);
unsigned char *cbor_write_nlong(unsigned char *data, unsigned int size,
                                unsigned long long value) {
  return cbor_write_type_long_size(data, size, 1, value);
}


x86 assembly (clang, -O0):
<cbor_write_nlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <cbor_write_type_long_size@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbor_write_nlong>:
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <cbor_write_type_long_size@plt>

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

LLVM IR (-O2):
define i8* @cbor_write_nlong(i8* %0, i32 %1, i64 %2) {
%4 = tail call i8* @cbor_write_type_long_size(i8* %0, i32 %1, i32 1, i64 %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ cpu_to_be32(int /*<<< orphan*/);
void cpu_to_be32w(uint32_t *p, uint32_t v) { *p = cpu_to_be32(v); }


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

x86 assembly (clang, -O2):
<cpu_to_be32w>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <cpu_to_be32@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cpu_to_be32w(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @cpu_to_be32(i32 %1)
store i32 %3, i32* %0
ret void
}