xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("running ubenchmark: simple_loop...\n");
  while (1) {
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [36 x i8] c"running ubenchmark: simple_loop...\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@str = [35 x i8] c"running ubenchmark: simple_loop...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
__attribute__((weak)) void fd_nrf8001_set_tx_power_success(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_set_tx_power_success() {
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int bench_cmp(const void *x, const void *y) {
  const int64_t *ix = (const int64_t *)x;
  const int64_t *iy = (const int64_t *)y;
  return *ix - *iy;
}


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

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

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

LLVM IR (-O2):
define i32 @bench_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
int f_1(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @f_1(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ dtoi(float);
int /*<<< orphan*/ g2_move(int /*<<< orphan*/, float, float);
void g2_move_(float *dev, float *x, float *y) { g2_move(dtoi(*dev), *x, *y); }


x86 assembly (clang, -O0):
<g2_move_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <dtoi@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
call   1040 <g2_move@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2_move_>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
movss  (%rdi),%xmm0
call   1030 <dtoi@plt>
movss  (%rbx),%xmm0
movss  (%r14),%xmm1
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <g2_move@plt>

LLVM IR (-O0):
define void @g2_move_(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %4
%8 = load float, float* %7
%9 = call i32 @dtoi(float %8)
%10 = load float*, float** %5
%11 = load float, float* %10
%12 = load float*, float** %6
%13 = load float, float* %12
%14 = call i32 @g2_move(i32 %9, float %11, float %13)
ret void
}

LLVM IR (-O2):
define void @g2_move_(float* nocapture %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %0
%5 = tail call i32 @dtoi(float %4)
%6 = load float, float* %1
%7 = load float, float* %2
%8 = tail call i32 @g2_move(i32 %5, float %6, float %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void error(char *msg) {
  fprintf(stdout, "FATAL ERROR: %s\n", msg);
  fflush(stdout);
  exit(1);
}


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

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [17 x i8] c"FATAL ERROR: %s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
char *xmalloc_atomic(size)
unsigned int size;
{
  char *tem = malloc(size);
  if (!tem)
    memory_out();
  return tem;
}


x86 assembly (clang, -O0):
<xmalloc_atomic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xmalloc_atomic+0x2b>
mov    $0x0,%al
call   1030 <memory_out@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc_atomic>:
push   %rbx
mov    %edi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1137 <xmalloc_atomic+0x17>
xor    %eax,%eax
call   1030 <memory_out@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xmalloc_atomic(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 (...) @memory_out()
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @xmalloc_atomic(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @memory_out()
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int intcompare(const void *const a, const void *const b) {
  return *((uint32_t *)a) - *((uint32_t *)b);
}


x86 assembly (clang, -O0):
<intcompare>:
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):
<intcompare>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @intcompare(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 @intcompare(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 */
unsigned int bswap_32(unsigned int);
unsigned int VSSwapHostIntToLittle(unsigned int x) { return (bswap_32(x)); }


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

x86 assembly (clang, -O2):
<VSSwapHostIntToLittle>:
jmp    1030 <bswap_32@plt>

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

LLVM IR (-O2):
define i32 @VSSwapHostIntToLittle(i32 %0) {
%2 = tail call i32 @bswap_32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int test2(int);
int test(int b) { return test2(b ? b : 1); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1130 <test+0x20>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    113d <test+0x2d>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <test+0x2d>
mov    -0x8(%rbp),%edi
call   1030 <test2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
test   %edi,%edi
mov    $0x1,%eax
cmove  %eax,%edi
jmp    1030 <test2@plt>

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

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
%4 = tail call i32 @test2(i32 %3)
ret i32 %4
}
/* Type definitions */
struct ui {
  int dummy;
};
struct testforty_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ testforty_state_write_uio(struct testforty_state *,
                                             struct ui *);
void testforty_state_print(void *context, struct ui *arg) {
  struct testforty_state *s = context;
  testforty_state_write_uio(s, arg);
}


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

x86 assembly (clang, -O2):
<testforty_state_print>:
jmp    1030 <testforty_state_write_uio@plt>

LLVM IR (-O0):
%struct.ui = type { i32 }
%struct.testforty_state = type { i32 }
define void @testforty_state_print(i8* %0, %struct.ui* %1) {
%3 = alloca i8*
%4 = alloca %struct.ui*
%5 = alloca %struct.testforty_state*
store i8* %0, i8** %3
store %struct.ui* %1, %struct.ui** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.testforty_state*
store %struct.testforty_state* %7, %struct.testforty_state** %5
%8 = load %struct.testforty_state*, %struct.testforty_state** %5
%9 = load %struct.ui*, %struct.ui** %4
%10 = call i32 @testforty_state_write_uio(%struct.testforty_state* %8, %struct.ui* %9)
ret void
}

LLVM IR (-O2):
%struct.ui = type { i32 }
%struct.testforty_state = type { i32 }
define void @testforty_state_print(i8* %0, %struct.ui* %1) {
%3 = bitcast i8* %0 to %struct.testforty_state*
%4 = tail call i32 @testforty_state_write_uio(%struct.testforty_state* %3, %struct.ui* %1)
ret void
}
char *strcpy(char *dest, const char *src) {
  return __builtin_strcpy(dest, src);
}


x86 assembly (clang, -O0):
<strcpy>:
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 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @strcpy(i8* nocapture readnone %0, i8* nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
OP(dd, fd) { op_fd(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_fd()
ret i32 undef
}
int f2(__attribute__((vector_size(16))) int t) { return ((int *)&t)[2]; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
movdqa %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
pshufd $0xee,%xmm0,%xmm0
movd   %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @f2(<4 x i32> %0) {
%2 = alloca <4 x i32>
store <4 x i32> %0, <4 x i32>* %2
%3 = bitcast <4 x i32>* %2 to i32*
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @f2(<4 x i32> %0) {
%2 = extractelement <4 x i32> %0, i64 2
ret i32 %2
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
wchar_t _DtCvChar(const void *p1, int type, int count) {
  wchar_t value = (wchar_t)-1;
  if (0 == type)
    value = *(((char *)p1) + count);
  else
    value = *(((wchar_t *)p1) + count);
  return (value);
}


x86 assembly (clang, -O0):
<_DtCvChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movb   $0xff,-0x11(%rbp)
xor    %eax,%eax
cmp    -0xc(%rbp),%eax
jne    1130 <_DtCvChar+0x30>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
jmp    113e <_DtCvChar+0x3e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_DtCvChar>:
movslq %edx,%rax
mov    (%rdi,%rax,1),%al
ret

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

LLVM IR (-O2):
define signext i8 @_DtCvChar(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void ADD_HOST_REG_W(int dst_reg, int src_reg) {
  addbyte(0x66);
  addbyte(0x01);
  addbyte(0xc0 | dst_reg | (src_reg << 3));
}


x86 assembly (clang, -O0):
<ADD_HOST_REG_W>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0x1,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
or     %eax,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADD_HOST_REG_W>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0x1,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @ADD_HOST_REG_W(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 1)
%7 = load i32, i32* %3
%8 = or i32 192, %7
%9 = load i32, i32* %4
%10 = shl i32 %9, 3
%11 = or i32 %8, %10
%12 = call i32 @addbyte(i32 %11)
ret void
}

LLVM IR (-O2):
define void @ADD_HOST_REG_W(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 1)
%5 = shl i32 %1, 3
%6 = or i32 %5, %0
%7 = or i32 %6, 192
%8 = tail call i32 @addbyte(i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_resource {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/);
void wl_output_send_mode(struct wl_resource *resource_, uint32_t flags,
                         int32_t width, int32_t height, int32_t refresh) {
  wl_resource_post_event(resource_, 1, flags, width, height, refresh);
}


x86 assembly (clang, -O0):
<wl_output_send_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    $0x1,%esi
call   1030 <wl_resource_post_event@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_output_send_mode>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_output_send_mode(%struct.wl_resource* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.wl_resource*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.wl_resource* %0, %struct.wl_resource** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.wl_resource*, %struct.wl_resource** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @wl_resource_post_event(%struct.wl_resource* %11, i32 1, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_output_send_mode(%struct.wl_resource* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 1, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
unsigned long mapkit_strhash(const char *string) {
  unsigned char c, *ustring = (unsigned char *)string;
  unsigned long hash = 5381;
  for (; (c = *ustring++);)
    hash = hash * 33 + c;
  return (hash + (hash >> 5));
}


x86 assembly (clang, -O0):
<mapkit_strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x1505,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     1149 <mapkit_strhash+0x49>
imul   $0x21,-0x20(%rbp),%rax
movzbl -0x9(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <mapkit_strhash+0x18>
mov    -0x20(%rbp),%rax
mov    -0x20(%rbp),%rcx
shr    $0x5,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapkit_strhash>:
mov    (%rdi),%al
test   %al,%al
je     112d <mapkit_strhash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%ecx
nop
mov    %rcx,%rdx
shl    $0x5,%rdx
add    %rcx,%rdx
movzbl %al,%ecx
add    %rdx,%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <mapkit_strhash+0x10>
jmp    1132 <mapkit_strhash+0x32>
mov    $0x1505,%ecx
mov    %rcx,%rax
shr    $0x5,%rax
add    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @mapkit_strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = mul i64 %6, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
%16 = lshr i64 %15, 5
%17 = add i64 %16, %15
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void udp_close(int sockfd) { close(sockfd); }


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

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

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

LLVM IR (-O2):
define void @udp_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void XkbFreeGeomColors() {}


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

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

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

LLVM IR (-O2):
define void @XkbFreeGeomColors() {
ret void
}
/* Variables and functions */
scalar_t__ strings_is_empty(char *);
bool strings_is_null_or_empty(char *string) {
  return string == NULL || strings_is_empty(string);
}


x86 assembly (clang, -O0):
<strings_is_null_or_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113f <strings_is_null_or_empty+0x2f>
mov    -0x8(%rbp),%rdi
call   1030 <strings_is_empty@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strings_is_null_or_empty>:
test   %rdi,%rdi
je     112b <strings_is_null_or_empty+0x1b>
push   %rax
call   1030 <strings_is_empty@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @strings_is_null_or_empty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strings_is_empty(i8* %6)
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ true, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @strings_is_null_or_empty(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strings_is_empty(i8* %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
void av_gettime() {}


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

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

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

LLVM IR (-O2):
define void @av_gettime() {
ret void
}
int C_Utils_compare_float(const float item1, const float item2) {
  if (item1 == item2)
    return 0;
  return item1 < item2 ? -1 : 1;
}


x86 assembly (clang, -O0):
<C_Utils_compare_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    112f <C_Utils_compare_float+0x2f>
jp     112f <C_Utils_compare_float+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    114c <C_Utils_compare_float+0x4c>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomiss %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_compare_float>:
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
setbe  %cl
xor    %eax,%eax
ucomiss %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @C_Utils_compare_float(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp oeq float %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %16
10: ; preds = %2
%11 = load float, float* %4
%12 = load float, float* %5
%13 = fcmp olt float %11, %12
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 -1, i32 1
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @C_Utils_compare_float(float %0, float %1) {
%3 = fcmp oeq float %0, %1
%4 = fcmp olt float %0, %1
%5 = select i1 %4, i32 -1, i32 1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
/* Type definitions */
struct group {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ StubBug(char *);
struct group *getgrnam(const char *name) {
  (void)name;
  StubBug("STUB:"
          "getgrnam");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.group = type { i32 }
@.str = [14 x i8] c"STUB:getgrnam\00"
define %struct.group* @getgrnam(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @StubBug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret %struct.group* null
}

LLVM IR (-O2):
%struct.group = type { i32 }
@.str = [14 x i8] c"STUB:getgrnam\00"
define noalias %struct.group* @getgrnam(i8* nocapture readnone %0) {
%2 = tail call i32 @StubBug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret %struct.group* null
}
void send_int(char **pp, unsigned int value) {
  unsigned char *b = (unsigned char *)*pp;
  b[0] = (value >> 24) & 0xff;
  b[1] = (value >> 16) & 0xff;
  b[2] = (value >> 8) & 0xff;
  b[3] = (value & 0xFF);
  *pp += 4;
}


x86 assembly (clang, -O0):
<send_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_int>:
mov    (%rdi),%rax
bswap  %esi
mov    %esi,(%rax)
addq   $0x4,(%rdi)
ret

LLVM IR (-O0):
define void @send_int(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i8*
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i32, i32* %4
%9 = lshr i32 %8, 24
%10 = and i32 %9, 255
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i32, i32* %4
%15 = lshr i32 %14, 16
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
%20 = load i32, i32* %4
%21 = lshr i32 %20, 8
%22 = and i32 %21, 255
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i64 2
store i8 %23, i8* %25
%26 = load i32, i32* %4
%27 = and i32 %26, 255
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i64 3
store i8 %28, i8* %30
%31 = load i8**, i8*** %3
%32 = load i8*, i8** %31
%33 = getelementptr inbounds i8, i8* %32, i64 4
store i8* %33, i8** %31
ret void
}

LLVM IR (-O2):
define void @send_int(i8** nocapture %0, i32 %1) {
%3 = load i8*, i8** %0
%4 = lshr i32 %1, 24
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = lshr i32 %1, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %1, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %3, i64 2
store i8 %10, i8* %11
%12 = trunc i32 %1 to i8
%13 = getelementptr inbounds i8, i8* %3, i64 3
store i8 %12, i8* %13
%14 = load i8*, i8** %0
%15 = getelementptr inbounds i8, i8* %14, i64 4
store i8* %15, i8** %0
ret void
}
void outb(unsigned char value, unsigned short port) {
  __asm__ __volatile__("outb %0, %1" : : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    -0x4(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outb(i8 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outb $0, $1", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 %1)
ret void
}
int main() {
  const char *s = "8"
                  "8";
  if (s[0] != '8' || s[1] != '8')
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x38,%eax
jne    114b <main+0x3b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x38,%eax
je     1150 <main+0x40>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"88\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 56
br i1 %7, label %14, label %8
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 56
br i1 %13, label %14, label %15
14: ; preds = %8, %0
unreachable
15: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ syserror(char *, char *, int);
int vl_open(const char *dev_name, char *error_text, int text_len) {
  int dev = open(dev_name, O_RDWR);
  if (dev < 0) {
    syserror("Could not open vloopback device", error_text, text_len);
    return -1;
  }
  return dev;
}


x86 assembly (clang, -O0):
<vl_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jge    1171 <vl_open+0x51>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1030 <syserror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1177 <vl_open+0x57>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vl_open>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
test   %eax,%eax
jns    1150 <vl_open+0x30>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <syserror@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@.str = [32 x i8] c"Could not open vloopback device\00"
define i32 @vl_open(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i8*, i8** %5
%10 = load i32, i32* @O_RDWR
%11 = call i32 @open(i8* %9, i32 %10)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %3
%15 = load i8*, i8** %6
%16 = load i32, i32* %7
%17 = call i32 @syserror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %15, i32 %16)
store i32 -1, i32* %4
br label %20
18: ; preds = %3
%19 = load i32, i32* %8
store i32 %19, i32* %4
br label %20
20: ; preds = %18, %14
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@.str = [32 x i8] c"Could not open vloopback device\00"
define i32 @vl_open(i8* nocapture %0, i8* %1, i32 %2) {
%4 = load i32, i32* @O_RDWR
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @syserror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ -1, %7 ], [ %5, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int time_msec(time_t t) { return t % 1000; }


x86 assembly (clang, -O0):
<time_msec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_msec>:
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @time_msec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 1000
ret i32 %4
}

LLVM IR (-O2):
define i32 @time_msec(i32 %0) {
%2 = srem i32 %0, 1000
ret i32 %2
}
/* Variables and functions */
long double __qnint(long double);
long double intr_wrap_405(long double p1) { return __qnint(p1); }


x86 assembly (clang, -O0):
<intr_wrap_405>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qnint@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_405>:
jmp    1030 <__qnint@plt>

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

LLVM IR (-O2):
define x86_fp80 @intr_wrap_405(x86_fp80 %0) {
%2 = tail call x86_fp80 @__qnint(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ show_help_string();
int main(int argc, char **argv) {
  show_help_string();
  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 <show_help_string@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <show_help_string@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 (...) @show_help_string()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @show_help_string()
ret i32 0
}
void NV12ToRGB24Row_NEON() {}


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

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

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

LLVM IR (-O2):
define void @NV12ToRGB24Row_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char s[16];
  printf("s: ");
  scanf("%s", s);
  printf("s: %s\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"s: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [7 x i8] c"s: %s\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"s: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [7 x i8] c"s: %s\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
int roi_get_sensor_response_bump_l(char *buff) { return buff[0] & 0x02; }


x86 assembly (clang, -O0):
<roi_get_sensor_response_bump_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roi_get_sensor_response_bump_l>:
movzbl (%rdi),%eax
and    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @roi_get_sensor_response_bump_l(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = and i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
define i32 @roi_get_sensor_response_bump_l(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 2
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printDiffTimer(long);
void report(long usecs) { printDiffTimer(usecs); }


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

x86 assembly (clang, -O2):
<report>:
jmp    1030 <printDiffTimer@plt>

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

LLVM IR (-O2):
define void @report(i64 %0) {
%2 = tail call i32 @printDiffTimer(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long const);
void handle_number(unsigned long int const i) { (void)printf("%lu\n", i); }


x86 assembly (clang, -O0):
<handle_number>:
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):
<handle_number>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define void @handle_number(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
unsigned long inl(unsigned short port) {
  unsigned long ret;
  asm volatile("inl %%dx, %%eax" : "=a"(ret) : "dN"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl>:
mov    %edi,%edx
in     (%dx),%eax
ret

LLVM IR (-O0):
define i64 @inl(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i64
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i64 asm sideeffect "inl %dx, %eax", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @inl(i16 zeroext %0) {
%2 = tail call i64 asm sideeffect "inl %dx, %eax", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i64 %2
}
__attribute__((always_)) unsigned char inb_p(unsigned short port) {
  unsigned char _v;
  asm volatile("in"
               "b"
               " %"
               "w"
               "1,%"
               ""
               "0"
               : "=a"(_v)
               : "Nd"(port));
  slow_down_io();
  return _v;
}


x86 assembly (clang, -O0):
<inb_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
mov    $0x0,%al
call   1030 <slow_down_io@plt>
movzbl -0x3(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb_p>:
push   %rbx
mov    %edi,%edx
in     (%dx),%al
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <slow_down_io@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @inb_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = call i32 (...) @slow_down_io()
%7 = load i8, i8* %3
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @inb_p(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
%3 = tail call i32 (...) @slow_down_io()
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ kannotate_write(char *, scalar_t__);
scalar_t__ strlen(char *);
void gator_annotate(char *string) {
  kannotate_write(string, strlen(string) + 1);
}


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

x86 assembly (clang, -O2):
<gator_annotate>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <kannotate_write@plt>

LLVM IR (-O0):
define void @gator_annotate(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i32 @kannotate_write(i8* %3, i64 %6)
ret void
}

LLVM IR (-O2):
define void @gator_annotate(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i32 @kannotate_write(i8* %0, i64 %3)
ret void
}
umatch(s, p) char *s, *p;
{
  if (*p == 0)
    return (1);
  while (*s)
    if (amatch(s++, p))
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<umatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113c <umatch+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1189 <umatch+0x79>
jmp    1141 <umatch+0x31>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1182 <umatch+0x72>
mov    -0x10(%rbp),%rdi
mov    %rdi,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <amatch@plt>
cmp    $0x0,%eax
je     117d <umatch+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    1189 <umatch+0x79>
jmp    1141 <umatch+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umatch>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%r14d
cmpb   $0x0,(%rsi)
je     114f <umatch+0x3f>
mov    %rsi,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi)
je     114c <umatch+0x3c>
lea    0x1(%rdi),%rbp
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <amatch@plt>
mov    %rbp,%rdi
test   %eax,%eax
je     1130 <umatch+0x20>
jmp    114f <umatch+0x3f>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @umatch(i8* %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i8* [ %10, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @amatch to i32 (i8*, i8*, ...)*)(i8* %6, i8* %1)
%12 = icmp eq i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %5, %9, %2
%14 = phi i32 [ 1, %2 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %14
}