xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ timerSet(size_t, int /*<<< orphan*/, int);
void timerStart() {
  for (size_t i = 4; i--; timerSet(i, 0, 0x0003 | 0x0004 | 0x0080))
    ;
}


x86 assembly (clang, -O0):
<timerStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
je     1153 <timerStart+0x43>
jmp    113e <timerStart+0x2e>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x87,%edx
call   1030 <timerSet@plt>
jmp    1120 <timerStart+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerStart>:
push   %rax
mov    $0x3,%edi
xor    %esi,%esi
mov    $0x87,%edx
call   1030 <timerSet@plt>
mov    $0x2,%edi
xor    %esi,%esi
mov    $0x87,%edx
call   1030 <timerSet@plt>
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x87,%edx
call   1030 <timerSet@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x87,%edx
pop    %rax
jmp    1030 <timerSet@plt>

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

LLVM IR (-O2):
define void @timerStart() {
%1 = tail call i32 @timerSet(i64 3, i32 0, i32 135)
%2 = tail call i32 @timerSet(i64 2, i32 0, i32 135)
%3 = tail call i32 @timerSet(i64 1, i32 0, i32 135)
%4 = tail call i32 @timerSet(i64 0, i32 0, i32 135)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *base64_decode_up_to(char *, int /*<<< orphan*/, size_t *);
int /*<<< orphan*/ strings_length(char *);
char *base64_decode(char *string, size_t *decoded_size_ptr) {
  assert(string);
  return base64_decode_up_to(string, strings_length(string), decoded_size_ptr);
}


x86 assembly (clang, -O0):
<base64_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strings_length@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1040 <base64_decode_up_to@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decode>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1030 <strings_length@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <base64_decode_up_to@plt>

LLVM IR (-O0):
define i8* @base64_decode(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @strings_length(i8* %8)
%10 = load i64*, i64** %4
%11 = call i8* @base64_decode_up_to(i8* %7, i32 %9, i64* %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @base64_decode(i8* %0, i64* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @strings_length(i8* %0)
%5 = tail call i8* @base64_decode_up_to(i8* %0, i32 %4, i64* %1)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblock_is_silence() {
  printf("NOT IMPLEMENTED:"
         "pa_memblock_is_silence"
         "\n");
}


x86 assembly (clang, -O0):
<pa_memblock_is_silence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_memblock_is_silence\0A\00"
define i32 @pa_memblock_is_silence() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_memblock_is_silence\00"
define i32 @pa_memblock_is_silence() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int is_big_endian() { return 0; }


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

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

LLVM IR (-O0):
define i32 @is_big_endian() {
ret i32 0
}

LLVM IR (-O2):
define i32 @is_big_endian() {
ret i32 0
}
/* Forward declarations */
typedef struct ds TYPE_1__;

/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ st;
struct ds {
  int v;
  int u32;
};

/* Variables and functions */
int /*<<< orphan*/ hexlify(char *, TYPE_1__ *, int);
int /*<<< orphan*/ memset(TYPE_1__ *, int, int);
void ex_struct(void) {
  struct ds {
    uint8_t v;
    uint32_t u32;
  } st;
  memset(&st, 0xbd, sizeof(st));
  st.v = 1;
  st.u32 = 0x12345678;
  hexlify("C struct", &st, sizeof(st));
}


x86 assembly (clang, -O0):
<ex_struct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
mov    $0xbd,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
movl   $0x1,-0x8(%rbp)
movl   $0x12345678,-0x4(%rbp)
lea    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
mov    $0x8,%edx
call   1040 <hexlify@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex_struct>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xbd,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
movabs $0x1234567800000001,%rax
56 34 12
mov    %rax,0x8(%rsp)
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
mov    $0x8,%edx
call   1040 <hexlify@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.ds = type { i32, i32 }
%struct.ds.0 = type { i32, i32 }
@.str = [9 x i8] c"C struct\00"
define void @ex_struct() {
%1 = alloca %struct.ds
%2 = bitcast %struct.ds* %1 to %struct.ds.0*
%3 = call i32 @memset(%struct.ds.0* %2, i32 189, i32 8)
%4 = getelementptr inbounds %struct.ds, %struct.ds* %1, i32 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds %struct.ds, %struct.ds* %1, i32 0, i32 1
store i32 305419896, i32* %5
%6 = bitcast %struct.ds* %1 to %struct.ds.0*
%7 = call i32 @hexlify(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.ds.0* %6, i32 8)
ret void
}

LLVM IR (-O2):
%struct.ds = type { i32, i32 }
%struct.ds.0 = type { i32, i32 }
@.str = [9 x i8] c"C struct\00"
define void @ex_struct() {
%1 = alloca %struct.ds
%2 = bitcast %struct.ds* %1 to i8*
%3 = bitcast %struct.ds* %1 to %struct.ds.0*
%4 = call i32 @memset(%struct.ds.0* %3, i32 189, i32 8)
%5 = getelementptr inbounds %struct.ds, %struct.ds* %1, i64 0, i32 0
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.ds, %struct.ds* %1, i64 0, i32 1
store i32 305419896, i32* %6
%7 = call i32 @hexlify(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.ds.0* %3, i32 8)
ret void
}
int verify_user(user, pass)
char *user;
char *pass;
{ return (passwd_verify_user(user, pass)); }


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

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

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

LLVM IR (-O2):
define i32 @verify_user(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @passwd_verify_user to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int dlclose(void *);
int os_unload(void *handle) { return dlclose(handle); }


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

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

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

LLVM IR (-O2):
define i32 @os_unload(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret i32 %2
}
int max(int x, int y) { return (x >= y) ? x : y; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main() {
  printf("Helloworld");
  sleep(3);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"Helloworld\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 3)
ret i32 0
}
int strcmp(const char *s1, const char *s2) {
  int ret;
  while (!(ret = (unsigned char)*(s2++) - (unsigned char)*s1))
    if (!*(s1++))
      return 0;
  return ret;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113f <strcmp+0x3f>
jmp    1168 <strcmp+0x68>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    1163 <strcmp+0x63>
movl   $0x0,-0x4(%rbp)
jmp    116e <strcmp+0x6e>
jmp    110c <strcmp+0xc>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rcx,1),%eax
movzbl (%rdi,%rcx,1),%edx
sub    %edx,%eax
jne    1124 <strcmp+0x24>
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcmp+0x10>
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %13, %3 ]
%5 = phi i8* [ %1, %2 ], [ %12, %3 ]
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = sub nsw i32 %7, %9
%11 = icmp ne i32 %10, 0
%12 = getelementptr inbounds i8, i8* %5, i64 1
%13 = getelementptr inbounds i8, i8* %4, i64 1
%14 = icmp eq i8 %8, 0
%15 = select i1 %11, i1 true, i1 %14
br i1 %15, label %16, label %3
16: ; preds = %3
ret i32 %10
}
/* Type definitions */
struct vm_thread {
  int dummy;
};

/* Variables and functions */
char *vm_thread_get_name(struct vm_thread *thread) { return NULL; }


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

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

LLVM IR (-O0):
%struct.vm_thread = type { i32 }
define i8* @vm_thread_get_name(%struct.vm_thread* %0) {
%2 = alloca %struct.vm_thread*
store %struct.vm_thread* %0, %struct.vm_thread** %2
ret i8* null
}

LLVM IR (-O2):
%struct.vm_thread = type { i32 }
define noalias i8* @vm_thread_get_name(%struct.vm_thread* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int pr();
int main() {
  int x;
  x = pr();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pr()
ret i32 0
}
signed long int signedlongint_ignoring_unsignedlonglong(signed long int x,
                                                        unsigned long long y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlongint_ignoring_unsignedlonglong>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @signedlongint_ignoring_unsignedlonglong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlongint_ignoring_unsignedlonglong(i64 returned %0, i64 %1) {
ret i64 %0
}
int multi(int *a, int *b, int *c) { return (*c = *a * *b); }


x86 assembly (clang, -O0):
<multi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
imul   (%rcx),%eax
mov    -0x18(%rbp),%rcx
mov    %eax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<multi>:
mov    (%rsi),%eax
imul   (%rdi),%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define i32 @multi(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* %7
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = mul nsw i32 %8, %10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
ret i32 %11
}

LLVM IR (-O2):
define i32 @multi(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = mul nsw i32 %5, %4
store i32 %6, i32* %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
void __VERIFIER_assert(int phi, char *txt) {
  {
    if (!phi) {
    ERROR:
      __VERIFIER_error();
    } else {
    }
    return;
  }
}


x86 assembly (clang, -O0):
<__VERIFIER_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <__VERIFIER_assert+0x2a>
jmp    112e <__VERIFIER_assert+0x1e>
mov    $0x0,%al
call   1030 <__VERIFIER_error@plt>
jmp    113f <__VERIFIER_assert+0x2f>
jmp    113f <__VERIFIER_assert+0x2f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__VERIFIER_assert>:
test   %edi,%edi
je     1115 <__VERIFIER_assert+0x5>
ret
xor    %eax,%eax
jmp    1030 <__VERIFIER_error@plt>

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

LLVM IR (-O2):
define void @__VERIFIER_assert(i32 %0, i8* nocapture readnone %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @__VERIFIER_error()
br label %6
6: ; preds = %2, %4
ret void
}
/* Variables and functions */
char *getenv(char *);
char *get_env(char *key) { return getenv(key); }


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

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

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

LLVM IR (-O2):
define i8* @get_env(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printf("usage:\n");
  printf("httpdwrap [--putenv ENV=VALUE] [--listen IP] <path to HttpServer> "
         "[args to httpd]\n");
  printf("\nExamples: httpdwrap ./HttpServer\n");
  printf("          httpdwrap --putenv LD_LIBRARY_PATH=/usr/local/foo/lib "
         "./HttpServer\n");
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [83 x i8] c"httpdwrap [--putenv ENV=VALUE] [--listen IP] <path to HttpServer> [args to httpd]\0A\00"
@.str.2 = [35 x i8] c"\0AExamples: httpdwrap ./HttpServer\0A\00"
@.str.3 = [78 x i8] c" httpdwrap --putenv LD_LIBRARY_PATH=/usr/local/foo/lib ./HttpServer\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"usage:\00"
@str.4 = [82 x i8] c"httpdwrap [--putenv ENV=VALUE] [--listen IP] <path to HttpServer> [args to httpd]\00"
@str.5 = [34 x i8] c"\0AExamples: httpdwrap ./HttpServer\00"
@str.6 = [77 x i8] c" httpdwrap --putenv LD_LIBRARY_PATH=/usr/local/foo/lib ./HttpServer\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.6, i64 0, i64 0))
ret void
}
void c_pomp_taskwait_exit_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_taskwait_exit_(%struct.ompregdescr* nocapture %0) {
ret void
}
int foo() {
  int x;
  x = 4;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
int main(int argc, char **argv) {
  ;
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int fun596() { return 596; }


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

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

LLVM IR (-O0):
define i32 @fun596() {
ret i32 596
}

LLVM IR (-O2):
define i32 @fun596() {
ret i32 596
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printAuthors() {
  printf("Authors:\n");
  printf("Maciej Brzeczkowski <maciej.brzeczkowski@protonmail.com>\n");
  printf("Mariusz Lewczuk\n");
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Authors:\0A\00"
@.str.1 = [58 x i8] c"Maciej Brzeczkowski <maciej.brzeczkowski@protonmail.com>\0A\00"
@.str.2 = [17 x i8] c"Mariusz Lewczuk\0A\00"
define void @printAuthors() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"Authors:\00"
@str.3 = [57 x i8] c"Maciej Brzeczkowski <maciej.brzeczkowski@protonmail.com>\00"
@str.4 = [16 x i8] c"Mariusz Lewczuk\00"
define void @printAuthors() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ liba_func();
int main() {
  liba_func();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @liba_func()
ret i32 0
}
/* Variables and functions */
#define GLUT_KEY_DOWN 129
#define GLUT_KEY_UP 128
int /*<<< orphan*/ down();
int /*<<< orphan*/ up();
void special(int key, int x, int y) {
  switch (key) {
  case GLUT_KEY_UP:
    up();
    break;
  case GLUT_KEY_DOWN:
    down();
    break;
  }
}


x86 assembly (clang, -O0):
<special>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x80,%eax
je     115a <special+0x3a>
jmp    1147 <special+0x27>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
je     1166 <special+0x46>
jmp    116d <special+0x4d>
mov    $0x0,%al
call   1040 <up@plt>
jmp    116d <special+0x4d>
mov    $0x0,%al
call   1030 <down@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<special>:
cmp    $0x81,%edi
je     1137 <special+0x17>
cmp    $0x80,%edi
jne    113e <special+0x1e>
xor    %eax,%eax
jmp    1040 <up@plt>
xor    %eax,%eax
jmp    1030 <down@plt>
ret

LLVM IR (-O0):
define void @special(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
switch i32 %7, label %12 [
i32 128, label %8
i32 129, label %10
]
8: ; preds = %3
%9 = call i32 (...) @up()
br label %12
10: ; preds = %3
%11 = call i32 (...) @down()
br label %12
12: ; preds = %3, %10, %8
ret void
}

LLVM IR (-O2):
define void @special(i32 %0, i32 %1, i32 %2) {
switch i32 %0, label %8 [
i32 128, label %4
i32 129, label %6
]
4: ; preds = %3
%5 = tail call i32 (...) @up()
br label %8
6: ; preds = %3
%7 = tail call i32 (...) @down()
br label %8
8: ; preds = %3, %6, %4
ret void
}
int boundf(int depth, int selected) {
  return (depth + selected < 6) || (selected > 6);
}


x86 assembly (clang, -O0):
<boundf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    $0x1,%al
cmp    $0x6,%ecx
mov    %al,-0x9(%rbp)
jl     1128 <boundf+0x28>
cmpl   $0x6,-0x8(%rbp)
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<boundf>:
add    %esi,%edi
cmp    $0x6,%edi
setl   %al
cmp    $0x7,%esi
setge  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @boundf(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 = add nsw i32 %5, %6
%8 = icmp slt i32 %7, 6
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 6
br label %12
12: ; preds = %9, %2
%13 = phi i1 [ true, %2 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @boundf(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = icmp slt i32 %3, 6
%5 = icmp sgt i32 %1, 6
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int frobcmp(char const *, char const *);
int qsort_compatible_frobcmp(const void *a, const void *b) {
  return frobcmp(*((char const **)a), *((char const **)b));
}


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

x86 assembly (clang, -O2):
<qsort_compatible_frobcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <frobcmp@plt>

LLVM IR (-O0):
define i32 @qsort_compatible_frobcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @frobcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @qsort_compatible_frobcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @frobcmp(i8* %4, i8* %6)
ret i32 %7
}
/* Variables and functions */
int GetInput(char *);
int /*<<< orphan*/ puts(char *);
void CheckAge() {
  int age;
  age = GetInput("Give your age: ");
  if (age < 18)
    puts("Minor");
  else
    puts("Major");
}


x86 assembly (clang, -O0):
<CheckAge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <GetInput@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x12,-0x4(%rbp)
jge    1152 <CheckAge+0x32>
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
jmp    115e <CheckAge+0x3e>
lea    0xebd(%rip),%rdi
call   1040 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckAge>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <GetInput@plt>
cmp    $0x12,%eax
lea    0xed9(%rip),%rax
lea    0xed8(%rip),%rdi
cmovl  %rax,%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Give your age: \00"
@.str.1 = [6 x i8] c"Minor\00"
@.str.2 = [6 x i8] c"Major\00"
define void @CheckAge() {
%1 = alloca i32
%2 = call i32 @GetInput(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 18
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Give your age: \00"
@.str.1 = [6 x i8] c"Minor\00"
@.str.2 = [6 x i8] c"Major\00"
define void @CheckAge() {
%1 = tail call i32 @GetInput(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i32 %1, 18
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}
int HelpItem33(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @HelpItem33() {
ret i32 0
}

LLVM IR (-O2):
define i32 @HelpItem33() {
ret i32 0
}
/* Variables and functions */
int close(int);
int SCloseSocket(int sfd) {
  int result;
  result = close(sfd);
  return (result);
}


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

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

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

LLVM IR (-O2):
define i32 @SCloseSocket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ op_sub();
void vm_op_sub(void) {
  op_sub();
  return;
}


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

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

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

LLVM IR (-O2):
define void @vm_op_sub() {
%1 = tail call i32 (...) @op_sub()
ret void
}
/* Variables and functions */
int semaphore_operation(int, int);
int semaphore_wait(int semaphore_id) {
  return semaphore_operation(semaphore_id, -1);
}


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

x86 assembly (clang, -O2):
<semaphore_wait>:
mov    $0xffffffff,%esi
jmp    1030 <semaphore_operation@plt>

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

LLVM IR (-O2):
define i32 @semaphore_wait(i32 %0) {
%2 = tail call i32 @semaphore_operation(i32 %0, i32 -1)
ret i32 %2
}
void op0xED(void) {}


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

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

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

LLVM IR (-O2):
define void @op0xED() {
ret void
}
/* Variables and functions */
int strlen(char *);
char SetHiBitOfLastChar(char *s) {
  int n = strlen(s);
  char z = s[n - 1];
  s[n - 1] |= 0x80;
  return z;
}


x86 assembly (clang, -O0):
<SetHiBitOfLastChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
or     $0x80,%edx
mov    %dl,(%rax,%rcx,1)
movsbl -0xd(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetHiBitOfLastChar>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
mov    -0x1(%rcx,%rbx,1),%al
mov    %eax,%edx
or     $0x80,%dl
mov    %dl,-0x1(%rcx,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @SetHiBitOfLastChar(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = or i32 %19, 128
%21 = trunc i32 %20 to i8
store i8 %21, i8* %17
%22 = load i8, i8* %4
ret i8 %22
}

LLVM IR (-O2):
define signext i8 @SetHiBitOfLastChar(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = or i8 %6, -128
store i8 %7, i8* %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ lua_pushlstring(char *, int /*<<< orphan*/);
int /*<<< orphan*/ lua_pushnil();
int /*<<< orphan*/ strlen(char *);
void lua_pushstring(char *s) {
  if (s == 0)
    lua_pushnil();
  else
    lua_pushlstring(s, strlen(s));
}


x86 assembly (clang, -O0):
<lua_pushstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <lua_pushstring+0x23>
mov    $0x0,%al
call   1050 <lua_pushnil@plt>
jmp    116f <lua_pushstring+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <lua_pushlstring@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_pushstring>:
test   %rdi,%rdi
je     1149 <lua_pushstring+0x19>
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <lua_pushlstring@plt>
xor    %eax,%eax
jmp    1050 <lua_pushnil@plt>

LLVM IR (-O0):
define void @lua_pushstring(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @lua_pushnil()
br label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8*, i8** %2
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @lua_pushlstring(i8* %8, i32 %10)
br label %12
12: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @lua_pushstring(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @lua_pushnil()
br label %8
5: ; preds = %1
%6 = tail call i32 @strlen(i8* %0)
%7 = tail call i32 @lua_pushlstring(i8* %0, i32 %6)
br label %8
8: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
void pointer(void) {
  int x = 10;
  int *pi = &x;
  int **ppi = &pi;
  *pi = *pi + 10;
  printf("%d  %d\n", x, **ppi);
  int a[3] = {1, 2, 3};
  int *pa = a;
  printf("%d\n", *(pa + 1));
}


x86 assembly (clang, -O0):
<pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0xa,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xa,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edx
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xea9(%rip),%rax
mov    %rax,-0x24(%rbp)
mov    0xea7(%rip),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x24(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointer>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x14,%esi
mov    $0x14,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%d %d\0A\00"
@__const.pointer.a = [3 x i32] [i32 1, i32 2, i32 3]
@.str.1 = [4 x i8] c"%d\0A\00"
define void @pointer() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
%4 = alloca [3 x i32]
%5 = alloca i32*
store i32 10, i32* %1
store i32* %1, i32** %2
store i32** %2, i32*** %3
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 10
%9 = load i32*, i32** %2
store i32 %8, i32* %9
%10 = load i32, i32* %1
%11 = load i32**, i32*** %3
%12 = load i32*, i32** %11
%13 = load i32, i32* %12
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %13)
%15 = bitcast [3 x i32]* %4 to i8*
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
store i32* %16, i32** %5
%17 = load i32*, i32** %5
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define void @pointer() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 20, i32 20)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret void
}
/* Type definitions */
struct t_relay_weechat_msg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ relay_weechat_msg_add_bytes(struct t_relay_weechat_msg *,
                                               char *, int);
void relay_weechat_msg_add_char(struct t_relay_weechat_msg *msg, char c) {
  relay_weechat_msg_add_bytes(msg, &c, 1);
}


x86 assembly (clang, -O0):
<relay_weechat_msg_add_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <relay_weechat_msg_add_bytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<relay_weechat_msg_add_char>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <relay_weechat_msg_add_bytes@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.t_relay_weechat_msg = type { i32 }
define void @relay_weechat_msg_add_char(%struct.t_relay_weechat_msg* %0, i8 signext %1) {
%3 = alloca %struct.t_relay_weechat_msg*
%4 = alloca i8
store %struct.t_relay_weechat_msg* %0, %struct.t_relay_weechat_msg** %3
store i8 %1, i8* %4
%5 = load %struct.t_relay_weechat_msg*, %struct.t_relay_weechat_msg** %3
%6 = call i32 @relay_weechat_msg_add_bytes(%struct.t_relay_weechat_msg* %5, i8* %4, i32 1)
ret void
}

LLVM IR (-O2):
%struct.t_relay_weechat_msg = type { i32 }
define void @relay_weechat_msg_add_char(%struct.t_relay_weechat_msg* %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @relay_weechat_msg_add_bytes(%struct.t_relay_weechat_msg* %0, i8* %3, i32 1)
ret void
}
void halt(void) { __asm__ volatile("hlt"); }


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

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

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

LLVM IR (-O2):
define void @halt() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_nsis_comment_entities();
int /*<<< orphan*/ test_nsis_comments();
int /*<<< orphan*/ test_nsis_strings();
void all_nsis_tests() {
  test_nsis_comments();
  test_nsis_strings();
  test_nsis_comment_entities();
}


x86 assembly (clang, -O0):
<all_nsis_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_nsis_comments@plt>
mov    $0x0,%al
call   1050 <test_nsis_strings@plt>
mov    $0x0,%al
call   1040 <test_nsis_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_nsis_tests>:
push   %rax
xor    %eax,%eax
call   1030 <test_nsis_comments@plt>
xor    %eax,%eax
call   1050 <test_nsis_strings@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_nsis_comment_entities@plt>

LLVM IR (-O0):
define void @all_nsis_tests() {
%1 = call i32 (...) @test_nsis_comments()
%2 = call i32 (...) @test_nsis_strings()
%3 = call i32 (...) @test_nsis_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_nsis_tests() {
%1 = tail call i32 (...) @test_nsis_comments()
%2 = tail call i32 (...) @test_nsis_strings()
%3 = tail call i32 (...) @test_nsis_comment_entities()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XSetFillRule() {
  printf("XSetFillRule called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"XSetFillRule called\00"
define i32 @XSetFillRule() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc1(void) {
  printf("Executing exitfunc1.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Executing exitfunc1.\0A\00"
define void @exitfunc1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc1.\00"
define void @exitfunc1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
double SHtoMRto(double SH) {
  double MR = SH / 1 - SH;
  return MR;
}


x86 assembly (clang, -O0):
<SHtoMRto>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHtoMRto>:
subsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @SHtoMRto(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 1.000000e+00
%6 = load double, double* %2
%7 = fsub double %5, %6
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @SHtoMRto(double %0) {
%2 = fsub double %0, %0
ret double %2
}
char *genwb(char *wb) {
  wb[0] = 'w' - 18;
  wb[1] = 'b' - 13;
  wb[2] = 132;
  wb[0] += 18;
  wb[1] += 13;
  wb[2] = '\0';
}


x86 assembly (clang, -O0):
<genwb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x65,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x55,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x84,0x2(%rax)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x12,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%ecx
add    $0xd,%ecx
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<genwb>:
movw   $0x6277,(%rdi)
movb   $0x0,0x2(%rdi)
ret

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

LLVM IR (-O2):
define noalias i8* @genwb(i8* nocapture writeonly %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 119, i8* %0
store i8 98, i8* %2
store i8 0, i8* %3
ret i8* undef
}