xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void kiel_uzi(short exitcode) {
  fprintf(stderr, "shorturl v0.8\n"
                  "Usage: shorturl [-s <service's name>] [-u <long url>] \n"
                  " -s - specify the shortening service\n"
                  " -u - long url\n"
                  "\nSupported services: clck and tinyurl.\n"
                  "\nExample: shorturl -s clck.ru -u google.net\n");
}


x86 assembly (clang, -O0):
<kiel_uzi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kiel_uzi>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [205 x i8] c"shorturl v0.8\0AUsage: shorturl [-s <service's name>] [-u <long url>] \0A -s - specify the shortening service\0A -u - long url\0A\0ASupported services: clck and tinyurl.\0A\0AExample: shorturl -s clck.ru -u google.net\0A\00"
define void @kiel_uzi(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([205 x i8], [205 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [205 x i8] c"shorturl v0.8\0AUsage: shorturl [-s <service's name>] [-u <long url>] \0A -s - specify the shortening service\0A -u - long url\0A\0ASupported services: clck and tinyurl.\0A\0AExample: shorturl -s clck.ru -u google.net\0A\00"
define void @kiel_uzi(i16 signext %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([205 x i8], [205 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SOCKET_Init();
void BSED_Init(void) { SOCKET_Init(); }


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

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

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

LLVM IR (-O2):
define void @BSED_Init() {
%1 = tail call i32 (...) @SOCKET_Init()
ret void
}
void g18(void) {
  extern int g19;
  static int *p[] = {&g19};
}


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

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

LLVM IR (-O0):
@g18.p = internal global [1 x i32*] [i32* @g19]
@g19 = external global i32
define void @g18() {
ret void
}

LLVM IR (-O2):
define void @g18() {
ret void
}
void mtk_drm_debugfs_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @mtk_drm_debugfs_deinit() {
ret void
}
void _EVT_pumpMessages(void) {}


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

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

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

LLVM IR (-O2):
define void @_EVT_pumpMessages() {
ret void
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
size_t ece_aes128gcm_max_decrypted_length(uint32_t rs, size_t ciphertextLen) {
  size_t numRecords = (ciphertextLen / rs) + 1;
  return ciphertextLen - (16 * numRecords);
}


x86 assembly (clang, -O0):
<ece_aes128gcm_max_decrypted_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x8(%rbp)
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x4,%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ece_aes128gcm_max_decrypted_length>:
mov    %rsi,%rax
or     %rdi,%rax
shr    $0x20,%rax
je     1116 <ece_aes128gcm_max_decrypted_length+0x16>
mov    %rsi,%rax
xor    %edx,%edx
div    %rdi
jmp    111c <ece_aes128gcm_max_decrypted_length+0x1c>
mov    %esi,%eax
xor    %edx,%edx
div    %edi
shl    $0x4,%rax
sub    %rax,%rsi
add    $0xfffffffffffffff0,%rsi
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @ece_aes128gcm_max_decrypted_length(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = udiv i64 %6, %7
%9 = add i64 %8, 1
store i64 %9, i64* %5
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = mul i64 16, %11
%13 = sub i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @ece_aes128gcm_max_decrypted_length(i64 %0, i64 %1) {
%3 = udiv i64 %1, %0
%4 = mul i64 %3, -16
%5 = add i64 %1, -16
%6 = add i64 %5, %4
ret i64 %6
}
/* Variables and functions */
float sin(float);
float sinf(float angle) { return sin(angle); }


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

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

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

LLVM IR (-O2):
define float @sinf(float %0) {
%2 = tail call float @sin(float %0)
ret float %2
}
/* Variables and functions */
char tolower(char);
void strtolower(char *ptr) {
  while (*ptr != '\0') {
    *ptr = tolower(*ptr);
    ptr++;
  }
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <strtolower+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strtolower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <strtolower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strtolower+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @strtolower(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call signext i8 @tolower(i8 signext %10)
%12 = load i8*, i8** %2
store i8 %11, i8* %12
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @strtolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(char *, int, char *);
__attribute__((no_sanitize_undefined)) void baz(char *x, int y, char *z) {
  bar(x, y, z);
}


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

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

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

LLVM IR (-O2):
define void @baz(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @bar(i8* %0, i32 %1, i8* %2)
ret void
}
/* Variables and functions */
void setup_once(void) {}


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

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

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

LLVM IR (-O2):
define void @setup_once() {
ret void
}
void __blast_assert() {
ERROR:
  goto ERROR;
}


x86 assembly (clang, -O0):
<__blast_assert>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <__blast_assert+0x9>
jmp    1109 <__blast_assert+0x9>

x86 assembly (clang, -O2):
<__blast_assert>:
jmp    1100 <__blast_assert>

LLVM IR (-O0):
define void @__blast_assert() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @__blast_assert() {
br label %1
1: ; preds = %1, %0
br label %1
}
short short_fetch_sub_consume(short *ptr, int value) {
  return __atomic_fetch_sub(ptr, value, 1);
}


x86 assembly (clang, -O0):
<short_fetch_sub_consume>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
neg    %ax
lock xadd %ax,(%rcx)
mov    %ax,-0x10(%rbp)
movswl -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<short_fetch_sub_consume>:
mov    %esi,%eax
neg    %eax
lock xadd %ax,(%rdi)
ret

LLVM IR (-O0):
define signext i16 @short_fetch_sub_consume(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
%5 = alloca i16
%6 = alloca i16
store i16* %0, i16** %3
store i32 %1, i32* %4
%7 = load i16*, i16** %3
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i16
store i16 %9, i16* %5
%10 = load i16, i16* %5
%11 = atomicrmw sub i16* %7, i16 %10 acquire
store i16 %11, i16* %6
%12 = load i16, i16* %6
ret i16 %12
}

LLVM IR (-O2):
define signext i16 @short_fetch_sub_consume(i16* nocapture %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = atomicrmw sub i16* %0, i16 %3 acquire
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ fputc(float, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void dispAtEofEG() { fputc('\f', stdout); }


x86 assembly (clang, -O0):
<dispAtEofEG>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
movss  0xedb(%rip),%xmm0
call   1030 <fputc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispAtEofEG>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
movss  0xedf(%rip),%xmm0
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @dispAtEofEG() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputc(float 1.200000e+01, i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @dispAtEofEG() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputc(float 1.200000e+01, i32 %1)
ret void
}
void UARTRxErrorClear(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) = 0;
}


x86 assembly (clang, -O0):
<UARTRxErrorClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTRxErrorClear>:
movq   $0x0,0x4(%rdi)
ret

LLVM IR (-O0):
define void @UARTRxErrorClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 4
%5 = inttoptr i64 %4 to i64*
store volatile i64 0, i64* %5
ret void
}

LLVM IR (-O2):
define void @UARTRxErrorClear(i64 %0) {
%2 = add i64 %0, 4
%3 = inttoptr i64 %2 to i64*
store volatile i64 0, i64* %3
ret void
}
void kthread_bind(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<kthread_bind>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kthread_bind>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.kthread_bind = [13 x i8] c"kthread_bind\00"
define void @kthread_bind() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.kthread_bind, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.kthread_bind = [13 x i8] c"kthread_bind\00"
define void @kthread_bind() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.kthread_bind, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mystrcat(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void test1() {
  char s[30];
  strcpy(s, "CS240 ");
  mystrcat(s, "is a great class");
  printf("%s\n", s);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1050 <mystrcat@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdi
call   1050 <mystrcat@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"CS240 \00"
@.str.1 = [17 x i8] c"is a great class\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @test1() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%5 = call i32 @mystrcat(i8* %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"CS240 \00"
@.str.1 = [17 x i8] c"is a great class\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @test1() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @mystrcat(i8* %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int null_reconstruct(char **available_fragments, int num_fragments,
                     uint64_t fragment_len, int destination_idx,
                     char *out_fragment) {
  return 0;
}


x86 assembly (clang, -O0):
<null_reconstruct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @null_reconstruct(i8** %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i8** %0, i8*** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @null_reconstruct(i8** nocapture readnone %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long *copy_long(long);
int /*<<< orphan*/ free(long *);
void copy_long_test(void) {
  long *l_ptr = copy_long(9876543210L);
  assert(*l_ptr == 9876543210L);
  free(l_ptr);
}


x86 assembly (clang, -O0):
<copy_long_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movabs $0x24cb016ea,%rdi
call   1040 <copy_long@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movabs $0x24cb016ea,%rcx
cmp    %rcx,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_long_test>:
push   %r14
push   %rbx
push   %rax
movabs $0x24cb016ea,%r14
mov    %r14,%rdi
call   1040 <copy_long@plt>
mov    %rax,%rbx
xor    %edi,%edi
cmp    %r14,(%rax)
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @copy_long_test() {
%1 = alloca i64*
%2 = call i64* @copy_long(i64 9876543210)
store i64* %2, i64** %1
%3 = load i64*, i64** %1
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 9876543210
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i64*, i64** %1
%9 = call i32 @free(i64* %8)
ret void
}

LLVM IR (-O2):
define void @copy_long_test() {
%1 = tail call i64* @copy_long(i64 9876543210)
%2 = load i64, i64* %1
%3 = icmp eq i64 %2, 9876543210
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @free(i64* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
unsigned int vsprintf(char *, char const *, int /*<<< orphan*/);
void vprintf(const char *fmt, va_list args) {
  unsigned int i;
  char printbuffer[384];
  i = vsprintf(printbuffer, fmt, args);
  puts(printbuffer);
}


x86 assembly (clang, -O0):
<vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x190(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <vsprintf@plt>
mov    %eax,-0x10(%rbp)
lea    -0x190(%rbp),%rdi
call   1030 <puts@plt>
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprintf>:
push   %rbx
sub    $0x180,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <vsprintf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x180,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @vprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca [384 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [384 x i8], [384 x i8]* %6, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @vsprintf(i8* %7, i8* %8, i32 %9)
store i32 %10, i32* %5
%11 = getelementptr inbounds [384 x i8], [384 x i8]* %6, i64 0, i64 0
%12 = call i32 @puts(i8* %11)
ret void
}

LLVM IR (-O2):
define void @vprintf(i8* nocapture %0, i32 %1) {
%3 = alloca [384 x i8]
%4 = getelementptr inbounds [384 x i8], [384 x i8]* %3, i64 0, i64 0
%5 = call i32 @vsprintf(i8* %4, i8* %0, i32 %1)
%6 = call i32 @puts(i8* %4)
ret void
}
unsigned long hash_round(unsigned long size) {
  unsigned long i;
  if (size >= 1)
    size += size - 1;
  for (i = 1; i && i < size; i <<= 1)
    ;
  return i;
}


x86 assembly (clang, -O0):
<hash_round>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x1,-0x8(%rbp)
jb     1123 <hash_round+0x23>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1149 <hash_round+0x49>
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
setb   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1159 <hash_round+0x59>
jmp    116f <hash_round+0x6f>
jmp    115e <hash_round+0x5e>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <hash_round+0x2b>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_round>:
test   %rdi,%rdi
lea    -0x1(%rdi,%rdi,1),%rcx
cmove  %rdi,%rcx
mov    $0x1,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdx,%rax
test   %rdx,%rdx
je     1131 <hash_round+0x31>
lea    (%rax,%rax,1),%rdx
cmp    %rcx,%rax
jb     1120 <hash_round+0x20>
ret

LLVM IR (-O0):
define i64 @hash_round(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp uge i64 %4, 1
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i64, i64* %2
%8 = sub i64 %7, 1
%9 = load i64, i64* %2
%10 = add i64 %9, %8
store i64 %10, i64* %2
br label %11
11: ; preds = %6, %1
store i64 1, i64* %3
br label %12
12: ; preds = %22, %11
%13 = load i64, i64* %3
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i64, i64* %3
%17 = load i64, i64* %2
%18 = icmp ult i64 %16, %17
br label %19
19: ; preds = %15, %12
%20 = phi i1 [ false, %12 ], [ %18, %15 ]
br i1 %20, label %21, label %25
21: ; preds = %19
br label %22
22: ; preds = %21
%23 = load i64, i64* %3
%24 = shl i64 %23, 1
store i64 %24, i64* %3
br label %12
25: ; preds = %19
%26 = load i64, i64* %3
ret i64 %26
}

LLVM IR (-O2):
define i64 @hash_round(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = shl i64 %0, 1
%4 = add i64 %3, -1
%5 = select i1 %2, i64 0, i64 %4
br label %6
6: ; preds = %6, %1
%7 = phi i64 [ 1, %1 ], [ %11, %6 ]
%8 = icmp ne i64 %7, 0
%9 = icmp ult i64 %7, %5
%10 = and i1 %8, %9
%11 = shl i64 %7, 1
br i1 %10, label %6, label %12
12: ; preds = %6
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ add_positional_variation_from_line(char *);
char *read_line(int /*<<< orphan*/ *);
void add_positional_variations_from_file(FILE *fpin) {
  char *line;
  while ((line = read_line(fpin)) != NULL) {
    add_positional_variation_from_line(line);
  }
}


x86 assembly (clang, -O0):
<add_positional_variations_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <read_line@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1151 <add_positional_variations_from_file+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <add_positional_variation_from_line@plt>
jmp    112c <add_positional_variations_from_file+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_positional_variations_from_file>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1040 <read_line@plt>
test   %rax,%rax
je     1147 <add_positional_variations_from_file+0x27>
mov    %rax,%rdi
call   1030 <add_positional_variation_from_line@plt>
mov    %rbx,%rdi
jmp    1130 <add_positional_variations_from_file+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @add_positional_variations_from_file(i32* %0) {
%2 = tail call i8* @read_line(i32* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @add_positional_variation_from_line(i8* %5)
%7 = tail call i8* @read_line(i32* %0)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ POLICYINFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ POLICYINFO_it;
void POLICYINFO_free(POLICYINFO *a) {
  ASN1_item_free((ASN1_VALUE *)a, &POLICYINFO_it);
}


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

x86 assembly (clang, -O2):
<POLICYINFO_free>:
mov    0x2ed1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@POLICYINFO_it = global i32 0
define void @POLICYINFO_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @POLICYINFO_it)
ret void
}
/* Variables and functions */
int func8();
int func9() { return func8() + 1; }


x86 assembly (clang, -O0):
<func9>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <func8@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func9>:
push   %rax
xor    %eax,%eax
call   1030 <func8@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @func9() {
%1 = call i32 (...) @func8()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @func9() {
%1 = tail call i32 (...) @func8()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
void *dlmemalign(size_t, size_t);
void *hs_memalign(size_t boundary, size_t size) {
  void *mem = dlmemalign(boundary, size);
  return mem;
}


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

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

LLVM IR (-O0):
define i8* @hs_memalign(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @dlmemalign(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define i8* @hs_memalign(i64 %0, i64 %1) {
%3 = tail call i8* @dlmemalign(i64 %0, i64 %1)
ret i8* %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void spi_set_phrase(uint8_t phrase) {
  uint32_t reg = *(volatile uint32_t *)(0x01E12000 + 0x50);
  if (phrase)
    reg |= 1 << 16;
  else
    reg &= ~(1 << 16);
  *(volatile uint32_t *)(0x01E12000 + 0x50) = reg;
  return;
}


x86 assembly (clang, -O0):
<spi_set_phrase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1e12050,%eax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112d <spi_set_phrase+0x2d>
mov    -0xc(%rbp),%eax
or     $0x10000,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <spi_set_phrase+0x38>
mov    -0xc(%rbp),%eax
and    $0xfffeffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1e12050,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_set_phrase>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    $0xfffeffff,%ecx
and    0x1e12050,%ecx
shl    $0x10,%eax
or     %ecx,%eax
mov    %eax,0x1e12050
ret

LLVM IR (-O0):
define void @spi_set_phrase(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load volatile i32, i32* inttoptr (i64 31531088 to i32*)
store i32 %4, i32* %3
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = or i32 %8, 65536
store i32 %9, i32* %3
br label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = and i32 %11, -65537
store i32 %12, i32* %3
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %3
store volatile i32 %14, i32* inttoptr (i64 31531088 to i32*)
ret void
}

LLVM IR (-O2):
define void @spi_set_phrase(i64 %0) {
%2 = load volatile i32, i32* inttoptr (i64 31531088 to i32*)
%3 = icmp eq i64 %0, 0
%4 = and i32 %2, -65537
%5 = select i1 %3, i32 0, i32 65536
%6 = or i32 %4, %5
store volatile i32 %6, i32* inttoptr (i64 31531088 to i32*)
ret void
}
/* Type definitions */
struct char_queue {
  int dummy;
};

/* Variables and functions */
size_t char_queue_capacity(struct char_queue *);
size_t char_queue_size(struct char_queue *);
size_t char_queue_free(struct char_queue *queue) {
  return char_queue_capacity(queue) - char_queue_size(queue);
}


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

x86 assembly (clang, -O2):
<char_queue_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <char_queue_capacity@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <char_queue_size@plt>
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.char_queue = type { i32 }
define i64 @char_queue_free(%struct.char_queue* %0) {
%2 = alloca %struct.char_queue*
store %struct.char_queue* %0, %struct.char_queue** %2
%3 = load %struct.char_queue*, %struct.char_queue** %2
%4 = call i64 @char_queue_capacity(%struct.char_queue* %3)
%5 = load %struct.char_queue*, %struct.char_queue** %2
%6 = call i64 @char_queue_size(%struct.char_queue* %5)
%7 = sub i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.char_queue = type { i32 }
define i64 @char_queue_free(%struct.char_queue* %0) {
%2 = tail call i64 @char_queue_capacity(%struct.char_queue* %0)
%3 = tail call i64 @char_queue_size(%struct.char_queue* %0)
%4 = sub i64 %2, %3
ret i64 %4
}
void foo056(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo056(i32 %0) {
ret void
}
unsigned long cfs_time_sub(unsigned long t1, unsigned long t2) {
  return (unsigned long)(t1 - t2);
}


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

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

LLVM IR (-O0):
define i64 @cfs_time_sub(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
%6 = load i64, i64* %4
%7 = sub i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @cfs_time_sub(i64 %0, i64 %1) {
%3 = sub i64 %0, %1
ret i64 %3
}
int unix_fcntl_o_symlink() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @unix_fcntl_o_symlink() {
ret i32 -1
}
long ack(long m, long n) {
  if (m == 0)
    return n + 1;
  if (n == 0)
    return ack(m - 1, 1);
  return ack(m - 1, ack(m, n - 1));
}


x86 assembly (clang, -O0):
<ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113c <ack+0x2c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    118f <ack+0x7f>
cmpq   $0x0,-0x18(%rbp)
jne    1162 <ack+0x52>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
mov    $0x1,%esi
call   1030 <ack@plt>
mov    %rax,-0x8(%rbp)
jmp    118f <ack+0x7f>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
sub    $0x1,%rsi
call   1030 <ack@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
call   1030 <ack@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ack>:
push   %rbx
mov    %rsi,%rax
test   %rdi,%rdi
je     1145 <ack+0x35>
mov    %rdi,%rbx
jmp    112b <ack+0x1b>
xchg   %ax,%ax
mov    $0x1,%eax
add    $0xffffffffffffffff,%rbx
je     1145 <ack+0x35>
test   %rax,%rax
je     1120 <ack+0x10>
add    $0xffffffffffffffff,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <ack@plt>
add    $0xffffffffffffffff,%rbx
jne    112b <ack+0x1b>
add    $0x1,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @ack(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i64, i64* %5
%10 = add nsw i64 %9, 1
store i64 %10, i64* %3
br label %26
11: ; preds = %2
%12 = load i64, i64* %5
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i64, i64* %4
%16 = sub nsw i64 %15, 1
%17 = call i64 @ack(i64 %16, i64 1)
store i64 %17, i64* %3
br label %26
18: ; preds = %11
%19 = load i64, i64* %4
%20 = sub nsw i64 %19, 1
%21 = load i64, i64* %4
%22 = load i64, i64* %5
%23 = sub nsw i64 %22, 1
%24 = call i64 @ack(i64 %21, i64 %23)
%25 = call i64 @ack(i64 %20, i64 %24)
store i64 %25, i64* %3
br label %26
26: ; preds = %18, %14, %8
%27 = load i64, i64* %3
ret i64 %27
}

LLVM IR (-O2):
define i64 @ack(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i64 [ %1, %2 ], [ %12, %11 ]
%6 = add nsw i64 %5, 1
ret i64 %6
7: ; preds = %2, %11
%8 = phi i64 [ %12, %11 ], [ %1, %2 ]
%9 = phi i64 [ %13, %11 ], [ %0, %2 ]
%10 = icmp eq i64 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i64 [ %17, %15 ], [ 1, %7 ]
%13 = add nsw i64 %9, -1
%14 = icmp eq i64 %13, 0
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add nsw i64 %8, -1
%17 = tail call i64 @ack(i64 %9, i64 %16)
br label %11
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  int z = __VERIFIER_nondet_int();
  while (x < y) {
    x++;
    y = z;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <main+0x4d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void tt(void) {
  int i;
  float temp = 0.0;
  for (i = 0; i < 10000; i++)
    temp += 2.0;
}


x86 assembly (clang, -O0):
<tt>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    114c <tt+0x4c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1113 <tt+0x13>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @tt() {
%1 = alloca i32
%2 = alloca float
store float 0.000000e+00, float* %2
store i32 0, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 10000
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fadd double %8, 2.000000e+00
%10 = fptrunc double %9 to float
store float %10, float* %2
br label %11
11: ; preds = %6
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @tt() {
ret void
}
long long pqcpucycles_impl(void) {
  unsigned long long result;
  asm volatile(".byte 15;.byte 49;shlq $32,%%rdx;orq %%rdx,%%rax"
               : "=a"(result)::"%rdx");
  return result;
}


x86 assembly (clang, -O0):
<pqcpucycles_impl>:
push   %rbp
mov    %rsp,%rbp
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pqcpucycles_impl>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @pqcpucycles_impl() {
%1 = alloca i64
%2 = call i64 asm sideeffect ".byte 15;.byte 49;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @pqcpucycles_impl() {
%1 = tail call i64 asm sideeffect ".byte 15;.byte 49;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int rand();
int myrand(void *rng_state) {
  if (rng_state != NULL)
    rng_state = NULL;
  return (rand());
}


x86 assembly (clang, -O0):
<myrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112f <myrand+0x1f>
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @myrand(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
store i8* null, i8** %2
br label %6
6: ; preds = %5, %1
%7 = call i32 (...) @rand()
ret i32 %7
}

LLVM IR (-O2):
define i32 @myrand(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @rand()
ret i32 %2
}
/* Variables and functions */
int(Memento_find)(void *a) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Memento_find(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char *, char *);
int main(void) {
  printf("gnu %d.%d %s %s\n", 9, 4, "unknown", "linux");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x9,%esi
mov    $0x4,%edx
lea    0xeda(%rip),%rcx
lea    0xedb(%rip),%r8
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef2(%rip),%rcx
lea    0xef3(%rip),%r8
mov    $0x9,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"gnu %d.%d %s %s\0A\00"
@.str.1 = [8 x i8] c"unknown\00"
@.str.2 = [6 x i8] c"linux\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 9, i32 4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"gnu %d.%d %s %s\0A\00"
@.str.1 = [8 x i8] c"unknown\00"
@.str.2 = [6 x i8] c"linux\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 9, i32 4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
int test_imm_F2uint16_mem(unsigned short *val) {
  return ((*val) & (0xF2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F2uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 242
%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_F2uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 242
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *_hubmalloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *_hubcalloc(size_t nmemb, size_t len) {
  void *ptr;
  len = nmemb * len;
  ptr = _hubmalloc(len);
  if (ptr) {
    memset(ptr, 0, len);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<_hubcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <_hubmalloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1164 <_hubcalloc+0x44>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hubcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <_hubmalloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <_hubcalloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_hubcalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @_hubmalloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
void rotate(unsigned char *in) {
  unsigned char a, c;
  a = in[0];
  for (c = 0; c < 3; c++)
    in[c] = in[c + 1];
  in[3] = a;
  return;
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movb   $0x0,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
cmp    $0x3,%eax
jge    114b <rotate+0x4b>
mov    -0x8(%rbp),%rax
movzbl -0xa(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movzbl -0xa(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0xa(%rbp),%al
add    $0x1,%al
mov    %al,-0xa(%rbp)
jmp    1115 <rotate+0x15>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
mov    (%rdi),%al
movzwl 0x1(%rdi),%ecx
mov    0x3(%rdi),%dl
mov    %dl,0x2(%rdi)
mov    %cx,(%rdi)
mov    %al,0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @rotate(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr i8, i8* %0, i64 1
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %2, i8* %4
ret void
}
void foo387(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo387(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MUSIC_SetVolume(int);
void MUS_SetMasterVolume(int volume) { MUSIC_SetVolume(volume * 2); }


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

x86 assembly (clang, -O2):
<MUS_SetMasterVolume>:
add    %edi,%edi
jmp    1030 <MUSIC_SetVolume@plt>

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

LLVM IR (-O2):
define void @MUS_SetMasterVolume(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = tail call i32 @MUSIC_SetVolume(i32 %2)
ret void
}
int whiletest(int a) {
  while (a > 0) {
    a--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<whiletest>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111f <whiletest+0x1f>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <whiletest+0x7>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @whiletest(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
br label %3
9: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @whiletest(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fwrite(void *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void write_result(void *buf, int size) { fwrite(buf, 1, size, stdout); }


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

x86 assembly (clang, -O2):
<write_result>:
mov    %esi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @write_result(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 = load i32, i32* @stdout
%8 = call i32 @fwrite(i8* %5, i32 1, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @write_result(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fwrite(i8* %0, i32 1, i32 %1, i32 %3)
ret void
}