xunge/DecIR huggingface dataset:
/* Variables and functions */
void *noise_note_on() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @noise_note_on() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @noise_note_on() {
ret i8* null
}
void synchronize_mpi() {}


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

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

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

LLVM IR (-O2):
define void @synchronize_mpi() {
ret void
}
/* Type definitions */
struct vnic_rq {
  int dummy;
};

/* Variables and functions */
int stub1(struct vnic_rq *);
scalar_t__ vnic_rq_desc_avail(struct vnic_rq *);
int vnic_rq_fill(struct vnic_rq *rq, int (*buf_fill)(struct vnic_rq *rq)) {
  int err;
  while (vnic_rq_desc_avail(rq) > 0) {
    err = (*buf_fill)(rq);
    if (err)
      return err;
  }
  return 0;
}


x86 assembly (clang, -O0):
<vnic_rq_fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <vnic_rq_desc_avail@plt>
cmp    $0x0,%rax
jle    115a <vnic_rq_fill+0x4a>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1155 <vnic_rq_fill+0x45>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <vnic_rq_fill+0x51>
jmp    1120 <vnic_rq_fill+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnic_rq_fill>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <vnic_rq_desc_avail@plt>
test   %rax,%rax
jle    1139 <vnic_rq_fill+0x29>
mov    %rbx,%rdi
call   *%r14
test   %eax,%eax
je     1120 <vnic_rq_fill+0x10>
jmp    113b <vnic_rq_fill+0x2b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.vnic_rq = type { i32 }
define i32 @vnic_rq_fill(%struct.vnic_rq* %0, i32 (%struct.vnic_rq*)* %1) {
%3 = alloca i32
%4 = alloca %struct.vnic_rq*
%5 = alloca i32 (%struct.vnic_rq*)*
%6 = alloca i32
store %struct.vnic_rq* %0, %struct.vnic_rq** %4
store i32 (%struct.vnic_rq*)* %1, i32 (%struct.vnic_rq*)** %5
br label %7
7: ; preds = %19, %2
%8 = load %struct.vnic_rq*, %struct.vnic_rq** %4
%9 = call i64 @vnic_rq_desc_avail(%struct.vnic_rq* %8)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load i32 (%struct.vnic_rq*)*, i32 (%struct.vnic_rq*)** %5
%13 = load %struct.vnic_rq*, %struct.vnic_rq** %4
%14 = call i32 %12(%struct.vnic_rq* %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = load i32, i32* %6
store i32 %18, i32* %3
br label %21
19: ; preds = %11
br label %7
20: ; preds = %7
store i32 0, i32* %3
br label %21
21: ; preds = %20, %17
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
%struct.vnic_rq = type { i32 }
define i32 @vnic_rq_fill(%struct.vnic_rq* %0, i32 (%struct.vnic_rq*)* nocapture %1) {
br label %3
3: ; preds = %6, %2
%4 = tail call i64 @vnic_rq_desc_avail(%struct.vnic_rq* %0)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 %1(%struct.vnic_rq* %0)
%8 = icmp eq i32 %7, 0
br i1 %8, label %3, label %9
9: ; preds = %3, %6
%10 = phi i32 [ %7, %6 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ move_cursor(char, char);
int set_cursor(char x, char y) { move_cursor(x, y); }


x86 assembly (clang, -O0):
<set_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x5(%rbp),%al
movsbl %al,%edi
movsbl -0x6(%rbp),%esi
call   1030 <move_cursor@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @set_cursor(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @move_cursor(i8 signext %0, i8 signext %1)
ret i32 undef
}
signed long long f18(signed long long v_foo) {
  signed long long v_parta = v_foo << 4;
  signed long long v_partb = ((unsigned long long)v_foo) >> 60;
  signed long long v_rotl = v_parta | v_partb;
  signed long long v_and = v_rotl & 126;
  return v_and;
}


x86 assembly (clang, -O0):
<f18>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x3c,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
and    $0x7e,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f18>:
mov    %rdi,%rax
rol    $0x4,%rax
and    $0x7e,%eax
ret

LLVM IR (-O0):
define i64 @f18(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %2
%7 = load i64, i64* %2
%8 = shl i64 %7, 4
store i64 %8, i64* %3
%9 = load i64, i64* %2
%10 = lshr i64 %9, 60
store i64 %10, i64* %4
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = or i64 %11, %12
store i64 %13, i64* %5
%14 = load i64, i64* %5
%15 = and i64 %14, 126
store i64 %15, i64* %6
%16 = load i64, i64* %6
ret i64 %16
}

LLVM IR (-O2):
define i64 @f18(i64 %0) {
%2 = tail call i64 @llvm.fshl.i64(i64 %0, i64 %0, i64 4)
%3 = and i64 %2, 126
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *xmalloc(size_t n) {
  void *p;
  if (p = malloc(n), p == NULL) {
    perror("malloc");
    abort();
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1167 <xmalloc+0x37>
lea    0xea5(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret i8* %2
}
/* Type definitions */
struct _Locale_codecvt {
  int dummy;
};

/* Variables and functions */
void _Locale_codecvt_destroy(struct _Locale_codecvt *lcodecvt) {}


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

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

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

LLVM IR (-O2):
%struct._Locale_codecvt = type { i32 }
define void @_Locale_codecvt_destroy(%struct._Locale_codecvt* nocapture %0) {
ret void
}
/* Type definitions */
struct vmbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(int /*<<< orphan*/, int /*<<< orphan*/, size_t);
size_t vmbuf_alloc(struct vmbuf *, size_t);
int /*<<< orphan*/ vmbuf_mem2(struct vmbuf *, size_t);
size_t vmbuf_alloczero(struct vmbuf *vmbuf, size_t n) {
  size_t loc = vmbuf_alloc(vmbuf, n);
  memset(vmbuf_mem2(vmbuf, loc), 0, n);
  return loc;
}


x86 assembly (clang, -O0):
<vmbuf_alloczero>:
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 <vmbuf_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <vmbuf_mem2@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmbuf_alloczero>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <vmbuf_alloc@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <vmbuf_mem2@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    %r14,%rdx
call   1050 <memset@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.vmbuf = type { i32 }
define i64 @vmbuf_alloczero(%struct.vmbuf* %0, i64 %1) {
%3 = alloca %struct.vmbuf*
%4 = alloca i64
%5 = alloca i64
store %struct.vmbuf* %0, %struct.vmbuf** %3
store i64 %1, i64* %4
%6 = load %struct.vmbuf*, %struct.vmbuf** %3
%7 = load i64, i64* %4
%8 = call i64 @vmbuf_alloc(%struct.vmbuf* %6, i64 %7)
store i64 %8, i64* %5
%9 = load %struct.vmbuf*, %struct.vmbuf** %3
%10 = load i64, i64* %5
%11 = call i32 @vmbuf_mem2(%struct.vmbuf* %9, i64 %10)
%12 = load i64, i64* %4
%13 = call i32 @memset(i32 %11, i32 0, i64 %12)
%14 = load i64, i64* %5
ret i64 %14
}

LLVM IR (-O2):
%struct.vmbuf = type { i32 }
define i64 @vmbuf_alloczero(%struct.vmbuf* %0, i64 %1) {
%3 = tail call i64 @vmbuf_alloc(%struct.vmbuf* %0, i64 %1)
%4 = tail call i32 @vmbuf_mem2(%struct.vmbuf* %0, i64 %3)
%5 = tail call i32 @memset(i32 %4, i32 0, i64 %1)
ret i64 %3
}
void setshort(arrayptr, num_cols, row, col, value) short *arrayptr;
short num_cols;
short row, col, value;
{
  int position;
  position = row * num_cols + col;
  *(arrayptr + position) = value;
}


x86 assembly (clang, -O0):
<setshort>:
push   %rbp
mov    %rsp,%rbp
mov    %r8w,%ax
mov    %rdi,-0x8(%rbp)
mov    %si,-0xa(%rbp)
mov    %dx,-0xc(%rbp)
mov    %cx,-0xe(%rbp)
mov    %ax,-0x10(%rbp)
movswl -0xc(%rbp),%eax
movswl -0xa(%rbp),%ecx
imul   %ecx,%eax
movswl -0xe(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%dx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setshort>:
movswl %dx,%eax
movswl %si,%edx
imul   %eax,%edx
movswl %cx,%eax
add    %edx,%eax
cltq
mov    %r8w,(%rdi,%rax,2)
ret

LLVM IR (-O0):
define void @setshort(i16* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i16*
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
%10 = alloca i16
%11 = alloca i32
%12 = trunc i32 %1 to i16
%13 = trunc i32 %2 to i16
%14 = trunc i32 %3 to i16
%15 = trunc i32 %4 to i16
store i16* %0, i16** %6
store i16 %12, i16* %7
store i16 %13, i16* %8
store i16 %14, i16* %9
store i16 %15, i16* %10
%16 = load i16, i16* %8
%17 = sext i16 %16 to i32
%18 = load i16, i16* %7
%19 = sext i16 %18 to i32
%20 = mul nsw i32 %17, %19
%21 = load i16, i16* %9
%22 = sext i16 %21 to i32
%23 = add nsw i32 %20, %22
store i32 %23, i32* %11
%24 = load i16, i16* %10
%25 = load i16*, i16** %6
%26 = load i32, i32* %11
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i16, i16* %25, i64 %27
store i16 %24, i16* %28
ret void
}

LLVM IR (-O2):
define void @setshort(i16* nocapture writeonly %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = trunc i32 %4 to i16
%7 = shl i32 %2, 16
%8 = ashr exact i32 %7, 16
%9 = shl i32 %1, 16
%10 = ashr exact i32 %9, 16
%11 = mul nsw i32 %8, %10
%12 = shl i32 %3, 16
%13 = ashr exact i32 %12, 16
%14 = add nsw i32 %11, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i16, i16* %0, i64 %15
store i16 %6, i16* %16
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
gasrint() { ol("asra\n\trorb"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"asra\0A\09rorb\00"
define i32 @gasrint() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [11 x i8] c"asra\0A\09rorb\00"
define i32 @gasrint() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: findin [-0q] glob-expr [ENVVAR|-]\n"
        "  note that MANPATH likely requires man*/foo* as a glob\n",
        stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [98 x i8] c"Usage: findin [-0q] glob-expr [ENVVAR|-]\0A note that MANPATH likely requires man*/foo* as a glob\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [98 x i8] c"Usage: findin [-0q] glob-expr [ENVVAR|-]\0A note that MANPATH likely requires man*/foo* as a glob\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
scalar_t__ npu_has_flash();
scalar_t__ npu_is_pcimaster();
unsigned int npu_is_master(void) {
  return ((npu_has_flash()) && (npu_is_pcimaster()));
}


x86 assembly (clang, -O0):
<npu_is_master>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <npu_has_flash@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1152 <npu_is_master+0x32>
mov    $0x0,%al
call   1030 <npu_is_pcimaster@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<npu_is_master>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <npu_has_flash@plt>
test   %rax,%rax
je     113e <npu_is_master+0x1e>
xor    %eax,%eax
call   1030 <npu_is_pcimaster@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @npu_is_master() {
%1 = call i64 (...) @npu_has_flash()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i64 (...) @npu_is_pcimaster()
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ false, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @npu_is_master() {
%1 = tail call i64 (...) @npu_has_flash()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 (...) @npu_is_pcimaster()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int do_command(char *, int /*<<< orphan*/);
int process_command(char *cmd) { return do_command(cmd, 0); }


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

x86 assembly (clang, -O2):
<process_command>:
xor    %esi,%esi
jmp    1030 <do_command@plt>

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

LLVM IR (-O2):
define i32 @process_command(i8* %0) {
%2 = tail call i32 @do_command(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ isspace(char);
int strlen(char *);
char *rtrim(char *s) {
  char *back = s + strlen(s);
  while (isspace(*--back))
    ;
  *(back + 1) = '\0';
  return s;
}


x86 assembly (clang, -O0):
<rtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
movsbl -0x1(%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     1174 <rtrim+0x54>
jmp    114d <rtrim+0x2d>
mov    -0x10(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtrim>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
cltq
lea    (%rax,%r14,1),%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl -0x2(%rbx),%edi
call   1040 <isspace@plt>
add    $0xffffffffffffffff,%rbx
test   %rax,%rax
jne    1140 <rtrim+0x20>
movb   $0x0,(%rbx)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @rtrim(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
br label %5
5: ; preds = %5, %1
%6 = phi i8* [ %4, %1 ], [ %7, %5 ]
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = load i8, i8* %7
%9 = tail call i64 @isspace(i8 signext %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %5
11: ; preds = %5
store i8 0, i8* %6
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_help(char *s) {
  printf(
      "\n"
      "Usage: %s [-f <file> | -e <code>]\n"
      "\n"
      "exec_shellcode makes it easy to try out shellcode locally. You can "
      "quickly execute code that is stored in an environment variable or you "
      "could run something that contains null characters etc from a file.\n"
      "\n"
      "Options:\n"
      "\t-f reads the binary file <file> and executes it.\n"
      "\t-e executes the argument <code> directly.\n"
      "\n",
      s);
}


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

x86 assembly (clang, -O2):
<print_help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [345 x i8] c"\0AUsage: %s [-f <file> | -e <code>]\0A\0Aexec_shellcode makes it easy to try out shellcode locally. You can quickly execute code that is stored in an environment variable or you could run something that contains null characters etc from a file.\0A\0AOptions:\0A\09-f reads the binary file <file> and executes it.\0A\09-e executes the argument <code> directly.\0A\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([345 x i8], [345 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [345 x i8] c"\0AUsage: %s [-f <file> | -e <code>]\0A\0Aexec_shellcode makes it easy to try out shellcode locally. You can quickly execute code that is stored in an environment variable or you could run something that contains null characters etc from a file.\0A\0AOptions:\0A\09-f reads the binary file <file> and executes it.\0A\09-e executes the argument <code> directly.\0A\0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([345 x i8], [345 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StabilizationSettingsBank1Handle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void StabilizationSettingsBank1RequestUpdate() {
  UAVObjRequestUpdate(StabilizationSettingsBank1Handle());
}


x86 assembly (clang, -O0):
<StabilizationSettingsBank1RequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <StabilizationSettingsBank1Handle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StabilizationSettingsBank1RequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <StabilizationSettingsBank1Handle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @StabilizationSettingsBank1RequestUpdate() {
%1 = call i32 (...) @StabilizationSettingsBank1Handle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @StabilizationSettingsBank1RequestUpdate() {
%1 = tail call i32 (...) @StabilizationSettingsBank1Handle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
void lcd_printf(char *text) {}


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

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

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

LLVM IR (-O2):
define void @lcd_printf(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPIOPinWrite(int, int, int);
void LedSetRed() {
  GPIOPinWrite(0x40025000, 0x00000002, 0x00000002);
  GPIOPinWrite(0x40025000, 0x00000004 | 0x00000008, 0);
}


x86 assembly (clang, -O0):
<LedSetRed>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40025000,%edi
mov    $0x2,%edx
mov    %edx,%esi
call   1030 <GPIOPinWrite@plt>
mov    $0x40025000,%edi
mov    $0xc,%esi
xor    %edx,%edx
call   1030 <GPIOPinWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LedSetRed>:
push   %rax
mov    $0x40025000,%edi
mov    $0x2,%esi
mov    $0x2,%edx
call   1030 <GPIOPinWrite@plt>
mov    $0x40025000,%edi
mov    $0xc,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <GPIOPinWrite@plt>

LLVM IR (-O0):
define void @LedSetRed() {
%1 = call i32 @GPIOPinWrite(i32 1073893376, i32 2, i32 2)
%2 = call i32 @GPIOPinWrite(i32 1073893376, i32 12, i32 0)
ret void
}

LLVM IR (-O2):
define void @LedSetRed() {
%1 = tail call i32 @GPIOPinWrite(i32 1073893376, i32 2, i32 2)
%2 = tail call i32 @GPIOPinWrite(i32 1073893376, i32 12, i32 0)
ret void
}
void collisions_resolve() {}


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

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

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

LLVM IR (-O2):
define void @collisions_resolve() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
int /*<<< orphan*/ insertion_sort(int *, int);
int /*<<< orphan*/ print(int *, int);
int main() {
  int nums[] = {2, 10, 3, 14, 15, 6, 3, 9};
  int n = sizeof(nums) / sizeof(nums[0]);
  insertion_sort(nums, n);
  print(nums, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <insertion_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <insertion_sort@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <print@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.nums = [8 x i32] [i32 2, i32 10, i32 3, i32 14, i32 15, i32 6, i32 3, i32 9]
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @insertion_sort(i32* %5, i32 %6)
%8 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = call i32 @print(i32* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [8 x i32] [i32 2, i32 10, i32 3, i32 14, i32 15, i32 6, i32 3, i32 9]
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @insertion_sort(i32* %3, i32 8)
%5 = call i32 @print(i32* %3, i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_elements(int *arr, int len) {
  for (int i = len; i >= 0; i--) {
    printf("%d\n", arr[i]);
  }
}


x86 assembly (clang, -O0):
<print_elements>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1154 <print_elements+0x44>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1125 <print_elements+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_elements>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
js     1142 <print_elements+0x32>
mov    %rdi,%r15
mov    %esi,%ebx
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
jb     1130 <print_elements+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_elements(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ %5, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nsw i64 %8, -1
%13 = icmp eq i64 %8, 0
br i1 %13, label %6, label %7
}
void set_bit(char *addr, int bit) {
  *(addr + bit / 8) = *(addr + bit / 8) | (1 << (bit % 8));
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%eax
mov    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x19(%rbp),%dl
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %esi,%ecx
lea    0x7(%rcx),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x3,%eax
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
cltq
or     %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @set_bit(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 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i32, i32* %4
%13 = srem i32 %12, 8
%14 = shl i32 1, %13
%15 = or i32 %11, %14
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
%18 = load i32, i32* %4
%19 = sdiv i32 %18, 8
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %17, i64 %20
store i8 %16, i8* %21
ret void
}

LLVM IR (-O2):
define void @set_bit(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = and i32 %1, 7
%8 = shl nuw nsw i32 1, %7
%9 = trunc i32 %8 to i8
%10 = or i8 %6, %9
store i8 %10, i8* %5
ret void
}
void RTVfsChainOpenFile(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsChainOpenFile() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glmStep3fv(float *, float *, float const *);
void glmStep3fv_(float x[3], const float edge[3]) { glmStep3fv(x, x, edge); }


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

x86 assembly (clang, -O2):
<glmStep3fv_>:
mov    %rsi,%rdx
mov    %rdi,%rsi
jmp    1030 <glmStep3fv@plt>

LLVM IR (-O0):
define void @glmStep3fv_(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %3
%7 = load float*, float** %4
%8 = call i32 @glmStep3fv(float* %5, float* %6, float* %7)
ret void
}

LLVM IR (-O2):
define void @glmStep3fv_(float* %0, float* %1) {
%3 = tail call i32 @glmStep3fv(float* %0, float* %0, float* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr, "Usage: %s [ -h ] -i <inputFile> -o <outputFile>\n", prog);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"Usage: %s [ -h ] -i <inputFile> -o <outputFile>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"Usage: %s [ -h ] -i <inputFile> -o <outputFile>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int __builtin_HEXAGON_M2_mnaci(int, int, int);
int test1(int rx, int rs, int rt) {
  return __builtin_HEXAGON_M2_mnaci(rx, rs, rt);
}


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

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

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

LLVM IR (-O2):
define i32 @test1(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @__builtin_HEXAGON_M2_mnaci(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
char nondet_char() {
  char c;
  return c;
}


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

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

LLVM IR (-O0):
define signext i8 @nondet_char() {
%1 = alloca i8
%2 = load i8, i8* %1
ret i8 %2
}

LLVM IR (-O2):
define signext i8 @nondet_char() {
ret i8 undef
}
void setBlock() {}


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

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

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

LLVM IR (-O2):
define void @setBlock() {
ret void
}
int cp_hash_compare_int(void *i, void *j) { return *((int *)i) - *((int *)j); }


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

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

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

LLVM IR (-O2):
define i32 @cp_hash_compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int io_out(char *str) {
  printf("%s", str);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @io_out(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
int Bematech_FI_FechaRelatorioGerencial(Retorno)
int Retorno[3];
{
  char Var[3];
  return Formata("\x1b|21|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_FechaRelatorioGerencial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xb(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_FechaRelatorioGerencial>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rdi
lea    0x5(%rsp),%rsi
xor    %eax,%eax
call   1030 <Formata@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\1B|21|\1B\00"
define i32 @Bematech_FI_FechaRelatorioGerencial(i32* %0) {
%2 = alloca i32*
%3 = alloca [3 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = load i32*, i32** %2
%6 = call i32 (i8*, i8*, i32*, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i8*, i32*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i32* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B|21|\1B\00"
define i32 @Bematech_FI_FechaRelatorioGerencial(i32* %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, i8*, i32*, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i8*, i32*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3, i32* %0)
ret i32 %4
}
/* Type definitions */
typedef unsigned int u_int16_t;

/* Variables and functions */
unsigned int make_hash3(u_int16_t txn_id, const char *qname) {
  unsigned int hash = 1;
  while (*qname != 0) {
    hash = (hash * 59) + *qname;
    qname++;
  }
  hash ^= txn_id;
  return hash;
}


x86 assembly (clang, -O0):
<make_hash3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <make_hash3+0x43>
imul   $0x3b,-0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1112 <make_hash3+0x12>
mov    -0x4(%rbp),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_hash3>:
mov    (%rsi),%cl
test   %cl,%cl
je     1126 <make_hash3+0x26>
add    $0x1,%rsi
mov    $0x1,%eax
nop
movsbl %cl,%ecx
imul   $0x3b,%eax,%eax
add    %ecx,%eax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <make_hash3+0x10>
xor    %edi,%eax
ret
mov    $0x1,%eax
xor    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @make_hash3(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 1, %2 ]
%8 = phi i8* [ %12, %5 ], [ %1, %2 ]
%9 = sext i8 %6 to i32
%10 = mul i32 %7, 59
%11 = add i32 %10, %9
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 1, %2 ], [ %11, %5 ]
%17 = xor i32 %16, %0
ret i32 %17
}
int inc(int i) { return i + 1; }


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

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

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

LLVM IR (-O2):
define i32 @inc(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void error(void) {
ERROR:;
  goto ERROR;
  return;
}


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

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

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

LLVM IR (-O2):
define void @error() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ event_init();
int main(int argc, char **argv) {
  event_init();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @event_init()
ret i32 0
}
__attribute__((always_)) void __monitor(const void *eax, unsigned long ecx,
                                        unsigned long edx) {
  asm volatile(".byte 0x0f, 0x01, 0xc8;" ::"a"(eax), "c"(ecx), "d"(edx));
}


x86 assembly (clang, -O0):
<__monitor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
monitor %rax,%ecx,%edx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__monitor>:
mov    %rsi,%rcx
mov    %rdi,%rax
monitor %rax,%ecx,%edx
ret

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

LLVM IR (-O2):
define void @__monitor(i8* %0, i64 %1, i64 %2) {
tail call void asm sideeffect ".byte 0x0f, 0x01, 0xc8;", "{ax},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i64 %1, i64 %2)
ret void
}
int registerSgn(unsigned int reg) {
  return (reg & (1U << (8U * 2U - 1))) ? -1 : 1;
}


x86 assembly (clang, -O0):
<registerSgn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x8000,%edx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<registerSgn>:
and    $0x8000,%edi
neg    %edi
sbb    %eax,%eax
or     $0x1,%eax
ret

LLVM IR (-O0):
define i32 @registerSgn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 32768
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -1, i32 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @registerSgn(i32 %0) {
%2 = and i32 %0, 32768
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 1, i32 -1
ret i32 %4
}
int test_imm_DAint16_reg(short val) {
  return ((val) & (-0xDA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DAint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff26,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DAint16_reg>:
test   $0xff26,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_DAint16_reg(i16 signext %0) {
%2 = and i16 %0, -218
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int __dynamic_dbg_enabled_helper(char *modname, int type, int value, int hash) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @__dynamic_dbg_enabled_helper(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_from_montgomery(uintptr_t, uintptr_t);
void fiat_p256_from_montgomery(uint64_t out1[4], const uint64_t arg1[4]) {
  internal_fiat_p256_from_montgomery((uintptr_t)out1, (uintptr_t)arg1);
}


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

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

LLVM IR (-O0):
define void @fiat_p256_from_montgomery(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_p256_from_montgomery(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_from_montgomery(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p256_from_montgomery(i64 %3, i64 %4)
ret void
}