xunge/DecIR huggingface dataset:
void __stutter(void) {}


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

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

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

LLVM IR (-O2):
define void @__stutter() {
ret void
}
/* Variables and functions */
bool IsLineOver(char *buffer, int len) {
  return buffer[len - 1] == 0 || buffer[len - 1] == '\n';
}


x86 assembly (clang, -O0):
<IsLineOver>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1144 <IsLineOver+0x44>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsLineOver>:
movslq %esi,%rax
mov    -0x1(%rax,%rdi,1),%al
test   %al,%al
sete   %cl
cmp    $0xa,%al
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @IsLineOver(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = icmp eq i8 %6, 10
%9 = or i1 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int round(int);
int in2cm(int in) {
  if (in < 0)
    return in;
  return round(in * 2.54);
}


x86 assembly (clang, -O0):
<in2cm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1130 <in2cm+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <in2cm+0x3d>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <round@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in2cm>:
test   %edi,%edi
js     1129 <in2cm+0x19>
cvtsi2sd %edi,%xmm0
mulsd  0xee0(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <round@plt>
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @in2cm(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = fmul double %10, 2.540000e+00
%12 = fptosi double %11 to i32
%13 = call i32 @round(i32 %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %8, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @in2cm(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = sitofp i32 %0 to double
%5 = fmul double %4, 2.540000e+00
%6 = fptosi double %5 to i32
%7 = tail call i32 @round(i32 %6)
br label %8
8: ; preds = %1, %3
%9 = phi i32 [ %7, %3 ], [ %0, %1 ]
ret i32 %9
}
int increment(int a) { return a + 1; }


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

x86 assembly (clang, -O2):
<increment>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @increment(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @increment(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void glDeleteProgram(unsigned int program) {}


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

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

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

LLVM IR (-O2):
define void @glDeleteProgram(i32 %0) {
ret void
}
/* Type definitions */
struct metadata_response {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dealloc_metadata_response(struct metadata_response *);
int /*<<< orphan*/ dump_metadata_response(struct metadata_response *);
struct metadata_response *send_metadata_request(char const *);
void dump_metadata(const char *topics) {
  struct metadata_response *r;
  r = send_metadata_request(topics);
  dump_metadata_response(r);
  dealloc_metadata_response(r);
}


x86 assembly (clang, -O0):
<dump_metadata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <send_metadata_request@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <dump_metadata_response@plt>
mov    -0x10(%rbp),%rdi
call   1040 <dealloc_metadata_response@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_metadata>:
push   %rbx
call   1030 <send_metadata_request@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <dump_metadata_response@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <dealloc_metadata_response@plt>

LLVM IR (-O0):
%struct.metadata_response = type { i32 }
define void @dump_metadata(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.metadata_response*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.metadata_response* @send_metadata_request(i8* %4)
store %struct.metadata_response* %5, %struct.metadata_response** %3
%6 = load %struct.metadata_response*, %struct.metadata_response** %3
%7 = call i32 @dump_metadata_response(%struct.metadata_response* %6)
%8 = load %struct.metadata_response*, %struct.metadata_response** %3
%9 = call i32 @dealloc_metadata_response(%struct.metadata_response* %8)
ret void
}

LLVM IR (-O2):
%struct.metadata_response = type { i32 }
define void @dump_metadata(i8* %0) {
%2 = tail call %struct.metadata_response* @send_metadata_request(i8* %0)
%3 = tail call i32 @dump_metadata_response(%struct.metadata_response* %2)
%4 = tail call i32 @dealloc_metadata_response(%struct.metadata_response* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RVS_Ipoint(int);
int /*<<< orphan*/ spe_one(unsigned int);
void run_spe_one(unsigned count) {
  RVS_Ipoint(10);
  spe_one(count);
  RVS_Ipoint(11);
}


x86 assembly (clang, -O0):
<run_spe_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <RVS_Ipoint@plt>
mov    -0x4(%rbp),%edi
call   1030 <spe_one@plt>
mov    $0xb,%edi
call   1040 <RVS_Ipoint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_spe_one>:
push   %rbx
mov    %edi,%ebx
mov    $0xa,%edi
call   1040 <RVS_Ipoint@plt>
mov    %ebx,%edi
call   1030 <spe_one@plt>
mov    $0xb,%edi
pop    %rbx
jmp    1040 <RVS_Ipoint@plt>

LLVM IR (-O0):
define void @run_spe_one(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @RVS_Ipoint(i32 10)
%4 = load i32, i32* %2
%5 = call i32 @spe_one(i32 %4)
%6 = call i32 @RVS_Ipoint(i32 11)
ret void
}

LLVM IR (-O2):
define void @run_spe_one(i32 %0) {
%2 = tail call i32 @RVS_Ipoint(i32 10)
%3 = tail call i32 @spe_one(i32 %0)
%4 = tail call i32 @RVS_Ipoint(i32 11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand48(int);
void init_random(int myid) { srand48(myid * 45); }


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

x86 assembly (clang, -O2):
<init_random>:
lea    (%rdi,%rdi,8),%eax
lea    (%rax,%rax,4),%edi
jmp    1030 <srand48@plt>

LLVM IR (-O0):
define void @init_random(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 45
%5 = call i32 @srand48(i32 %4)
ret void
}

LLVM IR (-O2):
define void @init_random(i32 %0) {
%2 = mul nsw i32 %0, 45
%3 = tail call i32 @srand48(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FCEU_QSimpleCommand(int);
void FCEUI_VSUniToggleDIP(int w) { FCEU_QSimpleCommand(0x08 + w); }


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

x86 assembly (clang, -O2):
<FCEUI_VSUniToggleDIP>:
add    $0x8,%edi
jmp    1030 <FCEU_QSimpleCommand@plt>

LLVM IR (-O0):
define void @FCEUI_VSUniToggleDIP(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 8, %3
%5 = call i32 @FCEU_QSimpleCommand(i32 %4)
ret void
}

LLVM IR (-O2):
define void @FCEUI_VSUniToggleDIP(i32 %0) {
%2 = add nsw i32 %0, 8
%3 = tail call i32 @FCEU_QSimpleCommand(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ *ptls_encode_quicint(int /*<<< orphan*/ *,
                                        int /*<<< orphan*/);
uint8_t *quicly_encode_max_stream_data_frame(uint8_t *dst, uint64_t stream_id,
                                             uint64_t max_stream_data) {
  *dst++ = 17;
  dst = ptls_encode_quicint(dst, stream_id);
  dst = ptls_encode_quicint(dst, max_stream_data);
  return dst;
}


x86 assembly (clang, -O0):
<quicly_encode_max_stream_data_frame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
movl   $0x11,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ptls_encode_quicint@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <ptls_encode_quicint@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicly_encode_max_stream_data_frame>:
push   %rbx
mov    %edx,%ebx
movl   $0x11,(%rdi)
add    $0x4,%rdi
call   1030 <ptls_encode_quicint@plt>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <ptls_encode_quicint@plt>

LLVM IR (-O0):
define i32* @quicly_encode_max_stream_data_frame(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 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %4
store i32 17, i32* %7
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = call i32* @ptls_encode_quicint(i32* %9, i32 %10)
store i32* %11, i32** %4
%12 = load i32*, i32** %4
%13 = load i32, i32* %6
%14 = call i32* @ptls_encode_quicint(i32* %12, i32 %13)
store i32* %14, i32** %4
%15 = load i32*, i32** %4
ret i32* %15
}

LLVM IR (-O2):
define i32* @quicly_encode_max_stream_data_frame(i32* %0, i32 %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 17, i32* %0
%5 = tail call i32* @ptls_encode_quicint(i32* %4, i32 %1)
%6 = tail call i32* @ptls_encode_quicint(i32* %5, i32 %2)
ret i32* %6
}
/* Variables and functions */
scalar_t__ rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
unsigned int __VERIFIER_nondet_unsignedint() {
  srand(time(NULL));
  return (unsigned int)rand();
}


x86 assembly (clang, -O0):
<__VERIFIER_nondet_unsignedint>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__VERIFIER_nondet_unsignedint>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <rand@plt>

LLVM IR (-O0):
define i32 @__VERIFIER_nondet_unsignedint() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
%3 = call i64 (...) @rand()
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @__VERIFIER_nondet_unsignedint() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i64 (...) @rand()
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int reboot_go() {
  printf("Rebooting the system...\n");
  system("sudo shutdown -r 00");
  return 0;
}


x86 assembly (clang, -O0):
<reboot_go>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"Rebooting the system...\0A\00"
@.str.1 = [20 x i8] c"sudo shutdown -r 00\00"
define i32 @reboot_go() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"sudo shutdown -r 00\00"
@str = [24 x i8] c"Rebooting the system...\00"
define i32 @reboot_go() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ read(int /*<<< orphan*/, void *, size_t);
ssize_t dspd_read(int32_t fd, void *buf, size_t len) {
  ssize_t ret = read(fd, buf, len);
  if (ret < 0)
    ret = -errno;
  return ret;
}


x86 assembly (clang, -O0):
<dspd_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    114e <dspd_read+0x3e>
xor    %eax,%eax
mov    0x2e97(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dspd_read>:
push   %rax
call   1030 <read@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
test   %eax,%eax
cmovs  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @dspd_read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @read(i32 %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* @errno
%16 = sub nsw i32 0, %15
store i32 %16, i32* %7
br label %17
17: ; preds = %14, %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @dspd_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
%5 = icmp slt i32 %4, 0
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ g(int volatile *);
void f(void) {
  void *m;
  g((volatile *)m);
}


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

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

LLVM IR (-O0):
define void @f() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = bitcast i8* %2 to i32*
%4 = call i32 @g(i32* %3)
ret void
}

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 @g(i32* undef)
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t rdtsc() {
  uint64_t ret;
  asm volatile("rdtsc" : "=A"(ret));
  return ret;
}


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

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

LLVM IR (-O0):
define i8* @rdtsc() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @rdtsc() {
%1 = tail call i8* asm sideeffect "rdtsc", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
void ERR_remove_state(unsigned long pid) { (void)&(pid); }


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

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

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

LLVM IR (-O2):
define void @ERR_remove_state(i64 %0) {
ret void
}
/* Type definitions */
struct section {
  int dummy;
};

/* Variables and functions */
char **get_section_values_delimiter(char const *, struct section const *,
                                    char *);
char **get_section_values(const char *key, const struct section *cfg) {
  return get_section_values_delimiter(key, cfg, ",");
}


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

x86 assembly (clang, -O2):
<get_section_values>:
lea    0xee9(%rip),%rdx
jmp    1030 <get_section_values_delimiter@plt>

LLVM IR (-O0):
%struct.section = type { i32 }
@.str = [2 x i8] c",\00"
define i8** @get_section_values(i8* %0, %struct.section* %1) {
%3 = alloca i8*
%4 = alloca %struct.section*
store i8* %0, i8** %3
store %struct.section* %1, %struct.section** %4
%5 = load i8*, i8** %3
%6 = load %struct.section*, %struct.section** %4
%7 = call i8** @get_section_values_delimiter(i8* %5, %struct.section* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8** %7
}

LLVM IR (-O2):
%struct.section = type { i32 }
@.str = [2 x i8] c",\00"
define i8** @get_section_values(i8* %0, %struct.section* %1) {
%3 = tail call i8** @get_section_values_delimiter(i8* %0, %struct.section* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8** %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, int /*<<< orphan*/);
int pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                   void *(*)(void *), void *);
int /*<<< orphan*/ strerror(int);
void checked_thread_create(pthread_t *t, const pthread_attr_t *attr,
                           void *(*func)(void *), void *arg) {
  int err = pthread_create(t, attr, func, arg);
  if (err != 0) {
    errx(1, "Failed to create a thread: %s", strerror(err));
  }
}


x86 assembly (clang, -O0):
<checked_thread_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <pthread_create@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1185 <checked_thread_create+0x55>
mov    -0x24(%rbp),%edi
call   1050 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe80(%rip),%rsi
call   1030 <errx@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_thread_create>:
push   %rax
call   1040 <pthread_create@plt>
test   %eax,%eax
je     1155 <checked_thread_create+0x25>
mov    %eax,%edi
call   1050 <strerror@plt>
lea    0xeb8(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
pop    %rax
jmp    1030 <errx@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Failed to create a thread: %s\00"
define void @checked_thread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8* (i8*)*
%8 = alloca i8*
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8* (i8*)* %2, i8* (i8*)** %7
store i8* %3, i8** %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i8* (i8*)*, i8* (i8*)** %7
%13 = load i8*, i8** %8
%14 = call i32 @pthread_create(i32* %10, i32* %11, i8* (i8*)* %12, i8* %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %4
%18 = load i32, i32* %9
%19 = call i32 @strerror(i32 %18)
%20 = call i32 @errx(i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %17, %4
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Failed to create a thread: %s\00"
define void @checked_thread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3) {
%5 = tail call i32 @pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call i32 @strerror(i32 %5)
%9 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;
typedef scalar_t__ Colormap;

/* Variables and functions */
scalar_t__ None;
int /*<<< orphan*/ XInstallColormap(int /*<<< orphan*/ *, scalar_t__);
void InstallColormap(Display *display, Colormap colormap) {
  if (colormap != None)
    XInstallColormap(display, colormap);
}


x86 assembly (clang, -O0):
<InstallColormap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ebd(%rip),%rcx
cmp    (%rcx),%rax
je     1141 <InstallColormap+0x31>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <XInstallColormap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InstallColormap>:
mov    0x2ed1(%rip),%rax
cmp    %rsi,(%rax)
jne    111d <InstallColormap+0xd>
ret
jmp    1030 <XInstallColormap@plt>

LLVM IR (-O0):
@None = global i64 0
define void @InstallColormap(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* @None
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32*, i32** %3
%10 = load i64, i64* %4
%11 = call i32 @XInstallColormap(i32* %9, i64 %10)
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@None = global i64 0
define void @InstallColormap(i32* %0, i64 %1) {
%3 = load i64, i64* @None
%4 = icmp eq i64 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @XInstallColormap(i32* %0, i64 %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello Kitty!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello Kitty!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello Kitty!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
char *strchr(const char *str, int c) {
  char *sp = (char *)str;
  char ch = (char)(c & 0xff);
  while (*sp != '\0') {
    if (*sp == ch) {
      return (sp);
    }
    ++sp;
  }
  return (0);
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115f <strchr+0x5f>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x21(%rbp),%ecx
cmp    %ecx,%eax
jne    114e <strchr+0x4e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1167 <strchr+0x67>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111e <strchr+0x1e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
movsbl %sil,%edx
nopl   (%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i32, i32* %5
%10 = and i32 %9, 255
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
br label %12
12: ; preds = %26, %2
%13 = load i8*, i8** %6
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %29
17: ; preds = %12
%18 = load i8*, i8** %6
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = load i8, i8* %7
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %20, %22
br i1 %23, label %24, label %26
24: ; preds = %17
%25 = load i8*, i8** %6
store i8* %25, i8** %3
br label %30
26: ; preds = %17
%27 = load i8*, i8** %6
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %6
br label %12
29: ; preds = %12
store i8* null, i8** %3
br label %30
30: ; preds = %29, %24
%31 = load i8*, i8** %3
ret i8* %31
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %13
%9 = phi i8 [ %3, %5 ], [ %15, %13 ]
%10 = phi i8* [ %0, %5 ], [ %14, %13 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %7, %11
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %8
17: ; preds = %8, %13, %2
%18 = phi i8* [ null, %2 ], [ null, %13 ], [ %10, %8 ]
ret i8* %18
}
int test_imm_5Eint16_mem(short *val) {
  return ((*val) & (0x5E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Eint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x5e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Eint16_mem>:
testb  $0x5e,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Eint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 94
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_5Eint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 94
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct network_client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(struct network_client *);
void network_client_free(struct network_client *client) {
  assert(client != NULL);
  free(client);
}


x86 assembly (clang, -O0):
<network_client_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<network_client_free>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.network_client = type { i32 }
define void @network_client_free(%struct.network_client* %0) {
%2 = alloca %struct.network_client*
store %struct.network_client* %0, %struct.network_client** %2
%3 = load %struct.network_client*, %struct.network_client** %2
%4 = icmp ne %struct.network_client* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.network_client*, %struct.network_client** %2
%8 = call i32 @free(%struct.network_client* %7)
ret void
}

LLVM IR (-O2):
%struct.network_client = type { i32 }
define void @network_client_free(%struct.network_client* %0) {
%2 = icmp ne %struct.network_client* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @free(%struct.network_client* %0)
ret void
}
int test_imm_E5uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xE5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E5uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0xe5,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E5uint64_highword_reg>:
movabs $0xe500000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E5uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 229
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_E5uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 983547510784
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
void InitializeHuffmanTable(uint16_t *table, int maxlength) {
  memset(table, 0, sizeof(*table) * (1 << maxlength));
}


x86 assembly (clang, -O0):
<InitializeHuffmanTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitializeHuffmanTable>:
mov    %esi,%ecx
mov    $0x4,%edx
shl    %cl,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @InitializeHuffmanTable(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 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = mul i64 4, %8
%10 = trunc i64 %9 to i32
%11 = call i32 @memset(i32* %5, i32 0, i32 %10)
ret void
}

LLVM IR (-O2):
define void @InitializeHuffmanTable(i32* %0, i32 %1) {
%3 = shl i32 4, %1
%4 = tail call i32 @memset(i32* %0, i32 0, i32 %3)
ret void
}
void initconnect() {}


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

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

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

LLVM IR (-O2):
define void @initconnect() {
ret void
}
int isWhiteSpace(char c) { return c == ' ' || c == '\t' || c == '\n'; }


x86 assembly (clang, -O0):
<isWhiteSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <isWhiteSpace+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     113b <isWhiteSpace+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isWhiteSpace>:
mov    $0x1,%eax
cmp    $0x9,%dil
je     1111 <isWhiteSpace+0x11>
cmp    $0x20,%dil
jne    1112 <isWhiteSpace+0x12>
ret
xor    %eax,%eax
cmp    $0xa,%dil
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isWhiteSpace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ENOENT;
int /*<<< orphan*/ errno;
int _unlink(const uint8_t *name) {
  errno = ENOENT;
  return -1;
}


x86 assembly (clang, -O0):
<_unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_unlink>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @_unlink(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOENT
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOENT = global i32 0
@errno = global i32 0
define i32 @_unlink(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOENT
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ EVP_sha512();
int cryptoCalculateHash(unsigned char *, int const, unsigned char const *,
                        int const, int /*<<< orphan*/);
int cryptoCalculateSHA512(unsigned char *hash_buf, const int hash_len,
                          const unsigned char *in_buf, const int in_len) {
  return cryptoCalculateHash(hash_buf, hash_len, in_buf, in_len, EVP_sha512());
}


x86 assembly (clang, -O0):
<cryptoCalculateSHA512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <EVP_sha512@plt>
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%ecx
mov    %eax,%r8d
call   1040 <cryptoCalculateHash@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cryptoCalculateSHA512>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <EVP_sha512@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    %eax,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <cryptoCalculateHash@plt>

LLVM IR (-O0):
define i32 @cryptoCalculateSHA512(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 (...) @EVP_sha512()
%14 = call i32 @cryptoCalculateHash(i8* %9, i32 %10, i8* %11, i32 %12, i32 %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @cryptoCalculateSHA512(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 (...) @EVP_sha512()
%6 = tail call i32 @cryptoCalculateHash(i8* %0, i32 %1, i8* %2, i32 %3, i32 %5)
ret i32 %6
}
void reverse_impl(char str[], int i, int j) {
  if (i < j) {
    char tmp = str[i];
    str[i] = str[j];
    str[j] = tmp;
    reverse_impl(str, i + 1, j - 1);
  }
}


x86 assembly (clang, -O0):
<reverse_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1175 <reverse_impl+0x65>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
call   1030 <reverse_impl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_impl>:
cmp    %edx,%esi
jge    1131 <reverse_impl+0x31>
movslq %edx,%rax
movslq %esi,%rcx
add    $0xffffffffffffffff,%rax
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%esi
movzbl 0x1(%rdi,%rax,1),%edx
mov    %dl,(%rdi,%rcx,1)
mov    %sil,0x1(%rdi,%rax,1)
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     1110 <reverse_impl+0x10>
ret

LLVM IR (-O0):
define void @reverse_impl(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %36
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
store i8 %16, i8* %7
%17 = load i8*, i8** %4
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = load i8*, i8** %4
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 %21, i8* %25
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
store i8 %26, i8* %30
%31 = load i8*, i8** %4
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
%34 = load i32, i32* %6
%35 = sub nsw i32 %34, 1
br label %36
36: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @reverse_impl(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %15, %8 ]
%10 = phi i64 [ %6, %5 ], [ %16, %8 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %10
%14 = load i8, i8* %13
store i8 %14, i8* %11
store i8 %12, i8* %13
%15 = add nsw i64 %9, 1
%16 = add nsw i64 %10, -1
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ clearerr(int /*<<< orphan*/);
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void readRestOfLine() {
  int c;
  while ((c = fgetc(stdin)) != '\n' && c != EOF)
    ;
  clearerr(stdin);
}


x86 assembly (clang, -O0):
<readRestOfLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     115b <readRestOfLine+0x3b>
mov    -0x4(%rbp),%eax
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    116b <readRestOfLine+0x4b>
jmp    1170 <readRestOfLine+0x50>
jmp    1128 <readRestOfLine+0x8>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1040 <clearerr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readRestOfLine>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
mov    0x2eae(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%edi
call   1030 <fgetc@plt>
cmp    $0xa,%eax
je     1151 <readRestOfLine+0x31>
cmp    (%rbx),%eax
jne    1140 <readRestOfLine+0x20>
mov    (%r14),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <clearerr@plt>

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
define void @readRestOfLine() {
%1 = alloca i32
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* @stdin
%4 = call i32 @fgetc(i32 %3)
store i32 %4, i32* %1
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* %1
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br label %10
10: ; preds = %6, %2
%11 = phi i1 [ false, %2 ], [ %9, %6 ]
br i1 %11, label %12, label %13
12: ; preds = %10
br label %2
13: ; preds = %10
%14 = load i32, i32* @stdin
%15 = call i32 @clearerr(i32 %14)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
define void @readRestOfLine() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @stdin
%3 = tail call i32 @fgetc(i32 %2)
%4 = icmp ne i32 %3, 10
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %3, %5
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %1, label %8
8: ; preds = %1
%9 = load i32, i32* @stdin
%10 = tail call i32 @clearerr(i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void swap_opcode(void) {
  printf("#ifdef HAVE_GET_WORD_UNSWAPPED\n");
  printf("\topcode = ((opcode << 8) & 0xFF00) | ((opcode >> 8) & 0xFF);\n");
  printf("#endif\n");
}


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

x86 assembly (clang, -O2):
<swap_opcode>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"#ifdef HAVE_GET_WORD_UNSWAPPED\0A\00"
@.str.1 = [62 x i8] c"\09opcode = ((opcode << 8) & 0xFF00) | ((opcode >> 8) & 0xFF);\0A\00"
@.str.2 = [8 x i8] c"#endif\0A\00"
define void @swap_opcode() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"#ifdef HAVE_GET_WORD_UNSWAPPED\00"
@str.3 = [61 x i8] c"\09opcode = ((opcode << 8) & 0xFF00) | ((opcode >> 8) & 0xFF);\00"
@str.4 = [7 x i8] c"#endif\00"
define void @swap_opcode() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testerror(char *);
void t4() {
  testerror("error1");
  testerror("error2");
}


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

x86 assembly (clang, -O2):
<t4>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <testerror@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <testerror@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"error1\00"
@.str.1 = [7 x i8] c"error2\00"
define void @t4() {
%1 = call i32 @testerror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @testerror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"error1\00"
@.str.1 = [7 x i8] c"error2\00"
define void @t4() {
%1 = tail call i32 @testerror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @testerror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _getch();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void fun4() {
  system("cls");
  printf("function 4 \n");
  _getch();
}


x86 assembly (clang, -O0):
<fun4>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <system@plt>
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <_getch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun4>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <system@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <_getch@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [13 x i8] c"function 4 \0A\00"
define void @fun4() {
%1 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @_getch()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@str = [12 x i8] c"function 4 \00"
define void @fun4() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @_getch()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pop(char *);
int /*<<< orphan*/ push(char *);
void pip(char *string) {
  push(string);
  pop(string);
}


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

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

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

LLVM IR (-O2):
define void @pip(i8* %0) {
%2 = tail call i32 @push(i8* %0)
%3 = tail call i32 @pop(i8* %0)
ret void
}
void trap_except() {}


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

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

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

LLVM IR (-O2):
define void @trap_except() {
ret void
}
/* Variables and functions */
scalar_t__ floor(float);
int ifloorf(float a) { return (int)floor(a); }


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

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

LLVM IR (-O0):
define i32 @ifloorf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @floor(float %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ifloorf(float %0) {
%2 = tail call i64 @floor(float %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}