xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void os_close_file(void *opaque) {
  FILE *stream = (FILE *)opaque;
  fclose(stream);
}


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

x86 assembly (clang, -O2):
<os_close_file>:
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define void @os_close_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fclose(i32* %6)
ret void
}

LLVM IR (-O2):
define void @os_close_file(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fclose(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int set_non_blocking(int fd) {
  int flags;
  flags = fcntl(fd, F_GETFL, 0);
  if (flags == -1)
    return -1;
  flags |= O_NONBLOCK;
  return fcntl(fd, F_SETFL, flags);
}


x86 assembly (clang, -O0):
<set_non_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1147 <set_non_blocking+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <set_non_blocking+0x5d>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_non_blocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     1144 <set_non_blocking+0x34>
mov    0x2eb9(%rip),%rcx
or     (%rcx),%eax
mov    0x2ea0(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @set_non_blocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @F_GETFL
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %19
11: ; preds = %1
%12 = load i32, i32* @O_NONBLOCK
%13 = load i32, i32* %4
%14 = or i32 %13, %12
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = load i32, i32* @F_SETFL
%17 = load i32, i32* %4
%18 = call i32 @fcntl(i32 %15, i32 %16, i32 %17)
store i32 %18, i32* %2
br label %19
19: ; preds = %11, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define i32 @set_non_blocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @O_NONBLOCK
%7 = or i32 %6, %3
%8 = load i32, i32* @F_SETFL
%9 = tail call i32 @fcntl(i32 %0, i32 %8, i32 %7)
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ -1, %1 ]
ret i32 %11
}
unsigned int operands_fix_8bit_rex_base(unsigned int reg) {
  if ((reg >= 4) && (reg < 8))
    return reg + 64 - 4;
  return reg + 48;
}


x86 assembly (clang, -O0):
<operands_fix_8bit_rex_base>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jb     112c <operands_fix_8bit_rex_base+0x2c>
cmpl   $0x8,-0x8(%rbp)
jae    112c <operands_fix_8bit_rex_base+0x2c>
mov    -0x8(%rbp),%eax
add    $0x40,%eax
sub    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <operands_fix_8bit_rex_base+0x35>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<operands_fix_8bit_rex_base>:
lea    0x30(%rdi),%ecx
lea    0x3c(%rdi),%eax
mov    %edi,%edx
and    $0xfffffffc,%edx
cmp    $0x4,%edx
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @operands_fix_8bit_rex_base(i32 %0) {
%2 = and i32 %0, -4
%3 = icmp eq i32 %2, 4
%4 = select i1 %3, i32 60, i32 48
%5 = add i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void logor_handler(void) {
  write_src("{\n");
  write_src("imm_t b = POP();\n");
  write_src("imm_t a = POP();\n");
  write_src("PUSH(a||b);\n");
  write_src("}\n");
}


x86 assembly (clang, -O0):
<logor_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedc(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee2(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee9(%rip),%rdi
call   1030 <write_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<logor_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedf(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeeb(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeec(%rip),%rdi
pop    %rax
jmp    1030 <write_src@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [13 x i8] c"PUSH(a||b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @logor_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @write_src(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [13 x i8] c"PUSH(a||b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @logor_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @write_src(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sembuf {
  int sem_op;
  scalar_t__ sem_flg;
  scalar_t__ sem_num;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int semget(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ semop(int, struct sembuf *, int);
int main() {
  int id = semget(0x9999, 0, 0);
  struct sembuf op;
  op.sem_num = 0;
  op.sem_op = 1;
  op.sem_flg = 0;
  semop(id, &op, 1);
  printf("释放一个资源成功！\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x9999,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <semget@plt>
mov    %eax,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1050 <semop@plt>
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    $0x9999,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <semget@plt>
movl   $0x1,(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
mov    %rsp,%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1050 <semop@plt>
lea    0xe99(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i64, i64 }
@.str = [29 x i8] c"\E9\87\8A\E6\94\BE\E4\B8\80\E4\B8\AA\E8\B5\84\E6\BA\90\E6\88\90\E5\8A\9F\EF\BC\81\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.sembuf
%3 = call i32 @semget(i32 39321, i32 0, i32 0)
store i32 %3, i32* %1
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i32 0, i32 2
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i32 0, i32 0
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i32 0, i32 1
store i64 0, i64* %6
%7 = load i32, i32* %1
%8 = call i32 @semop(i32 %7, %struct.sembuf* %2, i32 1)
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i64, i64 }
@str = [28 x i8] c"\E9\87\8A\E6\94\BE\E4\B8\80\E4\B8\AA\E8\B5\84\E6\BA\90\E6\88\90\E5\8A\9F\EF\BC\81\00"
define i32 @main() {
%1 = alloca %struct.sembuf
%2 = tail call i32 @semget(i32 39321, i32 0, i32 0)
%3 = bitcast %struct.sembuf* %1 to i8*
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %1, i64 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %1, i64 0, i32 1
%6 = bitcast i64* %5 to <2 x i64>*
store <2 x i64> zeroinitializer, <2 x i64>* %6
%7 = call i32 @semop(i32 %2, %struct.sembuf* %1, i32 1)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_05(unsigned char *a, int b, int c) {
  if (a[0] < 128)
    return c;
  else
    return b + 50;
}


x86 assembly (clang, -O0):
<test_05>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x80,%eax
jge    112b <test_05+0x2b>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <test_05+0x34>
mov    -0x14(%rbp),%eax
add    $0x32,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_05>:
lea    0x32(%rsi),%eax
cmpb   $0x0,(%rdi)
cmovns %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_05(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp sgt i8 %4, -1
%6 = add nsw i32 %1, 50
%7 = select i1 %5, i32 %2, i32 %6
ret i32 %7
}
/* Type definitions */
struct in_addr {
  int s_addr;
};

/* Variables and functions */
int inet_addr(char const *);
int inet_aton(const char *cp, struct in_addr *inp) {
  inp->s_addr = inet_addr(cp);
  if (inp->s_addr == -1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<inet_aton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    114a <inet_aton+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1151 <inet_aton+0x41>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_aton>:
push   %rbx
mov    %rsi,%rbx
call   1030 <inet_addr@plt>
mov    %eax,(%rbx)
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @inet_aton(i8* %0, %struct.in_addr* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.in_addr*
store i8* %0, i8** %4
store %struct.in_addr* %1, %struct.in_addr** %5
%6 = load i8*, i8** %4
%7 = call i32 @inet_addr(i8* %6)
%8 = load %struct.in_addr*, %struct.in_addr** %5
%9 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %8, i32 0, i32 0
store i32 %7, i32* %9
%10 = load %struct.in_addr*, %struct.in_addr** %5
%11 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 0, i32* %3
br label %16
15: ; preds = %2
store i32 1, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i32 @inet_aton(i8* %0, %struct.in_addr* nocapture writeonly %1) {
%3 = tail call i32 @inet_addr(i8* %0)
%4 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %1, i64 0, i32 0
store i32 %3, i32* %4
%5 = icmp ne i32 %3, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __cxa_pure_virtual(void) { abort(); }


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

x86 assembly (clang, -O2):
<__cxa_pure_virtual>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @__cxa_pure_virtual() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @__cxa_pure_virtual() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x37() {
  Assert_real((isupper(55) == 0),
              "/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_isupper.c",
              280, ("isupper should be 0 for 7"));
}


x86 assembly (clang, -O0):
<t_isupper_0x37>:
push   %rbp
mov    %rsp,%rbp
mov    $0x37,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x118,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x37>:
push   %rax
mov    $0x37,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x118,%edx
pop    %rax
jmp    1040 <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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for 7\00"
define void @t_isupper_0x37() {
%1 = call i64 @isupper(i32 55)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 280, 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for 7\00"
define void @t_isupper_0x37() {
%1 = tail call i64 @isupper(i32 55)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 280, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int hex_nibble(int /*<<< orphan*/);
scalar_t__ isxdigit(int /*<<< orphan*/);
uint64_t gdb_decode_hex_str(uint8_t *bytes) {
  uint64_t value = 0;
  while (isxdigit(*bytes))
    value = 16 * value + hex_nibble(*bytes++);
  return value;
}


x86 assembly (clang, -O0):
<gdb_decode_hex_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <isxdigit@plt>
cmp    $0x0,%rax
je     1176 <gdb_decode_hex_str+0x56>
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%edi
call   1030 <hex_nibble@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <gdb_decode_hex_str+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdb_decode_hex_str>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1040 <isxdigit@plt>
test   %rax,%rax
je     115f <gdb_decode_hex_str+0x3f>
add    $0x4,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
shl    $0x4,%ebp
mov    -0x4(%rbx),%edi
call   1030 <hex_nibble@plt>
add    %eax,%ebp
mov    (%rbx),%edi
call   1040 <isxdigit@plt>
add    $0x4,%rbx
test   %rax,%rax
jne    1140 <gdb_decode_hex_str+0x20>
jmp    1161 <gdb_decode_hex_str+0x41>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @gdb_decode_hex_str(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i64 @isxdigit(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %12, %5 ], [ 0, %1 ]
%7 = phi i32* [ %9, %5 ], [ %0, %1 ]
%8 = shl nsw i32 %6, 4
%9 = getelementptr inbounds i32, i32* %7, i64 1
%10 = load i32, i32* %7
%11 = tail call i32 @hex_nibble(i32 %10)
%12 = add nsw i32 %11, %8
%13 = load i32, i32* %9
%14 = tail call i64 @isxdigit(i32 %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %1
%17 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %17
}
void __malloc_unlock(ptr) struct _reent *ptr;
{}


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

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

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

LLVM IR (-O2):
%struct._reent = type opaque
define void @__malloc_unlock(%struct._reent* nocapture %0) {
ret void
}
void hc_zero_lvector(x, n) unsigned short *x;
int n;
{
  int i;
  for (i = 0; i < n; i++)
    x[i] = 0;
}


x86 assembly (clang, -O0):
<hc_zero_lvector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113a <hc_zero_lvector+0x3a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movw   $0x0,(%rax,%rcx,2)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <hc_zero_lvector+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hc_zero_lvector>:
test   %esi,%esi
jle    1125 <hc_zero_lvector+0x15>
push   %rax
mov    %esi,%edx
add    %rdx,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @hc_zero_lvector(i16* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i16* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 1
br label %8
8: ; preds = %4, %2
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
struct timespec timespec_from_ms(int ms) {
  struct timespec r;
  r.tv_sec = ms / 1000;
  r.tv_nsec = (ms % 1000) * 1000000;
  return r;
}


x86 assembly (clang, -O0):
<timespec_from_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_from_ms>:
movslq %edi,%rcx
imul   $0x10624dd3,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
imul   $0x3e8,%eax,%edx
sub    %edx,%ecx
imul   $0xf4240,%ecx,%ecx
shl    $0x20,%rcx
or     %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i64 @timespec_from_ms(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %3
%8 = srem i32 %7, 1000
%9 = mul nsw i32 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i32 %9, i32* %10
%11 = bitcast %struct.timespec* %2 to i64*
%12 = load i64, i64* %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @timespec_from_ms(i32 %0) {
%2 = sdiv i32 %0, 1000
%3 = srem i32 %0, 1000
%4 = mul nsw i32 %3, 1000000
%5 = zext i32 %4 to i64
%6 = shl nuw i64 %5, 32
%7 = zext i32 %2 to i64
%8 = or i64 %6, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ hash_code(int);
int search(int, int /*<<< orphan*/);
int find_equivalent(int state) { return search(state, hash_code(state)); }


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

x86 assembly (clang, -O2):
<find_equivalent>:
push   %rbx
mov    %edi,%ebx
call   1040 <hash_code@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <search@plt>

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

LLVM IR (-O2):
define i32 @find_equivalent(i32 %0) {
%2 = tail call i32 @hash_code(i32 %0)
%3 = tail call i32 @search(i32 %0, i32 %2)
ret i32 %3
}
unsigned char _ucAsyncOpen(unsigned long ulBaud, unsigned char ucParity,
                           unsigned char ucBits, unsigned char ucStop) {
  return (2);
}


x86 assembly (clang, -O0):
<_ucAsyncOpen>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    $0x2,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ucAsyncOpen>:
mov    $0x2,%al
ret

LLVM IR (-O0):
define zeroext i8 @_ucAsyncOpen(i64 %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i64
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i64 %0, i64* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
ret i8 2
}

LLVM IR (-O2):
define zeroext i8 @_ucAsyncOpen(i64 %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
ret i8 2
}
/* Variables and functions */
int /*<<< orphan*/ GL_DEPTH_TEST;
int /*<<< orphan*/ GL_LIGHT0;
int /*<<< orphan*/ GL_LIGHTING;
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
void Init(void) {
  glEnable(GL_DEPTH_TEST);
  glEnable(GL_LIGHTING);
  glEnable(GL_LIGHT0);
}


x86 assembly (clang, -O0):
<Init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Init>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glEnable@plt>

LLVM IR (-O0):
@GL_DEPTH_TEST = global i32 0
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
define void @Init() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_LIGHTING
%4 = call i32 @glEnable(i32 %3)
%5 = load i32, i32* @GL_LIGHT0
%6 = call i32 @glEnable(i32 %5)
ret void
}

LLVM IR (-O2):
@GL_DEPTH_TEST = global i32 0
@GL_LIGHTING = global i32 0
@GL_LIGHT0 = global i32 0
define void @Init() {
%1 = load i32, i32* @GL_DEPTH_TEST
%2 = tail call i32 @glEnable(i32 %1)
%3 = load i32, i32* @GL_LIGHTING
%4 = tail call i32 @glEnable(i32 %3)
%5 = load i32, i32* @GL_LIGHT0
%6 = tail call i32 @glEnable(i32 %5)
ret void
}
int metatile_write(struct storage_backend *store, const char *xmlconfig,
                   const char *options, int x, int y, int z, const char *buf,
                   int sz) {
  return sz;
}


x86 assembly (clang, -O0):
<metatile_write>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<metatile_write>:
mov    0x10(%rsp),%eax
ret

LLVM IR (-O0):
%struct.storage_backend = type opaque
define i32 @metatile_write(%struct.storage_backend* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7) {
%9 = alloca %struct.storage_backend*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i32
store %struct.storage_backend* %0, %struct.storage_backend** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i8* %6, i8** %15
store i32 %7, i32* %16
%17 = load i32, i32* %16
ret i32 %17
}

LLVM IR (-O2):
%struct.storage_backend = type opaque
define i32 @metatile_write(%struct.storage_backend* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i32 %4, i32 %5, i8* nocapture readnone %6, i32 returned %7) {
ret i32 %7
}
void rop3_4_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_4_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_4_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_4_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_4_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ real_hello();
void hello() { real_hello(); }


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

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

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

LLVM IR (-O2):
define void @hello() {
%1 = tail call i32 (...) @real_hello()
ret void
}
/* Type definitions */
struct timespec {
  unsigned long long tv_sec;
  scalar_t__ tv_nsec;
};
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int64_t getTime(void) {
  struct timespec t;
  clock_gettime(CLOCK_REALTIME, &t);
  return (int64_t)(t.tv_nsec) + (t.tv_sec * 1000ULL * 1000ULL * 1000ULL);
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    -0x8(%rbp),%rax
imul   $0x3e8,-0x10(%rbp),%rcx
imul   $0x3e8,%rcx,%rcx
imul   $0x3e8,%rcx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x8(%rsp),%rax
9a 3b
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @getTime() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = mul i64 %7, 1000
%9 = mul i64 %8, 1000
%10 = mul i64 %9, 1000
%11 = add i64 %5, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_REALTIME = global i32 0
define i64 @getTime() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = mul i64 %8, 1000000000
%10 = add i64 %9, %6
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ ESPIPE;
int /*<<< orphan*/ errno;
__attribute__((weak)) off_t lseek(int fd, off_t offset, int whence) {
  (void)fd;
  (void)offset;
  (void)whence;
  errno = ESPIPE;
  return ((off_t)-1);
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ed4(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebb(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lseek>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ESPIPE = global i32 0
@errno = global i32 0
define weak i32 @lseek(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 = load i32, i32* %6
%10 = load i32, i32* @ESPIPE
store i32 %10, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ESPIPE = global i32 0
@errno = global i32 0
define weak i32 @lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ESPIPE
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ __set_PRIMASK(unsigned int);
__attribute__((always_)) void irq_restore(unsigned int state) {
  __set_PRIMASK(state);
}


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

x86 assembly (clang, -O2):
<irq_restore>:
jmp    1030 <__set_PRIMASK@plt>

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

LLVM IR (-O2):
define void @irq_restore(i32 %0) {
%2 = tail call i32 @__set_PRIMASK(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ w5100_readSUBR(int /*<<< orphan*/ *);
void w5100_getSubnetMask(uint8_t *addr) { w5100_readSUBR(addr); }


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

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

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

LLVM IR (-O2):
define void @w5100_getSubnetMask(i32* %0) {
%2 = tail call i32 @w5100_readSUBR(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void clean_remove_db(char *dbname) { unlink(dbname); }


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

x86 assembly (clang, -O2):
<clean_remove_db>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @clean_remove_db(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_UNBLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void clicon_signal_unblock(int sig) {
  sigset_t set;
  sigemptyset(&set);
  if (sig)
    sigaddset(&set, sig);
  else
    sigfillset(&set);
  sigprocmask(SIG_UNBLOCK, &set, NULL);
}


x86 assembly (clang, -O0):
<clicon_signal_unblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
cmpl   $0x0,-0x4(%rbp)
je     116f <clicon_signal_unblock+0x2f>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1060 <sigaddset@plt>
jmp    1178 <clicon_signal_unblock+0x38>
lea    -0x8(%rbp),%rdi
call   1050 <sigfillset@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clicon_signal_unblock>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
lea    0xc(%rsp),%rdi
call   1040 <sigemptyset@plt>
lea    0xc(%rsp),%rdi
test   %ebx,%ebx
je     1163 <clicon_signal_unblock+0x23>
mov    %ebx,%esi
call   1060 <sigaddset@plt>
jmp    1168 <clicon_signal_unblock+0x28>
call   1050 <sigfillset@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_UNBLOCK = global i32 0
define void @clicon_signal_unblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @sigemptyset(i32* %3)
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @sigaddset(i32* %3, i32 %8)
br label %12
10: ; preds = %1
%11 = call i32 @sigfillset(i32* %3)
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* @SIG_UNBLOCK
%14 = call i32 @sigprocmask(i32 %13, i32* %3, i32* null)
ret void
}

LLVM IR (-O2):
@SIG_UNBLOCK = global i32 0
define void @clicon_signal_unblock(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigemptyset(i32* %2)
%5 = icmp eq i32 %0, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @sigaddset(i32* %2, i32 %0)
br label %10
8: ; preds = %1
%9 = call i32 @sigfillset(i32* %2)
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* @SIG_UNBLOCK
%12 = call i32 @sigprocmask(i32 %11, i32* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ system(char *);
int main() {
  float a = 3.1415926535897932626;
  double b = 3.1415926535897932626;
  printf("folatÀàÐÍµÄÖµ£º%.15f\n", a);
  printf("doubleÀàÐÍµÄÖµ£º%.15lf\n", b);
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
movsd  0xed0(%rip),%xmm0
call   1040 <printf@plt>
lea    0xef4(%rip),%rdi
movsd  0xec4(%rip),%xmm0
call   1040 <printf@plt>
lea    0xf02(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"folat\C3\80\C3\A0\C3\90\C3\8D\C2\B5\C3\84\C3\96\C2\B5\C2\A3\C2\BA%.15f\0A\00"
@.str.1 = [34 x i8] c"double\C3\80\C3\A0\C3\90\C3\8D\C2\B5\C3\84\C3\96\C2\B5\C2\A3\C2\BA%.15lf\0A\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca double
store i32 0, i32* %1
store float 0x400921FB60000000, float* %2
store double 0x400921FB54442D18, double* %3
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %5)
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), double %7)
%9 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"folat\C3\80\C3\A0\C3\90\C3\8D\C2\B5\C3\84\C3\96\C2\B5\C2\A3\C2\BA%.15f\0A\00"
@.str.1 = [34 x i8] c"double\C3\80\C3\A0\C3\90\C3\8D\C2\B5\C3\84\C3\96\C2\B5\C2\A3\C2\BA%.15lf\0A\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double 0x400921FB60000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), double 0x400921FB54442D18)
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, float, char *, int, int);
void writeFloat(float point, char *name, int scale) {
  printf("%s = %f (%s * %d = %d)\n", name, point, name, scale,
         (int)(point * scale));
}


x86 assembly (clang, -O0):
<writeFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
movss  -0x4(%rbp),%xmm1
cvtsi2ssl -0x14(%rbp),%xmm2
mulss  %xmm2,%xmm1
cvttss2si %xmm1,%r8d
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeFloat>:
mov    %esi,%ecx
mov    %rdi,%rdx
cvtsi2ss %esi,%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%r8d
lea    0xed7(%rip),%rdi
mov    %rdx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"%s = %f (%s * %d = %d)\0A\00"
define void @writeFloat(float %0, i8* %1, i32 %2) {
%4 = alloca float
%5 = alloca i8*
%6 = alloca i32
store float %0, float* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load float, float* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load float, float* %4
%12 = load i32, i32* %6
%13 = sitofp i32 %12 to float
%14 = fmul float %11, %13
%15 = fptosi float %14 to i32
%16 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %7, float %8, i8* %9, i32 %10, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"%s = %f (%s * %d = %d)\0A\00"
define void @writeFloat(float %0, i8* %1, i32 %2) {
%4 = sitofp i32 %2 to float
%5 = fmul float %4, %0
%6 = fptosi float %5 to i32
%7 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1, float %0, i8* %1, i32 %2, i32 %6)
ret void
}
int new_world(void) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @new_world() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void printError(int errnum) {
  perror("\nError : ");
  fprintf(stderr, "\nError : %s\n", strerror(errnum));
}


x86 assembly (clang, -O0):
<printError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <strerror@plt>
mov    -0x8(%rbp),%edi
mov    %rax,%rdx
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printError>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xec4(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%ebp
mov    %ebx,%edi
call   1050 <strerror@plt>
lea    0xeb2(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"\0AError : \00"
@stderr = global i32 0
@.str.1 = [13 x i8] c"\0AError : %s\0A\00"
define void @printError(i32 %0) {
%2 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i8* @strerror(i32 %0)
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
void help(void) {
  char polecenie[10];
  strcpy(polecenie, "less ");
  strcat(polecenie, "help");
  system(polecenie);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xa(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1050 <strcat@plt>
lea    -0xa(%rbp),%rdi
call   1040 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"less \00"
@.str.1 = [5 x i8] c"help\00"
define void @help() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = call i32 @strcat(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%7 = call i32 @system(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"less \00"
@.str.1 = [5 x i8] c"help\00"
define void @help() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @strcat(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @system(i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ rdtsc();
time_t arch_current_time(void) { return rdtsc(); }


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

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

LLVM IR (-O0):
define i32 @arch_current_time() {
%1 = call i32 (...) @rdtsc()
ret i32 %1
}

LLVM IR (-O2):
define i32 @arch_current_time() {
%1 = tail call i32 (...) @rdtsc()
ret i32 %1
}