xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *hello_world(void *tid) {
  printf("Hello World. Esta é a Thread %d\n", (int)tid);
  pthread_exit(NULL);
}


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

x86 assembly (clang, -O2):
<hello_world>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Hello World. Esta \C3\A9 a Thread %d\0A\00"
define i8* @hello_world(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = ptrtoint i8* %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @pthread_exit(i32* null)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [34 x i8] c"Hello World. Esta \C3\A9 a Thread %d\0A\00"
define noalias i8* @hello_world(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
char *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
char *read_line(char *line, int buffer) {
  printf("CLI> ");
  fflush(stdout);
  return fgets(line, buffer, stdin);
}


x86 assembly (clang, -O0):
<read_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_line>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fgets@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"CLI> \00"
@stdout = global i32 0
@stdin = global i32 0
define i8* @read_line(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = load i32, i32* @stdin
%11 = call i8* @fgets(i8* %8, i32 %9, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"CLI> \00"
@stdout = global i32 0
@stdin = global i32 0
define i8* @read_line(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = load i32, i32* @stdin
%7 = tail call i8* @fgets(i8* %0, i32 %1, i32 %6)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int main() {
  long long accu;
  accu >>= 24;
  accu >>= 1;
  assert(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rax
sar    $0x18,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x8(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i64
%2 = load i64, i64* %1
%3 = ashr i64 %2, 24
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = ashr i64 %4, 1
store i64 %5, i64* %1
%6 = call i32 @assert(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
int bar(void) { return 24; }


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

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

LLVM IR (-O0):
define i32 @bar() {
ret i32 24
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 24
}
void filterdestroy(void *arg) {}


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

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

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

LLVM IR (-O2):
define void @filterdestroy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Absolute(int);
int /*<<< orphan*/ STZ8(int /*<<< orphan*/);
void Op9CM1(void) { STZ8(Absolute(2)); }


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

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

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

LLVM IR (-O2):
define void @Op9CM1() {
%1 = tail call i32 @Absolute(i32 2)
%2 = tail call i32 @STZ8(i32 %1)
ret void
}
/* Variables and functions */
void cdll_length_foreach_handler(void *data, void *length) {
  ++(*((size_t *)length));
}


x86 assembly (clang, -O0):
<cdll_length_foreach_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdll_length_foreach_handler>:
addq   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @cdll_length_foreach_handler(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 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = add i64 %7, 1
store i64 %8, i64* %6
ret void
}

LLVM IR (-O2):
define void @cdll_length_foreach_handler(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i64*
%4 = load i64, i64* %3
%5 = add i64 %4, 1
store i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IO_put_byte(char);
void GigaHypra_indent(int indent) {
  if (indent < 8)
    IO_put_byte('\t');
  IO_put_byte('\t');
}


x86 assembly (clang, -O0):
<GigaHypra_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    112f <GigaHypra_indent+0x1f>
mov    $0x9,%edi
call   1030 <IO_put_byte@plt>
mov    $0x9,%edi
call   1030 <IO_put_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GigaHypra_indent>:
cmp    $0x7,%edi
jg     1124 <GigaHypra_indent+0x14>
push   %rax
mov    $0x9,%edi
call   1030 <IO_put_byte@plt>
add    $0x8,%rsp
mov    $0x9,%edi
jmp    1030 <IO_put_byte@plt>

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

LLVM IR (-O2):
define void @GigaHypra_indent(i32 %0) {
%2 = icmp slt i32 %0, 8
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @IO_put_byte(i8 signext 9)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @IO_put_byte(i8 signext 9)
ret void
}
char *string_replace_char(char m, char r, char *str) {
  char *ptr = str;
  for (; *ptr; ++ptr)
    if (*ptr == m)
      *ptr = r;
  return str;
}


x86 assembly (clang, -O0):
<string_replace_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <string_replace_char+0x5b>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    1145 <string_replace_char+0x45>
mov    -0x2(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
jmp    114a <string_replace_char+0x4a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <string_replace_char+0x1c>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_replace_char>:
mov    %rdx,%rax
mov    (%rdx),%cl
test   %cl,%cl
je     1126 <string_replace_char+0x26>
lea    0x1(%rax),%rdx
jmp    111b <string_replace_char+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     1126 <string_replace_char+0x26>
cmp    %dil,%cl
jne    1110 <string_replace_char+0x10>
mov    %sil,-0x1(%rdx)
jmp    1110 <string_replace_char+0x10>
ret

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

LLVM IR (-O2):
define i8* @string_replace_char(i8 signext %0, i8 signext %1, i8* returned %2) {
%4 = load i8, i8* %2
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %2, %3 ]
%9 = icmp eq i8 %7, %0
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %1, i8* %8
br label %11
11: ; preds = %6, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret i8* %2
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
scalar_t__ buffer_current(struct buffer *);
int /*<<< orphan*/ buffer_forward(struct buffer *, int);
char buffer_getc(struct buffer *buffer) {
  char *buf = (char *)buffer_current(buffer);
  buffer_forward(buffer, 1);
  return buf[0];
}


x86 assembly (clang, -O0):
<buffer_getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <buffer_current@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <buffer_forward@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_getc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <buffer_current@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <buffer_forward@plt>
mov    (%r14),%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.buffer = type { i32 }
define signext i8 @buffer_getc(%struct.buffer* %0) {
%2 = alloca %struct.buffer*
%3 = alloca i8*
store %struct.buffer* %0, %struct.buffer** %2
%4 = load %struct.buffer*, %struct.buffer** %2
%5 = call i64 @buffer_current(%struct.buffer* %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load %struct.buffer*, %struct.buffer** %2
%8 = call i32 @buffer_forward(%struct.buffer* %7, i32 1)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
ret i8 %11
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define signext i8 @buffer_getc(%struct.buffer* %0) {
%2 = tail call i64 @buffer_current(%struct.buffer* %0)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @buffer_forward(%struct.buffer* %0, i32 1)
%5 = load i8, i8* %3
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ logger(int, int /*<<< orphan*/, char *, char const *);
scalar_t__ unlink(char const *);
int _unlink(const char *s) {
  if (unlink(s)) {
    logger(-1, errno, "Unable to unlink %s", s);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
je     1169 <_unlink+0x49>
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rcx
mov    $0xffffffff,%edi
lea    0xea8(%rip),%rdx
call   1040 <logger@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <_unlink+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_unlink>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <unlink@plt>
test   %rax,%rax
je     1154 <_unlink+0x34>
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xec0(%rip),%rdx
mov    $0xffffffff,%ebp
mov    $0xffffffff,%edi
mov    %rbx,%rcx
call   1040 <logger@plt>
jmp    1156 <_unlink+0x36>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
@.str = [20 x i8] c"Unable to unlink %s\00"
define i32 @_unlink(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @unlink(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* @errno
%9 = load i8*, i8** %3
%10 = call i32 @logger(i32 -1, i32 %8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %9)
store i32 -1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [20 x i8] c"Unable to unlink %s\00"
define i32 @_unlink(i8* %0) {
%2 = tail call i64 @unlink(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @logger(i32 -1, i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printArray(int *, int);
int /*<<< orphan*/ sort(int *, int /*<<< orphan*/, int);
int main() {
  int a[] = {3, 7, 1, 5, 9, 12};
  int n = sizeof(a) / sizeof(int);
  printArray(a, n);
  sort(a, 0, n - 1);
  printArray(a, n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x6,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <printArray@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <sort@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [6 x i32] [i32 3, i32 7, i32 1, i32 5, i32 9, i32 12]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = bitcast [6 x i32]* %1 to i8*
store i32 6, i32* %2
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @printArray(i32* %4, i32 %5)
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = call i32 @sort(i32* %7, i32 0, i32 %9)
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%12 = load i32, i32* %2
%13 = call i32 @printArray(i32* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [6 x i32] [i32 3, i32 7, i32 1, i32 5, i32 9, i32 12]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @printArray(i32* %3, i32 6)
%5 = call i32 @sort(i32* %3, i32 0, i32 5)
%6 = call i32 @printArray(i32* %3, i32 6)
ret i32 0
}
/* Variables and functions */
void *realloc(void *, size_t);
void *defaultReallocate(void *memory, size_t oldSize, size_t newSize) {
  return realloc(memory, newSize);
}


x86 assembly (clang, -O0):
<defaultReallocate>:
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    -0x18(%rbp),%rsi
call   1030 <realloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defaultReallocate>:
mov    %rdx,%rsi
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @defaultReallocate(i8* nocapture %0, i64 %1, i64 %2) {
%4 = tail call i8* @realloc(i8* %0, i64 %2)
ret i8* %4
}
int test_imm_C0int32_mem(int *val) {
  return ((*val) & (0xC0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C0int32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xc0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C0int32_mem>:
testb  $0xc0,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C0int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 192
%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_C0int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 192
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int syscall_cp(int, struct timespec const *, struct timespec *);
int nanosleep(const struct timespec *req, struct timespec *rem) {
  return syscall_cp(35, req, rem);
}


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

x86 assembly (clang, -O2):
<nanosleep>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x23,%edi
jmp    1030 <syscall_cp@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i32 @syscall_cp(i32 35, %struct.timespec* %5, %struct.timespec* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = tail call i32 @syscall_cp(i32 35, %struct.timespec* %0, %struct.timespec* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ yogrt_set_interval2_start(int);
int iyogrt_set_interval2_start__(int *seconds_before_end) {
  yogrt_set_interval2_start(*seconds_before_end);
  return *seconds_before_end;
}


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

x86 assembly (clang, -O2):
<iyogrt_set_interval2_start__>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <yogrt_set_interval2_start@plt>
mov    (%rbx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @iyogrt_set_interval2_start__(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @yogrt_set_interval2_start(i32 %2)
%4 = load i32, i32* %0
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
void *g_malloc(size_t size) {
  if (size == 0)
    return NULL;
  void *res = malloc(size);
  if (!res)
    while (1)
      ;
  return res;
}


x86 assembly (clang, -O0):
<g_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <g_malloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    115e <g_malloc+0x4e>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <g_malloc+0x46>
jmp    1151 <g_malloc+0x41>
jmp    1151 <g_malloc+0x41>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_malloc>:
test   %rdi,%rdi
je     1132 <g_malloc+0x22>
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
lea    0x8(%rsp),%rsp
je     1130 <g_malloc+0x20>
ret
cs nopw 0x0(%rax,%rax,1)
jmp    1130 <g_malloc+0x20>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @g_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %3, %6
br label %6
7: ; preds = %3, %1
%8 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ RegReadA(int, unsigned char *);
void AccWit(unsigned char UcTrgDat) {
  unsigned char UcFlgVal;
  UcFlgVal = 1;
  while (UcFlgVal) {
    RegReadA(0x0282, &UcFlgVal);
    UcFlgVal &= UcTrgDat;
  };
}


x86 assembly (clang, -O0):
<AccWit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x1,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     114c <AccWit+0x3c>
mov    $0x282,%edi
lea    -0x2(%rbp),%rsi
call   1030 <RegReadA@plt>
movzbl -0x1(%rbp),%ecx
movzbl -0x2(%rbp),%eax
and    %ecx,%eax
mov    %al,-0x2(%rbp)
jmp    1122 <AccWit+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AccWit>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movb   $0x1,0x7(%rsp)
lea    0x7(%rsp),%r14
mov    $0x282,%edi
mov    %r14,%rsi
call   1030 <RegReadA@plt>
and    %bl,0x7(%rsp)
jne    1120 <AccWit+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @AccWit(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 1, i8* %3
br label %4
4: ; preds = %7, %1
%5 = load i8, i8* %3
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = call i32 @RegReadA(i32 642, i8* %3)
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = and i32 %12, %10
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @AccWit(i8 zeroext %0) {
%2 = alloca i8
store i8 1, i8* %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @RegReadA(i32 642, i8* %2)
%5 = load i8, i8* %2
%6 = and i8 %5, %0
store i8 %6, i8* %2
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
/* Variables and functions */
float sqrtf(float);
float cbuiltin_sqrtf(float x) { return sqrtf(x); }


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

x86 assembly (clang, -O2):
<cbuiltin_sqrtf>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <cbuiltin_sqrtf+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define float @cbuiltin_sqrtf(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void bakup_ap() { system("cp /root/wireless.ap /root/wireless.ap.bak"); }


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"cp /root/wireless.ap /root/wireless.ap.bak\00"
define void @bakup_ap() {
%1 = call i32 @system(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"cp /root/wireless.ap /root/wireless.ap.bak\00"
define void @bakup_ap() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t __str_spn(char const *, char const *, int /*<<< orphan*/);
size_t strcspn(const char *s1, const char *s2) { return __str_spn(s1, s2, 0); }


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

x86 assembly (clang, -O2):
<strcspn>:
xor    %edx,%edx
jmp    1030 <__str_spn@plt>

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

LLVM IR (-O2):
define i64 @strcspn(i8* %0, i8* %1) {
%3 = tail call i64 @__str_spn(i8* %0, i8* %1, i32 0)
ret i64 %3
}
/* Variables and functions */
double _kf_gammap(double, double);
double _kf_gammaq(double, double);
double kf_gammap(double s, double z) {
  return z <= 1. || z < s ? _kf_gammap(s, z) : 1. - _kf_gammaq(s, z);
}


x86 assembly (clang, -O0):
<kf_gammap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xec6(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jae    1159 <kf_gammap+0x39>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1172 <kf_gammap+0x52>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <_kf_gammap@plt>
movsd  %xmm0,-0x18(%rbp)
jmp    1195 <kf_gammap+0x75>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <_kf_gammaq@plt>
movaps %xmm0,%xmm1
movsd  0xe74(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kf_gammap>:
push   %rax
movsd  0xed7(%rip),%xmm2
ucomisd %xmm1,%xmm2
jae    114c <kf_gammap+0x2c>
ucomisd %xmm1,%xmm0
ja     114c <kf_gammap+0x2c>
call   1030 <_kf_gammaq@plt>
movsd  0xebe(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret
pop    %rax
jmp    1040 <_kf_gammap@plt>

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

LLVM IR (-O2):
define double @kf_gammap(double %0, double %1) {
%3 = fcmp ole double %1, 1.000000e+00
%4 = fcmp olt double %1, %0
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call double @_kf_gammap(double %0, double %1)
br label %11
8: ; preds = %2
%9 = tail call double @_kf_gammaq(double %0, double %1)
%10 = fsub double 1.000000e+00, %9
br label %11
11: ; preds = %8, %6
%12 = phi double [ %7, %6 ], [ %10, %8 ]
ret double %12
}
void rte_compiler_barrier() {}


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

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

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

LLVM IR (-O2):
define void @rte_compiler_barrier() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ selection_gpu(double *, double *, int *, int, int, int);
void selection(double *dist, double *NNdist, int *NNidx, int N, int Q, int k) {
  selection_gpu(dist, NNdist, NNidx, N, Q, k);
}


x86 assembly (clang, -O0):
<selection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
call   1030 <selection_gpu@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<selection>:
jmp    1030 <selection_gpu@plt>

LLVM IR (-O0):
define void @selection(double* %0, double* %1, i32* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store double* %0, double** %7
store double* %1, double** %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load double*, double** %7
%14 = load double*, double** %8
%15 = load i32*, i32** %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @selection_gpu(double* %13, double* %14, i32* %15, i32 %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @selection(double* %0, double* %1, i32* %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @selection_gpu(double* %0, double* %1, i32* %2, i32 %3, i32 %4, i32 %5)
ret void
}
/* Type definitions */
struct list_node {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct list_node *list_delete(struct list *, int /*<<< orphan*/);
struct list_node *list_pop_front(struct list *self) {
  return list_delete(self, 0);
}


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

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

LLVM IR (-O0):
%struct.list_node = type { i32 }
%struct.list = type { i32 }
define %struct.list_node* @list_pop_front(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%3 = load %struct.list*, %struct.list** %2
%4 = call %struct.list_node* @list_delete(%struct.list* %3, i32 0)
ret %struct.list_node* %4
}

LLVM IR (-O2):
%struct.list_node = type { i32 }
%struct.list = type { i32 }
define %struct.list_node* @list_pop_front(%struct.list* %0) {
%2 = tail call %struct.list_node* @list_delete(%struct.list* %0, i32 0)
ret %struct.list_node* %2
}
void ff_hevc_put_hevc_qpel_h24_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h24_12_sse4() {
ret void
}
int iscntrl(int c) { return (c <= 0x1f) || (c == 0x7f); }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1120 <iscntrl+0x20>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setl   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 31
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp slt i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ key;

/* Variables and functions */
int /*<<< orphan*/ rgph_u64_xxh64s_data(int /*<<< orphan*/ const *, size_t,
                                        uintptr_t);
uint64_t rgph_u64_xxh64s_u16a(const uint16_t *key, size_t len, uintptr_t seed) {
  const uint8_t *arg = ((const uint8_t *)(const char *)(key));
  return rgph_u64_xxh64s_data(arg, len * sizeof(key[0]), seed);
}


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

x86 assembly (clang, -O2):
<rgph_u64_xxh64s_u16a>:
shl    $0x2,%rsi
jmp    1030 <rgph_u64_xxh64s_data@plt>

LLVM IR (-O0):
define i32 @rgph_u64_xxh64s_u16a(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32*
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i32*, i32** %4
%9 = bitcast i32* %8 to i8*
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %7
%11 = load i32*, i32** %7
%12 = load i64, i64* %5
%13 = mul i64 %12, 4
%14 = load i64, i64* %6
%15 = call i32 @rgph_u64_xxh64s_data(i32* %11, i64 %13, i64 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @rgph_u64_xxh64s_u16a(i32* %0, i64 %1, i64 %2) {
%4 = shl i64 %1, 2
%5 = tail call i32 @rgph_u64_xxh64s_data(i32* %0, i64 %4, i64 %2)
ret i32 %5
}
void NoPrintF(char *Format, ...) { Format = Format; }


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

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

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

LLVM IR (-O2):
define void @NoPrintF(i8* nocapture %0, ...) {
ret void
}
int false(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @false() {
ret i32 1
}

LLVM IR (-O2):
define i32 @false() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int __attribute__((section("libgloss_epiphany"))) _kill(pid_t pid, int sig) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<_kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebe(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kill>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_kill(i32 %0, i32 %1) section "libgloss_epiphany" {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_kill(i32 %0, i32 %1) section "libgloss_epiphany" {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ xdrproc_t;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ my_xdr_free(int /*<<< orphan*/, char *);
void xcom_xdr_free(xdrproc_t f, char *p) {
  if (p) {
    my_xdr_free(f, p);
    {
      free(p);
      p = 0;
    };
  }
}


x86 assembly (clang, -O0):
<xcom_xdr_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1157 <xcom_xdr_free+0x37>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <my_xdr_free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcom_xdr_free>:
test   %rsi,%rsi
je     1137 <xcom_xdr_free+0x17>
push   %rbx
mov    %rsi,%rbx
call   1040 <my_xdr_free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @xcom_xdr_free(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i32 @my_xdr_free(i32 %8, i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 @free(i8* %11)
store i8* null, i8** %4
br label %13
13: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @xcom_xdr_free(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @my_xdr_free(i32 %0, i8* %1)
%6 = tail call i32 @free(i8* %1)
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SA1Absolute(int);
int /*<<< orphan*/ STZ16(int /*<<< orphan*/, int);
void Op9CM0(void) { STZ16(SA1Absolute(2), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op9CM0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <STZ16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op9CM0>:
push   %rax
mov    $0x2,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <STZ16@plt>

LLVM IR (-O0):
define void @Op9CM0() {
%1 = call i32 @SA1Absolute(i32 2)
%2 = call i32 @STZ16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op9CM0() {
%1 = tail call i32 @SA1Absolute(i32 2)
%2 = tail call i32 @STZ16(i32 %1, i32 16777215)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char **argv) {
  switch (argc) {
  default:
    printf("GOOD\n");
    return 0;
  case 100:
  case 101:
  case 1023:
    printf("BAD\n");
    return 1;
  }
}


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    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
add    $0xffffff9c,%eax
sub    $0x2,%eax
jb     1168 <main+0x58>
jmp    113d <main+0x2d>
mov    -0x14(%rbp),%eax
sub    $0x3ff,%eax
je     1168 <main+0x58>
jmp    1150 <main+0x40>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    117b <main+0x6b>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    -0x64(%rdi),%eax
cmp    $0x2,%eax
jb     1121 <main+0x11>
cmp    $0x3ff,%edi
jne    112f <main+0x1f>
mov    $0x1,%ebx
lea    0xed3(%rip),%rdi
jmp    1138 <main+0x28>
xor    %ebx,%ebx
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"GOOD\0A\00"
@.str.1 = [5 x i8] c"BAD\0A\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 = load i32, i32* %4
switch i32 %6, label %7 [
i32 100, label %9
i32 101, label %9
i32 1023, label %9
]
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %11
9: ; preds = %2, %2, %2
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@str = [4 x i8] c"BAD\00"
@str.2 = [5 x i8] c"GOOD\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
switch i32 %0, label %4 [
i32 100, label %3
i32 101, label %3
i32 1023, label %3
]
3: ; preds = %2, %2, %2
br label %4
4: ; preds = %2, %3
%5 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.2, i64 0, i64 0), %2 ]
%6 = phi i32 [ 1, %3 ], [ 0, %2 ]
%7 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 %6
}
/* Variables and functions */
char getchar();
void clean(void) {
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<clean>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <clean+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <clean+0x21>
jmp    1119 <clean+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clean+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @clean() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @clean() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
char *strtok(char *, char const *);
void explode(char *variable[], char *haystack, const char *delimiter) {
  char *token_position;
  int i = 0;
  token_position = strtok(haystack, delimiter);
  while (token_position != NULL) {
    variable[i++] = token_position;
    token_position = strtok(NULL, delimiter);
  }
}


x86 assembly (clang, -O0):
<explode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1177 <explode+0x67>
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x24(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <strtok@plt>
mov    %rax,-0x20(%rbp)
jmp    113c <explode+0x2c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<explode>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <strtok@plt>
test   %rax,%rax
je     1146 <explode+0x36>
nopw   0x0(%rax,%rax,1)
mov    %rax,(%rbx)
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
add    $0x8,%rbx
test   %rax,%rax
jne    1130 <explode+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @explode(i8** nocapture writeonly %0, i8* %1, i8* nocapture %2) {
%4 = tail call i8* @strtok(i8* %1, i8* %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8* [ %11, %6 ], [ %4, %3 ]
%9 = add nuw i64 %7, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %7
store i8* %8, i8** %10
%11 = tail call i8* @strtok(i8* null, i8* %2)
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3
ret void
}
int PDMCCompare3(P, PDMCQStruct)
struct Person **P;
struct PossibleGradStruct *PDMCQStruct;
{
  if ((AccessPersonMsc(P) & 3) == 0)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<PDMCCompare3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <AccessPersonMsc@plt>
and    $0x3,%eax
cmp    $0x0,%eax
jne    1143 <PDMCCompare3+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <PDMCCompare3+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDMCCompare3>:
push   %rax
xor    %eax,%eax
call   1030 <AccessPersonMsc@plt>
and    $0x3,%eax
cmp    $0x1,%eax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.Person = type opaque
%struct.PossibleGradStruct = type opaque
define i32 @PDMCCompare3(%struct.Person** %0, %struct.PossibleGradStruct* %1) {
%3 = alloca i32
%4 = alloca %struct.Person**
%5 = alloca %struct.PossibleGradStruct*
store %struct.Person** %0, %struct.Person*** %4
store %struct.PossibleGradStruct* %1, %struct.PossibleGradStruct** %5
%6 = load %struct.Person**, %struct.Person*** %4
%7 = call i32 (%struct.Person**, ...) bitcast (i32 (...)* @AccessPersonMsc to i32 (%struct.Person**, ...)*)(%struct.Person** %6)
%8 = and i32 %7, 3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
%struct.Person = type opaque
%struct.PossibleGradStruct = type opaque
define i32 @PDMCCompare3(%struct.Person** %0, %struct.PossibleGradStruct* nocapture readnone %1) {
%3 = tail call i32 (%struct.Person**, ...) bitcast (i32 (...)* @AccessPersonMsc to i32 (%struct.Person**, ...)*)(%struct.Person** %0)
%4 = and i32 %3, 3
%5 = icmp eq i32 %4, 0
%6 = sext i1 %5 to i32
ret i32 %6
}