xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SPIM_DisableRxInt();
int /*<<< orphan*/ SPIM_DisableTxInt();
void SPIM_DisableInt(void) {
  SPIM_DisableTxInt();
  SPIM_DisableRxInt();
}


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

x86 assembly (clang, -O2):
<SPIM_DisableInt>:
push   %rax
xor    %eax,%eax
call   1040 <SPIM_DisableTxInt@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <SPIM_DisableRxInt@plt>

LLVM IR (-O0):
define void @SPIM_DisableInt() {
%1 = call i32 (...) @SPIM_DisableTxInt()
%2 = call i32 (...) @SPIM_DisableRxInt()
ret void
}

LLVM IR (-O2):
define void @SPIM_DisableInt() {
%1 = tail call i32 (...) @SPIM_DisableTxInt()
%2 = tail call i32 (...) @SPIM_DisableRxInt()
ret void
}
/* Variables and functions */
size_t lcm(size_t const, size_t const);
int size_lcm(size_t *z, const size_t x, const size_t y) {
  size_t cm;
  cm = lcm(x, y);
  if (z != NULL) {
    *z = cm;
  }
  return 0;
}


x86 assembly (clang, -O0):
<size_lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <lcm@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <size_lcm+0x3b>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_lcm>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <lcm@plt>
test   %rbx,%rbx
je     1127 <size_lcm+0x17>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @size_lcm(i64* writeonly %0, i64 %1, i64 %2) {
%4 = tail call i64 @lcm(i64 %1, i64 %2)
%5 = icmp eq i64* %0, null
br i1 %5, label %7, label %6
6: ; preds = %3
store i64 %4, i64* %0
br label %7
7: ; preds = %6, %3
ret i32 0
}
void g_iconv_open() {}


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

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

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

LLVM IR (-O2):
define void @g_iconv_open() {
ret void
}
void foo731() {}


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

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

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

LLVM IR (-O2):
define void @foo731() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int mean(int *, int, int *);
void test_negative_size(void) {
  int arr[] = {2, 2, 1};
  int res;
  assert((mean(arr, -1, &res) == 2));
}


x86 assembly (clang, -O0):
<test_negative_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0xffffffff,%esi
lea    -0x10(%rbp),%rdx
call   1040 <mean@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_negative_size>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x14(%rsp),%rdx
mov    $0xffffffff,%esi
call   1040 <mean@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1030 <assert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_negative_size.arr = [3 x i32] [i32 2, i32 2, i32 1]
define void @test_negative_size() {
%1 = alloca [3 x i32]
%2 = alloca i32
%3 = bitcast [3 x i32]* %1 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%5 = call i32 @mean(i32* %4, i32 -1, i32* %2)
%6 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret void
}

LLVM IR (-O2):
@__const.test_negative_size.arr = [3 x i32] [i32 2, i32 2, i32 1]
define void @test_negative_size() {
%1 = alloca [3 x i32]
%2 = alloca i32
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = call i32 @mean(i32* %5, i32 -1, i32* %2)
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_adds_epu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_adds_epu8(__m128i A, __m128i B) { return _mm_adds_epu8(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_adds_epu8>:
jmp    1030 <_mm_adds_epu8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_adds_epu8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_adds_epu8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int vmwLoadPCX(int /*<<< orphan*/);
int main(int argc, char **argv) {
  int result;
  result = vmwLoadPCX(fileno(stdin));
  if (result < 0) {
    fprintf(stderr, "Error reading PCX from stdin\n");
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <fileno@plt>
mov    %eax,%edi
call   1050 <vmwLoadPCX@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1197 <main+0x57>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
lea    0xe78(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fileno@plt>
mov    %eax,%edi
call   1050 <vmwLoadPCX@plt>
test   %eax,%eax
js     115e <main+0x1e>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
@stderr = global i32 0
@.str = [30 x i8] c"Error reading PCX from stdin\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @stdin
%8 = call i32 @fileno(i32 %7)
%9 = call i32 @vmwLoadPCX(i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@stderr = global i32 0
@.str = [30 x i8] c"Error reading PCX from stdin\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @fileno(i32 %3)
%5 = tail call i32 @vmwLoadPCX(i32 %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret i32 0
}
int foo(int *x) { return *x; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
void ScaleColsUp2_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleColsUp2_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_compiled_expresions();
void destroy(void) {
  free_compiled_expresions();
  return;
}


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

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

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

LLVM IR (-O2):
define void @destroy() {
%1 = tail call i32 (...) @free_compiled_expresions()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void handler_not_implemented(char *type) {
  printf("Handler %s defined but not implemented\r\n", type);
}


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

LLVM IR (-O0):
@.str = [41 x i8] c"Handler %s defined but not implemented\0D\0A\00"
define void @handler_not_implemented(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Handler %s defined but not implemented\0D\0A\00"
define void @handler_not_implemented(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void init_add_pixel_color_span_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_add_pixel_color_span_funcs_c() {
ret void
}
void pop_front_imp() {}


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

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

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

LLVM IR (-O2):
define void @pop_front_imp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmx_nmens(int, char **);
int main(int argc, char *argv[]) {
  gmx_nmens(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_nmens@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <gmx_nmens@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @gmx_nmens(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_nmens(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int /*<<< orphan*/);
void C67_LDDW_PTR(int r, int r2) { C67_asm("LDDW.D *", r, r2, 0); }


x86 assembly (clang, -O0):
<C67_LDDW_PTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
xor    %ecx,%ecx
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_LDDW_PTR>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %ecx,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"LDDW.D *\00"
define void @C67_LDDW_PTR(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @C67_asm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"LDDW.D *\00"
define void @C67_LDDW_PTR(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ resolve(int, int);
int prox(int linha, int coluna) {
  if (coluna <= 7) {
    resolve(linha, coluna + 1);
  } else {
    resolve(linha + 1, 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<prox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
jg     113b <prox+0x2b>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
call   1030 <resolve@plt>
jmp    1148 <prox+0x38>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
xor    %esi,%esi
call   1030 <resolve@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prox>:
push   %rax
lea    0x1(%rsi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    $0x8,%esi
setge  %dl
cmovge %ecx,%eax
add    %edx,%edi
mov    %eax,%esi
call   1030 <resolve@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @prox(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 8
%4 = add nsw i32 %1, 1
%5 = select i1 %3, i32 %4, i32 0
%6 = xor i1 %3, true
%7 = zext i1 %6 to i32
%8 = add nsw i32 %7, %0
%9 = tail call i32 @resolve(i32 %8, i32 %5)
ret i32 0
}
/* Variables and functions */
int access(char const *, int const);
int unix_accessfcn(const char *path, const int amode) {
  int err = access(path, amode);
  return err;
}


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

x86 assembly (clang, -O2):
<unix_accessfcn>:
jmp    1030 <access@plt>

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

LLVM IR (-O2):
define i32 @unix_accessfcn(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @access(i8* %0, i32 %1)
ret i32 %3
}
char *index(const char *s, int c) {
  if (s) {
    for (; *s; s++) {
      if (*s == c)
        return ((char *)s);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1160 <index+0x60>
jmp    111b <index+0x1b>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <index+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1145 <index+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <index+0x68>
jmp    114a <index+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111b <index+0x1b>
jmp    1160 <index+0x60>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index>:
test   %rdi,%rdi
je     1123 <index+0x23>
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <index+0x23>
xchg   %ax,%ax
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <index+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <index+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @index(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %4, %12
%8 = phi i8 [ %14, %12 ], [ %5, %4 ]
%9 = phi i8* [ %13, %12 ], [ %0, %4 ]
%10 = sext i8 %8 to i32
%11 = icmp eq i32 %10, %1
br i1 %11, label %16, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %9, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %12, %4, %2
%17 = phi i8* [ null, %2 ], [ null, %4 ], [ %9, %7 ], [ null, %12 ]
ret i8* %17
}
abs(i) { return (i < 0 ? -i : i); }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *,
                                          int /*<<< orphan*/, char const *);
void wl_data_source_send_target(struct wl_resource *resource_,
                                const char *mime_type) {
  wl_resource_post_event(resource_, 0, mime_type);
}


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

x86 assembly (clang, -O2):
<wl_data_source_send_target>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <wl_resource_post_event@plt>

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

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_data_source_send_target(%struct.wl_resource* %0, i8* %1) {
%3 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, ...);
int /*<<< orphan*/ strcpy(char *, char const *);
void test_strcpy(char *s1, const char *s2) {
  printf("Copy '%s' into '%s': ", s2, s1);
  strcpy(s1, s2);
  printf("%s\n", s1);
}


x86 assembly (clang, -O0):
<test_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Copy '%s' into '%s': \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @test_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** %4
%6 = load i8*, i8** %3
%7 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Copy '%s' into '%s': \00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @test_strcpy(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
%4 = tail call i32 @strcpy(i8* %0, i8* %1)
%5 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int LISTCMD_FUNC() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @LISTCMD_FUNC() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert_equal_int(int, int, char *, char *);
int pl_startswith(char *, char *);
void test_startwith_empy_prefix() {
  char the_string[] = "http://bing.com";
  int ret_val = pl_startswith(the_string, "");
  assert_equal_int(-1, ret_val, "test_startwith_empy_prefix",
                   "The function did not return the correct error value.");
}


x86 assembly (clang, -O0):
<test_startwith_empy_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
lea    0xf16(%rip),%rsi
call   1030 <pl_startswith@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    $0xffffffff,%edi
lea    0xeb0(%rip),%rdx
lea    0xec4(%rip),%rcx
call   1040 <assert_equal_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_startwith_empy_prefix>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xf29(%rip),%rsi
mov    %rsp,%rdi
call   1030 <pl_startswith@plt>
lea    0xecb(%rip),%rdx
lea    0xedf(%rip),%rcx
mov    $0xffffffff,%edi
mov    %eax,%esi
call   1040 <assert_equal_int@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_startwith_empy_prefix.the_string = [16 x i8] c"http://bing.com\00"
@.str = [1 x i8] zeroinitializer
@.str.1 = [27 x i8] c"test_startwith_empy_prefix\00"
@.str.2 = [53 x i8] c"The function did not return the correct error value.\00"
define void @test_startwith_empy_prefix() {
%1 = alloca [16 x i8]
%2 = alloca i32
%3 = bitcast [16 x i8]* %1 to i8*
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%5 = call i32 @pl_startswith(i8* %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @assert_equal_int(i32 -1, i32 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.test_startwith_empy_prefix.the_string = [16 x i8] c"http://bing.com\00"
@.str = [1 x i8] zeroinitializer
@.str.1 = [27 x i8] c"test_startwith_empy_prefix\00"
@.str.2 = [53 x i8] c"The function did not return the correct error value.\00"
define void @test_startwith_empy_prefix() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @pl_startswith(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @assert_equal_int(i32 -1, i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct trans {
  int dummy;
};

/* Variables and functions */
int trans_listen_address(struct trans *, char *, char *);
int trans_listen(struct trans *self, char *port) {
  return trans_listen_address(self, port, "0.0.0.0");
}


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

x86 assembly (clang, -O2):
<trans_listen>:
lea    0xee9(%rip),%rdx
jmp    1030 <trans_listen_address@plt>

LLVM IR (-O0):
%struct.trans = type { i32 }
@.str = [8 x i8] c"0.0.0.0\00"
define i32 @trans_listen(%struct.trans* %0, i8* %1) {
%3 = alloca %struct.trans*
%4 = alloca i8*
store %struct.trans* %0, %struct.trans** %3
store i8* %1, i8** %4
%5 = load %struct.trans*, %struct.trans** %3
%6 = load i8*, i8** %4
%7 = call i32 @trans_listen_address(%struct.trans* %5, i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
%struct.trans = type { i32 }
@.str = [8 x i8] c"0.0.0.0\00"
define i32 @trans_listen(%struct.trans* %0, i8* %1) {
%3 = tail call i32 @trans_listen_address(%struct.trans* %0, i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ cntlen(int /*<<< orphan*/, void *);
void cntlensep(const char *p, void *ptr) {
  while (*p)
    cntlen(*p++, ptr);
}


x86 assembly (clang, -O0):
<cntlensep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <cntlensep+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <cntlen@plt>
jmp    1120 <cntlensep+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cntlensep>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1146 <cntlensep+0x36>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <cntlen@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <cntlensep+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @cntlensep(i8* nocapture %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @cntlen(i32 %9, i8* %1)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
double sFibonacci_itr(double f) {
  double a = 1, b = 0, x = 0, c;
  while (x <= f) {
    c = a + b;
    b = a;
    a = c;
    x++;
  }
  return c;
}


x86 assembly (clang, -O0):
<sFibonacci_itr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1174 <sFibonacci_itr+0x74>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe9b(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1126 <sFibonacci_itr+0x26>
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sFibonacci_itr>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     113a <sFibonacci_itr+0x3a>
movsd  0xeee(%rip),%xmm3
xorpd  %xmm5,%xmm5
movapd %xmm3,%xmm4
nopw   0x0(%rax,%rax,1)
movapd %xmm5,%xmm1
addsd  %xmm4,%xmm1
addsd  %xmm3,%xmm2
ucomisd %xmm2,%xmm0
movapd %xmm4,%xmm5
movapd %xmm1,%xmm4
jae    1120 <sFibonacci_itr+0x20>
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sFibonacci_itr(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %2
store double 1.000000e+00, double* %3
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
br label %7
7: ; preds = %11, %1
%8 = load double, double* %5
%9 = load double, double* %2
%10 = fcmp ole double %8, %9
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load double, double* %3
%13 = load double, double* %4
%14 = fadd double %12, %13
store double %14, double* %6
%15 = load double, double* %3
store double %15, double* %4
%16 = load double, double* %6
store double %16, double* %3
%17 = load double, double* %5
%18 = fadd double %17, 1.000000e+00
store double %18, double* %5
br label %7
19: ; preds = %7
%20 = load double, double* %6
ret double %20
}

LLVM IR (-O2):
define double @sFibonacci_itr(double %0) {
%2 = fcmp ult double %0, 0.000000e+00
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi double [ %8, %3 ], [ 0.000000e+00, %1 ]
%5 = phi double [ %6, %3 ], [ 0.000000e+00, %1 ]
%6 = phi double [ %7, %3 ], [ 1.000000e+00, %1 ]
%7 = fadd double %6, %5
%8 = fadd double %4, 1.000000e+00
%9 = fcmp ugt double %8, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi double [ undef, %1 ], [ %7, %3 ]
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ eembed_str_to_u64(char const *, char **, int);
uint64_t eembed_str_to_ulong(const char *str, char **endptr) {
  int base10 = 10;
  return eembed_str_to_u64(str, endptr, base10);
}


x86 assembly (clang, -O0):
<eembed_str_to_ulong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <eembed_str_to_u64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eembed_str_to_ulong>:
mov    $0xa,%edx
jmp    1030 <eembed_str_to_u64@plt>

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

LLVM IR (-O2):
define i32 @eembed_str_to_ulong(i8* %0, i8** %1) {
%3 = tail call i32 @eembed_str_to_u64(i8* %0, i8** %1, i32 10)
ret i32 %3
}
int j(int *x, int y) { return *x + y; }


x86 assembly (clang, -O0):
<j>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<j>:
mov    %esi,%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @j(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @j(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, %1
ret i32 %4
}
void cealtesthook_input_iter_change() {}


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

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

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

LLVM IR (-O2):
define void @cealtesthook_input_iter_change() {
ret void
}
void __attribute__((weak)) can1_sce_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<can1_sce_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<can1_sce_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

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

LLVM IR (-O2):
@__FUNCTION__.can1_sce_isr = [13 x i8] c"can1_sce_isr\00"
define weak void @can1_sce_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.can1_sce_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteIndexedXX1(int);
int /*<<< orphan*/ STZ8(int /*<<< orphan*/);
void Op9EM1X1(void) { STZ8(AbsoluteIndexedXX1(2)); }


x86 assembly (clang, -O0):
<Op9EM1X1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <AbsoluteIndexedXX1@plt>
mov    %eax,%edi
call   1030 <STZ8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op9EM1X1>:
push   %rax
mov    $0x2,%edi
call   1040 <AbsoluteIndexedXX1@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <STZ8@plt>

LLVM IR (-O0):
define void @Op9EM1X1() {
%1 = call i32 @AbsoluteIndexedXX1(i32 2)
%2 = call i32 @STZ8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op9EM1X1() {
%1 = tail call i32 @AbsoluteIndexedXX1(i32 2)
%2 = tail call i32 @STZ8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glColor3dv(double *);
void Color3dv(double v[3]) { glColor3dv(v); }


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

x86 assembly (clang, -O2):
<Color3dv>:
jmp    1030 <glColor3dv@plt>

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

LLVM IR (-O2):
define void @Color3dv(double* %0) {
%2 = tail call i32 @glColor3dv(double* %0)
ret void
}
void XSecurityAllocXauth() {}


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

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

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

LLVM IR (-O2):
define void @XSecurityAllocXauth() {
ret void
}
/* Variables and functions */
unsigned short dxl_read_word(unsigned char, int);
unsigned short getCWAngleLimit(unsigned char id) {
  return dxl_read_word(id, (6));
}


x86 assembly (clang, -O0):
<getCWAngleLimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x6,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_word@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCWAngleLimit>:
mov    $0x6,%esi
jmp    1030 <dxl_read_word@plt>

LLVM IR (-O0):
define zeroext i16 @getCWAngleLimit(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i16 @dxl_read_word(i8 zeroext %3, i32 6)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @getCWAngleLimit(i8 zeroext %0) {
%2 = tail call zeroext i16 @dxl_read_word(i8 zeroext %0, i32 6)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, long *, long *);
long sum(long, long);
int main(void) {
  long a, b, c;
  printf("Enter two ints\n");
  scanf("%ld%ld", &a, &b);
  c = sum(a, b);
  printf("The sum is %ld\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <sum@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1060 <scanf@plt>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1050 <sum@plt>
lea    0xe8b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter two ints\0A\00"
@.str.1 = [7 x i8] c"%ld%ld\00"
@.str.2 = [16 x i8] c"The sum is %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64* %2, i64* %3)
%7 = load i64, i64* %2
%8 = load i64, i64* %3
%9 = call i64 @sum(i64 %7, i64 %8)
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i64 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%ld%ld\00"
@.str.2 = [16 x i8] c"The sum is %ld\0A\00"
@str = [15 x i8] c"Enter two ints\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64* %1, i64* %2)
%7 = load i64, i64* %1
%8 = load i64, i64* %2
%9 = call i64 @sum(i64 %7, i64 %8)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i64 %9)
ret i32 0
}
/* Variables and functions */
int *malloc(int);
int *mistake4() {
  int *buf = malloc(sizeof(char) * 4);
  buf[0] = 4;
  return buf;
}


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

x86 assembly (clang, -O2):
<mistake4>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0x4,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i32* @mistake4() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 4)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 4, i32* %4
%5 = load i32*, i32** %1
ret i32* %5
}

LLVM IR (-O2):
define noalias i32* @mistake4() {
%1 = tail call i32* @malloc(i32 4)
store i32 4, i32* %1
ret i32* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
scalar_t__ isspace(int);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
bool skip_spaces(FILE *f) {
  int c;
  while (isspace(c = fgetc(f)) && c != EOF)
    ;
  ungetc(c, f);
  return true;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%edi
mov    %edi,-0xc(%rbp)
call   1040 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xd(%rbp)
je     1173 <skip_spaces+0x43>
mov    -0xc(%rbp),%eax
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1183 <skip_spaces+0x53>
jmp    1188 <skip_spaces+0x58>
jmp    113c <skip_spaces+0xc>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1050 <ungetc@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eaa(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <isspace@plt>
test   %rax,%rax
je     115b <skip_spaces+0x2b>
cmp    (%r14),%ebp
jne    1140 <skip_spaces+0x10>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <ungetc@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @skip_spaces(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %15, %1
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %3
%7 = call i64 @isspace(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = load i32, i32* %3
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br label %13
13: ; preds = %9, %4
%14 = phi i1 [ false, %4 ], [ %12, %9 ]
br i1 %14, label %15, label %16
15: ; preds = %13
br label %4
16: ; preds = %13
%17 = load i32, i32* %3
%18 = load i32*, i32** %2
%19 = call i32 @ungetc(i32 %17, i32* %18)
ret i32 1
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @skip_spaces(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = tail call i64 @isspace(i32 %3)
%5 = icmp ne i64 %4, 0
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %3, %6
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %2, label %9
9: ; preds = %2
%10 = tail call i32 @ungetc(i32 %3, i32* %0)
ret i32 1
}
int test_imm_BAuint16_reg(unsigned short val) {
  return ((val) & (-0xBA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_BAuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -186
%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_BAuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -186
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cintern(char *);
int /*<<< orphan*/ setvar(int /*<<< orphan*/, int /*<<< orphan*/, struct obj *);
void init_sql_oracle_version(void) {
  setvar(cintern("*sql_oracle-version*"),
         cintern("$Id: sql_oracle.c,v 1.2 2000/04/26 14:43:39 gjcarret Exp "
                 "gjcarret $"),
         ((struct obj *)0));
}


x86 assembly (clang, -O0):
<init_sql_oracle_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,-0x4(%rbp)
lea    0xed7(%rip),%rdi
call   1040 <cintern@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <setvar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_sql_oracle_version>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,%ebx
lea    0xedf(%rip),%rdi
call   1040 <cintern@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <setvar@plt>

LLVM IR (-O0):
%struct.obj = type { i32 }
@.str = [21 x i8] c"*sql_oracle-version*\00"
@.str.1 = [68 x i8] c"$Id: sql_oracle.c,v 1.2 2000/04/26 14:43:39 gjcarret Exp gjcarret $\00"
define void @init_sql_oracle_version() {
%1 = call i32 @cintern(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cintern(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}

LLVM IR (-O2):
%struct.obj = type { i32 }
@.str = [21 x i8] c"*sql_oracle-version*\00"
@.str.1 = [68 x i8] c"$Id: sql_oracle.c,v 1.2 2000/04/26 14:43:39 gjcarret Exp gjcarret $\00"
define void @init_sql_oracle_version() {
%1 = tail call i32 @cintern(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cintern(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}
void print_long_double(struct printf_format *format, long double data) {}


x86 assembly (clang, -O0):
<print_long_double>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.printf_format = type opaque
define void @print_long_double(%struct.printf_format* %0, x86_fp80 %1) {
%3 = alloca %struct.printf_format*
%4 = alloca x86_fp80
store %struct.printf_format* %0, %struct.printf_format** %3
store x86_fp80 %1, x86_fp80* %4
ret void
}

LLVM IR (-O2):
%struct.printf_format = type opaque
define void @print_long_double(%struct.printf_format* nocapture %0, x86_fp80 %1) {
ret void
}
long long unsigned ticks_to_milliseconds(const long long unsigned ticks) {
  return ticks / (1900000000ULL / 1000ULL);
}


x86 assembly (clang, -O0):
<ticks_to_milliseconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x1cfde0,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ticks_to_milliseconds>:
mov    %rdi,%rax
movabs $0x11a904a92b4ae57d,%rcx
04 a9 11
mul    %rcx
mov    %rdx,%rax
shr    $0x11,%rax
ret

LLVM IR (-O0):
define i64 @ticks_to_milliseconds(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = udiv i64 %3, 1900000
ret i64 %4
}

LLVM IR (-O2):
define i64 @ticks_to_milliseconds(i64 %0) {
%2 = udiv i64 %0, 1900000
ret i64 %2
}