xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_prebuf_active() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_prebuf_active"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"NOT IMPLEMENTED:pa_memblockq_prebuf_active\0A\00"
define i32 @pa_memblockq_prebuf_active() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [43 x i8] c"NOT IMPLEMENTED:pa_memblockq_prebuf_active\00"
define i32 @pa_memblockq_prebuf_active() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint8_t fn_19_c(uint64_t a1, uint8_t a2) {
  if (!(a1 == 158887773995008)) {
    goto bad;
  }
  if (!(a2 == 186)) {
    goto bad;
  }
  return 113;
bad:
  return 241;
}


x86 assembly (clang, -O0):
<fn_19_c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0x8(%rbp),%rax
movabs $0x9081f1540000,%rcx
cmp    %rcx,%rax
je     1126 <fn_19_c+0x26>
jmp    1144 <fn_19_c+0x44>
cmpl   $0xba,-0xc(%rbp)
je     1138 <fn_19_c+0x38>
jmp    1144 <fn_19_c+0x44>
movl   $0x71,-0x4(%rbp)
jmp    114b <fn_19_c+0x4b>
movl   $0xf1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn_19_c(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 158887773995008
br i1 %8, label %10, label %9
9: ; preds = %2
br label %15
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 186
br i1 %12, label %14, label %13
13: ; preds = %10
br label %15
14: ; preds = %10
store i32 113, i32* %3
br label %16
15: ; preds = %13, %9
store i32 241, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @fn_19_c(i32 %0, i32 %1) {
ret i32 241
}
void gdk_x11_xatom_to_atom() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_xatom_to_atom() {
ret void
}
int xmlDummyCompare(const void *data0 __attribute__((unused)),
                    const void *data1 __attribute__((unused))) {
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @xmlDummyCompare(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int);
int path_matches(const char *full_path, const char *prefix) {
  int len = strlen(prefix);
  if (0 != strncmp(full_path, prefix, len))
    return 0;
  return len + 1;
}


x86 assembly (clang, -O0):
<path_matches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1166 <path_matches+0x46>
movl   $0x0,-0x4(%rbp)
jmp    116f <path_matches+0x4f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_matches>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
add    $0x1,%ebp
xor    %ecx,%ecx
test   %rax,%rax
cmove  %ebp,%ecx
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @path_matches(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = add nsw i32 %3, 1
%7 = select i1 %5, i32 %6, i32 0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ GPIO_write_SS(int);
int /*<<< orphan*/ s_SPI_delay(int);
void SPI_stop_transaction(void) {
  (GPIO_write_SS(1));
  s_SPI_delay(1);
}


x86 assembly (clang, -O0):
<SPI_stop_transaction>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <GPIO_write_SS@plt>
mov    $0x1,%edi
call   1040 <s_SPI_delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_stop_transaction>:
push   %rax
mov    $0x1,%edi
call   1030 <GPIO_write_SS@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <s_SPI_delay@plt>

LLVM IR (-O0):
define void @SPI_stop_transaction() {
%1 = call i32 @GPIO_write_SS(i32 1)
%2 = call i32 @s_SPI_delay(i32 1)
ret void
}

LLVM IR (-O2):
define void @SPI_stop_transaction() {
%1 = tail call i32 @GPIO_write_SS(i32 1)
%2 = tail call i32 @s_SPI_delay(i32 1)
ret void
}
int cuarta(int n) { return n * n * n * n; }


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

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

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

LLVM IR (-O2):
define i32 @cuarta(i32 %0) {
%2 = mul i32 %0, %0
%3 = mul i32 %2, %2
ret i32 %3
}
/* Variables and functions */
int longestValidParentheses(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", longestValidParentheses("()(()"));
  printf("%d\n", longestValidParentheses(
                     "(()))))(((((((()))))))))()()()()()()()()()()()())()"));
  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)
lea    0xec7(%rip),%rdi
call   1040 <longestValidParentheses@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
call   1040 <longestValidParentheses@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xedc(%rip),%rdi
call   1040 <longestValidParentheses@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
call   1040 <longestValidParentheses@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"()(()\00"
@.str.2 = [52 x i8] c"(()))))(((((((()))))))))()()()()()()()()()()()())()\00"
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 @longestValidParentheses(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @longestValidParentheses(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"()(()\00"
@.str.2 = [52 x i8] c"(()))))(((((((()))))))))()()()()()()()()()()()())()\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @longestValidParentheses(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @longestValidParentheses(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBDevDisconnect(uint32_t ui32Base) {
  ;
  (*((volatile uint8_t *)(ui32Base + 0x00000001))) &= (~0x00000040);
}


x86 assembly (clang, -O0):
<USBDevDisconnect>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%ecx
and    $0xffffffbf,%ecx
mov    %ecx,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBDevDisconnect>:
andl   $0xffffffbf,0x1(%rdi)
ret

LLVM IR (-O0):
define void @USBDevDisconnect(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -65
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @USBDevDisconnect(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = and i32 %4, -65
store volatile i32 %5, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *check_malloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr) {
    fprintf(stderr, "check_malloc: out of memory! (fatal)\n");
    exit(-1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<check_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <check_malloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <check_malloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"check_malloc: out of memory! (fatal)\0A\00"
define i8* @check_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"check_malloc: out of memory! (fatal)\0A\00"
define noalias i8* @check_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int iscntrl(int);
int is_http_ctl(int c) { return iscntrl(c); }


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

x86 assembly (clang, -O2):
<is_http_ctl>:
jmp    1030 <iscntrl@plt>

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

LLVM IR (-O2):
define i32 @is_http_ctl(i32 %0) {
%2 = tail call i32 @iscntrl(i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ __getcpu(unsigned int *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int sched_getcpu(void) {
  unsigned cpu;
  if (__getcpu(&cpu, NULL, NULL) < 0)
    return 0;
  return (int)cpu;
}


x86 assembly (clang, -O0):
<sched_getcpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <__getcpu@plt>
cmp    $0x0,%rax
jge    113e <sched_getcpu+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1144 <sched_getcpu+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_getcpu>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
lea    0xc(%rsp),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <__getcpu@plt>
test   %rax,%rax
js     112e <sched_getcpu+0x1e>
mov    0xc(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sched_getcpu() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 @__getcpu(i32* %2, i32* null, i32* null)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @sched_getcpu() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @__getcpu(i32* %1, i32* null, i32* null)
%4 = icmp slt i64 %3, 0
%5 = load i32, i32* %1
%6 = select i1 %4, i32 0, i32 %5
ret i32 %6
}
__typeof__(strcmp(1, "")) test_strcmp_182(void) { return strcmp(1, ""); }


x86 assembly (clang, -O0):
<test_strcmp_182>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rsi
mov    $0x1,%edi
call   1030 <strcmp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strcmp_182>:
movzbl 0x1,%eax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_strcmp_182() {
%1 = call i32 @strcmp(i8* inttoptr (i64 1 to i8*), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_strcmp_182() {
%1 = load i8, i8* inttoptr (i64 1 to i8*)
%2 = zext i8 %1 to i32
ret i32 %2
}
unsigned long long foo(unsigned short a, unsigned short *b, unsigned short *c) {
  return (unsigned)a + (unsigned long long)*b * (unsigned long long)*c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movzwl -0x2(%rbp),%eax
mov    %eax,%eax
mov    -0x10(%rbp),%rcx
movzwl (%rcx),%ecx
mov    -0x18(%rbp),%rdx
movzwl (%rdx),%edx
imul   %rdx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%ecx
movzwl (%rsi),%esi
movzwl (%rdx),%eax
imul   %rsi,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @foo(i16 zeroext %0, i16* %1, i16* %2) {
%4 = alloca i16
%5 = alloca i16*
%6 = alloca i16*
store i16 %0, i16* %4
store i16* %1, i16** %5
store i16* %2, i16** %6
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = zext i32 %8 to i64
%10 = load i16*, i16** %5
%11 = load i16, i16* %10
%12 = zext i16 %11 to i64
%13 = load i16*, i16** %6
%14 = load i16, i16* %13
%15 = zext i16 %14 to i64
%16 = mul i64 %12, %15
%17 = add i64 %9, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @foo(i16 zeroext %0, i16* nocapture %1, i16* nocapture %2) {
%4 = zext i16 %0 to i64
%5 = load i16, i16* %1
%6 = zext i16 %5 to i64
%7 = load i16, i16* %2
%8 = zext i16 %7 to i64
%9 = mul nuw nsw i64 %8, %6
%10 = add nuw nsw i64 %9, %4
ret i64 %10
}
const char *Float_Brief(void) { return "Floating Point Object"; }


x86 assembly (clang, -O0):
<Float_Brief>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Float_Brief>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Floating Point Object\00"
define i8* @Float_Brief() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [22 x i8] c"Floating Point Object\00"
define i8* @Float_Brief() {
ret i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World\n");
  func1();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <func1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @func1()
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @func1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int /*<<< orphan*/);
int /*<<< orphan*/ print_result(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main() {
  malloc(0);
  print_result(stderr, "hello, world\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <malloc@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <print_result@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <malloc@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1030 <print_result@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"hello, world\0A\00"
define i32 @main() {
%1 = call i32 @malloc(i32 0)
%2 = load i32, i32* @stderr
%3 = call i32 @print_result(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"hello, world\0A\00"
define i32 @main() {
%1 = tail call i32 @malloc(i32 0)
%2 = load i32, i32* @stderr
%3 = tail call i32 @print_result(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void dummy() {
  int i = 0;
  ((void)0);
  ((void)0);
}


x86 assembly (clang, -O0):
<dummy>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dummy() {
ret void
}
/* Variables and functions */
void *cm(size_t);
void *c3(size_t n) { return cm(n); }


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

x86 assembly (clang, -O2):
<c3>:
jmp    1030 <cm@plt>

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

LLVM IR (-O2):
define i8* @c3(i64 %0) {
%2 = tail call i8* @cm(i64 %0)
ret i8* %2
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
long diff_time_ms(struct timeval *start, struct timeval *end) {
  return (1000000 * (end->tv_sec - start->tv_sec) + end->tv_usec -
          start->tv_usec) /
         1000;
}


x86 assembly (clang, -O0):
<diff_time_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
imul   $0xf4240,%eax,%eax
mov    -0x10(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x8(%rbp),%rcx
sub    0x4(%rcx),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff_time_ms>:
mov    (%rsi),%eax
sub    (%rdi),%eax
imul   $0xf4240,%eax,%eax
add    0x4(%rsi),%eax
sub    0x4(%rdi),%eax
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cltq
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @diff_time_ms(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 1000000, %11
%13 = load %struct.timeval*, %struct.timeval** %4
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = add nsw i32 %12, %15
%17 = load %struct.timeval*, %struct.timeval** %3
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
%19 = load i32, i32* %18
%20 = sub nsw i32 %16, %19
%21 = sdiv i32 %20, 1000
%22 = sext i32 %21 to i64
ret i64 %22
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @diff_time_ms(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%13 = load i32, i32* %12
%14 = sub i32 %11, %13
%15 = sdiv i32 %14, 1000
%16 = sext i32 %15 to i64
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) { printf("Usage: chmod [OPTION]... MODE[,MODE]... FILE...\n"); }


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [49 x i8] c"Usage: chmod [OPTION]... MODE[,MODE]... FILE...\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [48 x i8] c"Usage: chmod [OPTION]... MODE[,MODE]... FILE...\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret void
}
void mdp4_overlay_dsi_video_start(void) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_overlay_dsi_video_start() {
ret void
}
int c_abs(int in) {
  if (in > 0)
    return in;
  else
    return -in;
}


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

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

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

LLVM IR (-O2):
define i32 @c_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int si_code;
  int /*<<< orphan*/ si_addr;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
void sigtrap_handler(int signr, siginfo_t *info, void *unused) {
  printf("SIGTRAP si_code 0x%x addr %p\n", info->si_code, info->si_addr);
}


x86 assembly (clang, -O0):
<sigtrap_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigtrap_handler>:
mov    (%rsi),%eax
mov    0x4(%rsi),%edx
lea    0xee4(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
@.str = [30 x i8] c"SIGTRAP si_code 0x%x addr %p\0A\00"
define void @sigtrap_handler(i32 %0, %struct.TYPE_3__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_3__*
%6 = alloca i8*
store i32 %0, i32* %4
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %5
store i8* %2, i8** %6
%7 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %10, i32 0, i32 1
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32 }
@.str = [30 x i8] c"SIGTRAP si_code 0x%x addr %p\0A\00"
define void @sigtrap_handler(i32 %0, %struct.TYPE_3__* nocapture %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret void
}
void crap_atts_free(char **atts) {
  for (int i = 0; atts[i]; i += 1) {
    free(atts[i]);
  }
  free(atts);
}


x86 assembly (clang, -O0):
<crap_atts_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1155 <crap_atts_free+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <crap_atts_free+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crap_atts_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <crap_atts_free+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <crap_atts_free+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @crap_atts_free(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = bitcast i8** %0 to i8*
tail call void @free(i8* %5)
ret void
6: ; preds = %1, %6
%7 = phi i64 [ %9, %6 ], [ 0, %1 ]
%8 = phi i8* [ %11, %6 ], [ %2, %1 ]
tail call void @free(i8* %8)
%9 = add nuw nsw i64 %7, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double const);
void sam_print(const double *mu, const int N) {
  for (int i = 0; i < N; ++i) {
    printf("mu%d=%f, ", i, mu[i]);
  }
}


x86 assembly (clang, -O0):
<sam_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <sam_print+0x4c>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <sam_print+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sam_print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1149 <sam_print+0x39>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
movsd  (%r14,%rbx,8),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <sam_print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"mu%d=%f, \00"
define void @sam_print(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %11, double %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Variables and functions */
size_t base16_encode_size(size_t);
size_t encode_size_base16(size_t in_len) { return base16_encode_size(in_len); }


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

x86 assembly (clang, -O2):
<encode_size_base16>:
jmp    1030 <base16_encode_size@plt>

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

LLVM IR (-O2):
define i64 @encode_size_base16(i64 %0) {
%2 = tail call i64 @base16_encode_size(i64 %0)
ret i64 %2
}
signed int signedint_ignoring_unsignedlonglongint(signed int x,
                                                  unsigned long long int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i32 @signedint_ignoring_unsignedlonglongint(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @signedint_ignoring_unsignedlonglongint(i32 returned %0, i64 %1) {
ret i32 %0
}
int hostx_calculate_color_shift(unsigned long mask) {
  int shift = 1;
  while ((mask = (mask >> 1)))
    shift++;
  shift = shift - sizeof(unsigned char) * 8;
  if (shift < 0)
    shift = 0;
  return shift;
}


x86 assembly (clang, -O0):
<hostx_calculate_color_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1133 <hostx_calculate_color_shift+0x33>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hostx_calculate_color_shift+0xf>
movslq -0xc(%rbp),%rax
sub    $0x8,%rax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114f <hostx_calculate_color_shift+0x4f>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hostx_calculate_color_shift>:
xor    %eax,%eax
cmp    $0x2,%rdi
jb     112d <hostx_calculate_color_shift+0x2d>
mov    $0x1,%ecx
mov    %rdi,%rax
shr    %rax
add    $0x1,%ecx
cmp    $0x3,%rdi
mov    %rax,%rdi
ja     1110 <hostx_calculate_color_shift+0x10>
cmp    $0x9,%ecx
mov    $0x8,%eax
cmovae %ecx,%eax
add    $0xfffffff8,%eax
ret

LLVM IR (-O0):
define i32 @hostx_calculate_color_shift(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 1, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i64, i64* %2
%6 = lshr i64 %5, 1
store i64 %6, i64* %2
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = sub i64 %13, 8
%15 = trunc i64 %14 to i32
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %11
store i32 0, i32* %3
br label %19
19: ; preds = %18, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @hostx_calculate_color_shift(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i64 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = icmp ugt i32 %7, 8
%11 = select i1 %10, i32 %7, i32 8
%12 = add nsw i32 %11, -8
br label %13
13: ; preds = %9, %1
%14 = phi i32 [ 0, %1 ], [ %12, %9 ]
ret i32 %14
}
void dequeue_task_stop(struct rq *rq, struct task_struct *p, int flags) {}


x86 assembly (clang, -O0):
<dequeue_task_stop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.rq = type opaque
%struct.task_struct = type opaque
define void @dequeue_task_stop(%struct.rq* %0, %struct.task_struct* %1, i32 %2) {
%4 = alloca %struct.rq*
%5 = alloca %struct.task_struct*
%6 = alloca i32
store %struct.rq* %0, %struct.rq** %4
store %struct.task_struct* %1, %struct.task_struct** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.rq = type opaque
%struct.task_struct = type opaque
define void @dequeue_task_stop(%struct.rq* nocapture %0, %struct.task_struct* nocapture %1, i32 %2) {
ret void
}
unsigned char f95(unsigned char x, unsigned int y) {
  return (x << ((-y) & (8 * sizeof(unsigned char) - 1))) + (x >> y);
}


x86 assembly (clang, -O0):
<f95>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
mov    %ecx,%ecx
and    $0x7,%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f95>:
mov    %esi,%ecx
neg    %cl
and    $0x7,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f95(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = sub i32 0, %7
%9 = zext i32 %8 to i64
%10 = and i64 %9, 7
%11 = trunc i64 %10 to i32
%12 = shl i32 %6, %11
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = load i32, i32* %4
%16 = ashr i32 %14, %15
%17 = add nsw i32 %12, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @f95(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = sub i32 0, %1
%5 = and i32 %4, 7
%6 = shl nuw nsw i32 %3, %5
%7 = lshr i32 %3, %1
%8 = add nuw nsw i32 %6, %7
%9 = trunc i32 %8 to i8
ret i8 %9
}
/* Variables and functions */
char **array_of_segments(char *, char *, int);
int count_delim(char *, char *);
char **explode(char *buf, char *dl, int *acp) {
  int i = count_delim(buf, dl);
  *acp = i;
  return array_of_segments(buf, dl, i);
}


x86 assembly (clang, -O0):
<explode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <count_delim@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <array_of_segments@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<explode>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <count_delim@plt>
mov    %eax,(%r14)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %eax,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <array_of_segments@plt>

LLVM IR (-O0):
define i8** @explode(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @count_delim(i8* %8, i8* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %7
%16 = call i8** @array_of_segments(i8* %13, i8* %14, i32 %15)
ret i8** %16
}

LLVM IR (-O2):
define i8** @explode(i8* %0, i8* %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @count_delim(i8* %0, i8* %1)
store i32 %4, i32* %2
%5 = tail call i8** @array_of_segments(i8* %0, i8* %1, i32 %4)
ret i8** %5
}
void hf_init(void) {}


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

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

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

LLVM IR (-O2):
define void @hf_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *);
void librpipVersionStr(char *version, int len) {
  snprintf(version, len, "0.4.1");
}


x86 assembly (clang, -O0):
<librpipVersionStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"0.4.1\00"
define void @librpipVersionStr(i8* %0, i32 %1) {
%3 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void remove_terminated_processes(struct process_group *pgroup) {}


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

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

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

LLVM IR (-O2):
%struct.process_group = type opaque
define void @remove_terminated_processes(%struct.process_group* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
scalar_t__ syscall(int /*<<< orphan*/);
long _TW_getLWPnum() { return (long int)syscall(SYS_gettid); }


x86 assembly (clang, -O0):
<_TW_getLWPnum>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_TW_getLWPnum>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i64 @_TW_getLWPnum() {
%1 = load i32, i32* @SYS_gettid
%2 = call i64 @syscall(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define i64 @_TW_getLWPnum() {
%1 = load i32, i32* @SYS_gettid
%2 = tail call i64 @syscall(i32 %1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ mfree(char *);
void freeArgs(char **argv, int i) {
  for (int j = 0; j < i; j++)
    mfree(argv[j]);
}


x86 assembly (clang, -O0):
<freeArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <freeArgs+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <mfree@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freeArgs+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeArgs>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <freeArgs+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <mfree@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeArgs+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @freeArgs(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @mfree(i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ service_fona_hang_up();
int /*<<< orphan*/ stop_this_activity();
void hang_up_menu_item_selection_handler_in_main_loop() {
  service_fona_hang_up();
  stop_this_activity();
}


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

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

LLVM IR (-O0):
define void @hang_up_menu_item_selection_handler_in_main_loop() {
%1 = call i32 (...) @service_fona_hang_up()
%2 = call i32 (...) @stop_this_activity()
ret void
}

LLVM IR (-O2):
define void @hang_up_menu_item_selection_handler_in_main_loop() {
%1 = tail call i32 (...) @service_fona_hang_up()
%2 = tail call i32 (...) @stop_this_activity()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ SSL_accept;
int zopenssl_timed_do(int /*<<< orphan*/ *, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/, long);
int zopenssl_accept(SSL *ssl, long timeout) {
  return zopenssl_timed_do(ssl, SSL_accept, 0, 0, 0, 0, timeout);
}


x86 assembly (clang, -O0):
<zopenssl_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    %rax,(%rsp)
call   1030 <zopenssl_timed_do@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zopenssl_accept>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%eax
mov    %rsi,(%rsp)
mov    %eax,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <zopenssl_timed_do@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SSL_accept = global i32 0
define i32 @zopenssl_accept(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* @SSL_accept
%7 = load i64, i64* %4
%8 = call i32 @zopenssl_timed_do(i32* %5, i32 %6, i32 0, i32 0, i32 0, i32 0, i64 %7)
ret i32 %8
}

LLVM IR (-O2):
@SSL_accept = global i32 0
define i32 @zopenssl_accept(i32* %0, i64 %1) {
%3 = load i32, i32* @SSL_accept
%4 = tail call i32 @zopenssl_timed_do(i32* %0, i32 %3, i32 0, i32 0, i32 0, i32 0, i64 %1)
ret i32 %4
}