xunge/DecIR huggingface dataset:
/* Variables and functions */
void *memmove(void *, void const *, size_t);
void *memcpy(void *a1, const void *a2, size_t n) { return memmove(a1, a2, n); }


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

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

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

LLVM IR (-O2):
define i8* @memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ indigoFree(int);
int indigoLoadSmarts(int);
int indigoReadFile(char const *);
__attribute__((visibility("default"))) int
indigoLoadSmartsFromFile(const char *filename) {
  int source = indigoReadFile(filename);
  int result;
  if (source <= 0)
    return -1;
  result = indigoLoadSmarts(source);
  indigoFree(source);
  return result;
}


x86 assembly (clang, -O0):
<indigoLoadSmartsFromFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <indigoReadFile@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     115e <indigoLoadSmartsFromFile+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <indigoLoadSmartsFromFile+0x47>
mov    -0x14(%rbp),%edi
call   1050 <indigoLoadSmarts@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <indigoFree@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indigoLoadSmartsFromFile>:
push   %rbp
push   %rbx
push   %rax
call   1030 <indigoReadFile@plt>
test   %eax,%eax
jle    1152 <indigoLoadSmartsFromFile+0x22>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <indigoLoadSmarts@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <indigoFree@plt>
mov    %ebp,%eax
jmp    1157 <indigoLoadSmartsFromFile+0x27>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @indigoLoadSmartsFromFile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @indigoReadFile(i8* %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %17
11: ; preds = %1
%12 = load i32, i32* %4
%13 = call i32 @indigoLoadSmarts(i32 %12)
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @indigoFree(i32 %14)
%16 = load i32, i32* %5
store i32 %16, i32* %2
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @indigoLoadSmartsFromFile(i8* %0) {
%2 = tail call i32 @indigoReadFile(i8* %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @indigoLoadSmarts(i32 %2)
%6 = tail call i32 @indigoFree(i32 %2)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;
typedef int int8_t;

/* Variables and functions */
int8_t verify_ftype(uint8_t type) { return (type < 8); }


x86 assembly (clang, -O0):
<verify_ftype>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_ftype>:
xor    %eax,%eax
cmp    $0x8,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @verify_ftype(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 8
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @verify_ftype(i32 %0) {
%2 = icmp slt i32 %0, 8
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr,
                "usage: mknod name\n"
                "       mknod name [b | c] major minor [owner:group]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [71 x i8] c"usage: mknod name\0A mknod name [b | c] major minor [owner:group]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [71 x i8] c"usage: mknod name\0A mknod name [b | c] major minor [owner:group]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _delay_cycl(unsigned short);
void delay_us(unsigned short __us) {
  _delay_cycl((unsigned short)((((16 * __us) - 5) / 5)));
}


x86 assembly (clang, -O0):
<delay_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x4,%eax
sub    $0x5,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
movzwl %ax,%edi
call   1030 <_delay_cycl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_us>:
shl    $0x4,%edi
add    $0xfffffffb,%edi
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x21,%rax
add    %ecx,%eax
movzwl %ax,%edi
jmp    1030 <_delay_cycl@plt>

LLVM IR (-O0):
define void @delay_us(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = mul nsw i32 16, %4
%6 = sub nsw i32 %5, 5
%7 = sdiv i32 %6, 5
%8 = trunc i32 %7 to i16
%9 = call i32 @_delay_cycl(i16 zeroext %8)
ret void
}

LLVM IR (-O2):
define void @delay_us(i16 zeroext %0) {
%2 = zext i16 %0 to i32
%3 = shl nuw nsw i32 %2, 4
%4 = add nsw i32 %3, -5
%5 = sdiv i32 %4, 5
%6 = trunc i32 %5 to i16
%7 = tail call i32 @_delay_cycl(i16 zeroext %6)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
unsigned long get_XConfigureRequestEvent_serial(void *_p) {
  return (unsigned long)((XConfigureRequestEvent *)_p)->serial;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XConfigureRequestEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int radeon_fullscreen(DRM_IOCTL_ARGS) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @radeon_fullscreen(i32 %0) {
ret i32 0
}
void termop_reset(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      418, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x1a2,%r8d
lea    0xf37(%rip),%r9
lea    0xf3d(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_reset>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf64(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x1a2,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_reset = [13 x i8] c"termop_reset\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_reset(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 418, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.termop_reset, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_reset = [13 x i8] c"termop_reset\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_reset(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 418, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.termop_reset, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
unsigned char cast_char_uchar(char x) { return (unsigned char)x; }


x86 assembly (clang, -O0):
<cast_char_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_char_uchar>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @cast_char_uchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @cast_char_uchar(i8 returned signext %0) {
ret i8 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hash_int_impl(int /*<<< orphan*/);
uint32_t int_hash(const void *item) {
  uint32_t *integer = (uint32_t *)item;
  return hash_int_impl(*integer);
}


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

x86 assembly (clang, -O2):
<int_hash>:
mov    (%rdi),%edi
jmp    1030 <hash_int_impl@plt>

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

LLVM IR (-O2):
define i32 @int_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @hash_int_impl(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char buf[8];
  gets(buf);
  printf(buf);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @printf(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ encode_msg_1(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
scalar_t__ mode_is_connnected();
void send_message_1(uint8_t msg_id, uint8_t payload_1) {
  if (mode_is_connnected() != 0)
    encode_msg_1(msg_id, 0, payload_1);
}


x86 assembly (clang, -O0):
<send_message_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <mode_is_connnected@plt>
cmp    $0x0,%rax
je     114c <send_message_1+0x2c>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
xor    %esi,%esi
call   1030 <encode_msg_1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_message_1>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <mode_is_connnected@plt>
test   %rax,%rax
je     1144 <send_message_1+0x24>
mov    %ebp,%edi
xor    %esi,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <encode_msg_1@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @send_message_1(i32 %0, i32 %1) {
%3 = tail call i64 (...) @mode_is_connnected()
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @encode_msg_1(i32 %0, i32 0, i32 %1)
br label %7
7: ; preds = %5, %2
ret void
}
int sylk_set_options(set_opt, option)
int set_opt;
char *option;
{ return -1; }


x86 assembly (clang, -O0):
<sylk_set_options>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sylk_set_options(i32 %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  if (x > 0) {
    while (x > y) {
      y = x + y;
    }
  }
  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)
cmpl   $0x0,-0x8(%rbp)
jle    1161 <main+0x51>
jmp    1142 <main+0x32>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    115c <main+0x4c>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <main+0x32>
jmp    1161 <main+0x51>
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
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mxFree(void *);
void mz_free(void *p) { mxFree(p); }


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

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

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

LLVM IR (-O2):
define void @mz_free(i8* %0) {
%2 = tail call i32 @mxFree(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int main() {
  int x;
  int m;
  int n;
  assume(m >= 0 && m <= n - 1 && x == 0);
  while (x <= n - 1) {
    x++;
    if (x > m)
      m++;
  }
  assert(m <= n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jl     115e <main+0x3e>
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jg     115e <main+0x3e>
cmpl   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     119f <main+0x7f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    119a <main+0x7a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    116b <main+0x4b>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <assume@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %0
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = icmp sle i32 %8, %10
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 0
br label %15
15: ; preds = %12, %7, %0
%16 = phi i1 [ false, %7 ], [ false, %0 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
%18 = call i32 @assume(i32 %17)
br label %19
19: ; preds = %33, %15
%20 = load i32, i32* %2
%21 = load i32, i32* %4
%22 = sub nsw i32 %21, 1
%23 = icmp sle i32 %20, %22
br i1 %23, label %24, label %34
24: ; preds = %19
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = icmp sgt i32 %27, %28
br i1 %29, label %30, label %33
30: ; preds = %24
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %33
33: ; preds = %30, %24
br label %19
34: ; preds = %19
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = icmp sle i32 %35, %36
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assume(i32 0)
unreachable
}
void __attribute__((__unused__))
dbg_qh(char *label, struct ehci_hcd *ehci, struct ehci_qh *qh) {}


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

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

LLVM IR (-O0):
%struct.ehci_hcd = type opaque
%struct.ehci_qh = type opaque
define void @dbg_qh(i8* %0, %struct.ehci_hcd* %1, %struct.ehci_qh* %2) {
%4 = alloca i8*
%5 = alloca %struct.ehci_hcd*
%6 = alloca %struct.ehci_qh*
store i8* %0, i8** %4
store %struct.ehci_hcd* %1, %struct.ehci_hcd** %5
store %struct.ehci_qh* %2, %struct.ehci_qh** %6
ret void
}

LLVM IR (-O2):
%struct.ehci_hcd = type opaque
%struct.ehci_qh = type opaque
define void @dbg_qh(i8* nocapture %0, %struct.ehci_hcd* nocapture %1, %struct.ehci_qh* nocapture %2) {
ret void
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
void uppercase(char *inname) {
  int i;
  for (i = 0; i < strlen(inname); i++)
    inname[i] = toupper(inname[i]);
  return;
}


x86 assembly (clang, -O0):
<uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <uppercase+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <uppercase+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uppercase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1161 <uppercase+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <uppercase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @uppercase(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef unsigned char const uint16_t;

/* Variables and functions */
uint16_t get_uint16_be(const unsigned char *ptr) {
  return ptr[1] | (ptr[2] << 8);
}


x86 assembly (clang, -O0):
<get_uint16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint16_be>:
mov    0x1(%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @get_uint16_be(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @get_uint16_be(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ ft_bzero(char *, size_t);
scalar_t__ malloc(size_t);
char *ft_strnew(size_t size) {
  char *s;
  if ((s = (char *)malloc(size + 1)) == NULL)
    return (NULL);
  ft_bzero(s, size + 1);
  return (s);
}


x86 assembly (clang, -O0):
<ft_strnew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1154 <ft_strnew+0x34>
movq   $0x0,-0x8(%rbp)
jmp    116d <ft_strnew+0x4d>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
call   1030 <ft_bzero@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strnew>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1148 <ft_strnew+0x28>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <ft_bzero@plt>
jmp    114b <ft_strnew+0x2b>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @ft_strnew(i64 %0) {
%2 = add i64 %0, 1
%3 = tail call i64 @malloc(i64 %2)
%4 = inttoptr i64 %3 to i8*
%5 = icmp eq i64 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @ft_bzero(i8* %4, i64 %2)
br label %8
8: ; preds = %1, %6
%9 = phi i8* [ %4, %6 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *thread_function(void *arg) {
  int x = *(int *)arg;
  printf("Thread <%d> executing\n", x);
  return NULL;
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_function>:
push   %rax
mov    (%rdi),%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Thread <%d> executing\0A\00"
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i8* null
}

LLVM IR (-O2):
@.str = [23 x i8] c"Thread <%d> executing\0A\00"
define noalias i8* @thread_function(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}
void IxmlPrintf(const char *FmtStr, ...) { (void)FmtStr; }


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

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

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

LLVM IR (-O2):
define void @IxmlPrintf(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
scalar_t__ __stdfix_sat_hk(scalar_t__);
int32_t __stdfix_ssub_hk(int32_t x, int32_t y) {
  return (__stdfix_sat_hk((int32_t)x - (int32_t)y));
}


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

x86 assembly (clang, -O2):
<__stdfix_ssub_hk>:
sub    %rsi,%rdi
jmp    1030 <__stdfix_sat_hk@plt>

LLVM IR (-O0):
define i64 @__stdfix_ssub_hk(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 nsw i64 %5, %6
%8 = call i64 @__stdfix_sat_hk(i64 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @__stdfix_ssub_hk(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = tail call i64 @__stdfix_sat_hk(i64 %3)
ret i64 %4
}
/* Variables and functions */
int getDTEncoderAverage();
int /*<<< orphan*/ setDriveMotors(int, int, int, int);
int /*<<< orphan*/ zeroEncoders();
void encoderTest(int ticks) {
  zeroEncoders();
  while (getDTEncoderAverage() < ticks) {
    setDriveMotors(127, 127, 127, 127);
  }
}


x86 assembly (clang, -O0):
<encoderTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <zeroEncoders@plt>
mov    $0x0,%al
call   1040 <getDTEncoderAverage@plt>
cmp    -0x4(%rbp),%eax
jge    1167 <encoderTest+0x37>
mov    $0x7f,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1050 <setDriveMotors@plt>
jmp    1142 <encoderTest+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encoderTest>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <zeroEncoders@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getDTEncoderAverage@plt>
cmp    %ebx,%eax
jge    1166 <encoderTest+0x36>
mov    $0x7f,%edi
mov    $0x7f,%esi
mov    $0x7f,%edx
mov    $0x7f,%ecx
call   1050 <setDriveMotors@plt>
jmp    1140 <encoderTest+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @encoderTest(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @zeroEncoders()
br label %4
4: ; preds = %8, %1
%5 = call i32 (...) @getDTEncoderAverage()
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 @setDriveMotors(i32 127, i32 127, i32 127, i32 127)
br label %4
10: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @encoderTest(i32 %0) {
%2 = tail call i32 (...) @zeroEncoders()
%3 = tail call i32 (...) @getDTEncoderAverage()
%4 = icmp slt i32 %3, %0
br i1 %4, label %5, label %9
5: ; preds = %1, %5
%6 = tail call i32 @setDriveMotors(i32 127, i32 127, i32 127, i32 127)
%7 = tail call i32 (...) @getDTEncoderAverage()
%8 = icmp slt i32 %7, %0
br i1 %8, label %5, label %9
9: ; preds = %5, %1
ret void
}
void ResetTerminal() {}


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

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

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

LLVM IR (-O2):
define void @ResetTerminal() {
ret void
}
f() { return 7; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 7
}

LLVM IR (-O2):
define i32 @f() {
ret i32 7
}
/* Variables and functions */
char *strncat(char *restrict dest, const char *restrict src, size_t n) {
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @strncat(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @strncat(i8* noalias nocapture readnone %0, i8* noalias nocapture readnone %1, i64 %2) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void unix_error(const char *msg) {
  fprintf(stderr, "%s: %s\n", msg, strerror(errno));
  exit(0);
}


x86 assembly (clang, -O0):
<unix_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<unix_error>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeac(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @unix_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = tail call i32 @exit(i32 0)
unreachable
}
void RTHeapOffsetAllocZ(void) {}


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

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

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

LLVM IR (-O2):
define void @RTHeapOffsetAllocZ() {
ret void
}
int find_l(int x, int *arr, int size) {
  int i;
  for (i = size - 1; i >= 0; --i)
    if (arr[i] == x)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<find_l>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1153 <find_l+0x53>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1140 <find_l+0x40>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <find_l+0x5a>
jmp    1145 <find_l+0x45>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1117 <find_l+0x17>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_l>:
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %eax,%eax
jle    1120 <find_l+0x20>
add    $0xffffffffffffffff,%rax
mov    %eax,%ecx
cmp    %edi,(%rsi,%rcx,4)
jne    1110 <find_l+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @find_l(i32 %0, i32* nocapture %1, i32 %2) {
%4 = zext i32 %2 to i64
br label %5
5: ; preds = %10, %3
%6 = phi i64 [ %7, %10 ], [ %4, %3 ]
%7 = add nsw i64 %6, -1
%8 = trunc i64 %6 to i32
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = and i64 %7, 4294967295
%12 = getelementptr inbounds i32, i32* %1, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, %0
br i1 %14, label %15, label %5
15: ; preds = %10
%16 = trunc i64 %7 to i32
br label %17
17: ; preds = %5, %15
%18 = phi i32 [ %16, %15 ], [ -1, %5 ]
ret i32 %18
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t get_ip() { return 0x7f000001; }


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

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

LLVM IR (-O0):
define i32 @get_ip() {
ret i32 2130706433
}

LLVM IR (-O2):
define i32 @get_ip() {
ret i32 2130706433
}
/* Variables and functions */
int /*<<< orphan*/ rem_on();
void v3() {
  *(volatile unsigned long *)((void *)0xfffff400 + 0x34) = (1 << (1));
  *(volatile unsigned long *)((void *)0xfffff400 + 0x30) = (1 << (0));
  rem_on();
}


x86 assembly (clang, -O0):
<v3>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff400,%eax
movq   $0x2,0x34(%rax)
mov    $0xfffff400,%eax
movq   $0x1,0x30(%rax)
mov    $0x0,%al
call   1030 <rem_on@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<v3>:
mov    $0xfffff430,%eax
movq   $0x2,0x4(%rax)
movq   $0x1,(%rax)
xor    %eax,%eax
jmp    1030 <rem_on@plt>

LLVM IR (-O0):
define void @v3() {
store volatile i64 2, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294964224 to i8*), i64 52) to i64*)
store volatile i64 1, i64* bitcast (i8* getelementptr (i8, i8* inttoptr (i64 4294964224 to i8*), i64 48) to i64*)
%1 = call i32 (...) @rem_on()
ret void
}

LLVM IR (-O2):
define void @v3() {
store volatile i64 2, i64* inttoptr (i64 4294964276 to i64*)
store volatile i64 1, i64* inttoptr (i64 4294964272 to i64*)
%1 = tail call i32 (...) @rem_on()
ret void
}
/* Variables and functions */
int init_or_fini(int /*<<< orphan*/);
int iftable_init(void) {
  ;
  return init_or_fini(0);
}


x86 assembly (clang, -O0):
<iftable_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <init_or_fini@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<iftable_init>:
xor    %edi,%edi
jmp    1030 <init_or_fini@plt>

LLVM IR (-O0):
define i32 @iftable_init() {
%1 = call i32 @init_or_fini(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @iftable_init() {
%1 = tail call i32 @init_or_fini(i32 0)
ret i32 %1
}
int sqr(int x) { return (x * x); }


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

x86 assembly (clang, -O2):
<sqr>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @sqr(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stat(char *, struct stat *);
int write_size(FILE *target, char *filename) {
  struct stat st;
  stat(filename, &st);
  uint32_t size = st.st_size;
  fwrite(&size, sizeof(uint32_t), 1, target);
}


x86 assembly (clang, -O0):
<write_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <stat@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x24(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_size>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rax
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1030 <stat@plt>
mov    0x8(%rsp),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @write_size(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca %struct.stat
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %5
%9 = call i32 @stat(i8* %8, %struct.stat* %6)
%10 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%11 = load i32, i32* %10
store i32 %11, i32* %7
%12 = load i32*, i32** %4
%13 = call i32 @fwrite(i32* %7, i32 4, i32 1, i32* %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @write_size(i32* nocapture %0, i8* nocapture %1) {
%3 = alloca %struct.stat
%4 = alloca i32
%5 = bitcast %struct.stat* %3 to i8*
%6 = call i32 @stat(i8* %1, %struct.stat* %3)
%7 = bitcast i32* %4 to i8*
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%9 = load i32, i32* %8
store i32 %9, i32* %4
%10 = call i32 @fwrite(i32* %4, i32 4, i32 1, i32* %0)
ret i32 undef
}
double scale(double y) { return 2 * (y - 0.5); }


x86 assembly (clang, -O0):
<scale>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xef2(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xede(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale>:
addsd  0xef8(%rip),%xmm0
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @scale(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 5.000000e-01
%5 = fmul double 2.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @scale(double %0) {
%2 = fadd double %0, -5.000000e-01
%3 = fmul double %2, 2.000000e+00
ret double %3
}
void initialize_parallel_write(int stage) {}


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

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

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

LLVM IR (-O2):
define void @initialize_parallel_write(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int p0(void) {
  foo();
  return 2;
}


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

x86 assembly (clang, -O2):
<p0>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @p0() {
%1 = call i32 (...) @foo()
ret i32 2
}

LLVM IR (-O2):
define i32 @p0() {
%1 = tail call i32 (...) @foo()
ret i32 2
}
adrx0regx1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (((int *)10000000)[x0]) = (p1[x1]); }


x86 assembly (clang, -O0):
<adrx0regx1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0regx1_set>:
movslq %ecx,%rax
mov    (%r9,%rax,4),%eax
movslq %edx,%rcx
mov    %eax,0x989680(,%rcx,4)
ret

LLVM IR (-O0):
define i32 @adrx0regx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %13
%15 = load i32, i32* %11
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %10
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %20
store i32 %18, i32* %21
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @adrx0regx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %10
store i32 %9, i32* %11
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int rbm_fflush(FILE *stream) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rbm_fflush(i32* nocapture readnone %0) {
ret i32 0
}