xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pad_set(int, int);
int(cmd_start)(int c, char **v) {
  pad_set((0x80), v[0][0] == '+');
  return 0;
}


x86 assembly (clang, -O0):
<cmd_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
mov    $0x80,%edi
call   1030 <pad_set@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_start>:
push   %rax
mov    (%rsi),%rax
xor    %esi,%esi
cmpb   $0x2b,(%rax)
sete   %sil
mov    $0x80,%edi
call   1030 <pad_set@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cmd_start(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 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 43
%12 = zext i1 %11 to i32
%13 = call i32 @pad_set(i32 128, i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @cmd_start(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 43
%6 = zext i1 %5 to i32
%7 = tail call i32 @pad_set(i32 128, i32 %6)
ret i32 0
}
char *my_strcpy(char *dest, const char *src) {
  char *save = dest;
  while ((*dest++ = *src++))
    ;
  return save;
}


x86 assembly (clang, -O0):
<my_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <my_strcpy+0x43>
jmp    1114 <my_strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <my_strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @my_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void SkipNewline(FILE *file) {
  if (fgetc(file) != '\n')
    fseek(file, -1, SEEK_CUR);
}


x86 assembly (clang, -O0):
<SkipNewline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1158 <SkipNewline+0x38>
mov    -0x8(%rbp),%rdi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%esi
call   1040 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipNewline>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fgetc@plt>
cmp    $0xa,%al
jne    112f <SkipNewline+0xf>
pop    %rbx
ret
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0xffffffff,%esi
pop    %rbx
jmp    1040 <fseek@plt>

LLVM IR (-O0):
@SEEK_CUR = global i32 0
define void @SkipNewline(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call signext i8 @fgetc(i32* %3)
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = load i32, i32* @SEEK_CUR
%10 = call i32 @fseek(i32* %8, i32 -1, i32 %9)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
define void @SkipNewline(i32* nocapture %0) {
%2 = tail call signext i8 @fgetc(i32* %0)
%3 = icmp eq i8 %2, 10
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @SEEK_CUR
%6 = tail call i32 @fseek(i32* %0, i32 -1, i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t utime_get_seconds(int64_t v) { return v / 1000000; }


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

x86 assembly (clang, -O2):
<utime_get_seconds>:
movslq %edi,%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x32,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @utime_get_seconds(i32 %0) {
%2 = sdiv i32 %0, 1000000
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int free_list(void *ptr, void *data) {
  free(data);
  return 0;
}


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

x86 assembly (clang, -O2):
<free_list>:
push   %rax
mov    %rsi,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @free_list(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 = call i32 @free(i8* %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @free_list(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skipws(char *p) {
  while (*p && isspace(*p))
    ++p;
  return p;
}


x86 assembly (clang, -O0):
<skipws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <skipws+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <skipws+0x47>
jmp    1168 <skipws+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skipws+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipws>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <skipws+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <skipws+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skipws+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipws(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_subs_pu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_subs_pu8(__m64 a, __m64 b) { return _mm_subs_pu8(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_subs_pu8>:
jmp    1030 <_mm_subs_pu8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_subs_pu8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_subs_pu8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ japi_showpopup(int, int, int);
void j_showpopup(int arg0, int arg1, int arg2) {
  japi_showpopup(arg0, arg1, arg2);
}


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

x86 assembly (clang, -O2):
<j_showpopup>:
jmp    1030 <japi_showpopup@plt>

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

LLVM IR (-O2):
define void @j_showpopup(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @japi_showpopup(i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ appaserver_error_output_starting_argv_stderr(int, char **);
void appaserver_output_starting_argv_stderr(int argc, char **argv) {
  appaserver_error_output_starting_argv_stderr(argc, argv);
}


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

x86 assembly (clang, -O2):
<appaserver_output_starting_argv_stderr>:
jmp    1030 <appaserver_error_output_starting_argv_stderr@plt>

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

LLVM IR (-O2):
define void @appaserver_output_starting_argv_stderr(i32 %0, i8** %1) {
%3 = tail call i32 @appaserver_error_output_starting_argv_stderr(i32 %0, i8** %1)
ret void
}
/* Variables and functions */
int system(char const *);
int main(void) {
  const char command[] = "cd ../src/yajl/test/parsing/; ./run_tests.sh";
  return system(command);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x2d,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
call   1030 <system@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movups 0xf02(%rip),%xmm0
movups %xmm0,0x1d(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <system@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.command = [45 x i8] c"cd ../src/yajl/test/parsing/; ./run_tests.sh\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [45 x i8]
store i32 0, i32* %1
%3 = bitcast [45 x i8]* %2 to i8*
%4 = getelementptr inbounds [45 x i8], [45 x i8]* %2, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@__const.main.command = [45 x i8] c"cd ../src/yajl/test/parsing/; ./run_tests.sh\00"
define i32 @main() {
%1 = alloca [45 x i8]
%2 = getelementptr inbounds [45 x i8], [45 x i8]* %1, i64 0, i64 0
%3 = call i32 @system(i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __sharc_thread_destroy();
int /*<<< orphan*/ heapsafe_thread_destroy();
int /*<<< orphan*/ pthread_exit_orig(void *);
__attribute__((__noreturn__)) void pthread_exit(void *__retval) {
  __sharc_thread_destroy();
  heapsafe_thread_destroy();
  pthread_exit_orig(__retval);
}


x86 assembly (clang, -O0):
<pthread_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__sharc_thread_destroy@plt>
mov    $0x0,%al
call   1040 <heapsafe_thread_destroy@plt>
mov    -0x8(%rbp),%rdi
call   1050 <pthread_exit_orig@plt>

x86 assembly (clang, -O2):
<pthread_exit>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__sharc_thread_destroy@plt>
xor    %eax,%eax
call   1040 <heapsafe_thread_destroy@plt>
mov    %rbx,%rdi
call   1050 <pthread_exit_orig@plt>

LLVM IR (-O0):
define void @pthread_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @__sharc_thread_destroy()
%4 = call i32 (...) @heapsafe_thread_destroy()
%5 = load i8*, i8** %2
%6 = call i32 @pthread_exit_orig(i8* %5)
unreachable
}

LLVM IR (-O2):
define void @pthread_exit(i8* %0) {
%2 = tail call i32 (...) @__sharc_thread_destroy()
%3 = tail call i32 (...) @heapsafe_thread_destroy()
%4 = tail call i32 @pthread_exit_orig(i8* %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ gcall(char *);
gneg() { gcall("^neg"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"^neg\00"
define i32 @gneg() {
%1 = alloca i32
%2 = call i32 @gcall(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [5 x i8] c"^neg\00"
define i32 @gneg() {
%1 = tail call i32 @gcall(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void leave() {
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<leave>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<leave>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @leave() {
%1 = call i32 (...) @endwin()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @leave() {
%1 = tail call i32 (...) @endwin()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
const char *strsignal(int sig) {
  static char signame[40];
  sprintf(signame, "SIG #%d", sig);
  return signame;
}


x86 assembly (clang, -O0):
<strsignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsignal>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@strsignal.signame = internal global [40 x i8] zeroinitializer
@.str = [8 x i8] c"SIG #%d\00"
define i8* @strsignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @strsignal.signame, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @strsignal.signame, i64 0, i64 0)
}

LLVM IR (-O2):
@strsignal.signame = internal global [40 x i8] zeroinitializer
@.str = [8 x i8] c"SIG #%d\00"
define i8* @strsignal(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @strsignal.signame, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([40 x i8], [40 x i8]* @strsignal.signame, i64 0, i64 0)
}
int test_imm_AAuint8_mem(unsigned char *val) {
  return ((*val) & (-0xAA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_AAuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 86
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ nl();
int /*<<< orphan*/ stderr;
void fatal_error(const char *message) {
  fprintf(stderr, message);
  nl();
  exit(-1);
}


x86 assembly (clang, -O0):
<fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fatal_error>:
push   %rax
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <nl@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @fatal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
%6 = call i32 (...) @nl()
%7 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @fatal_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = tail call i32 (...) @nl()
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
struct rtnl_link_af_ops {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rtnl_link_af_ops_put(struct rtnl_link_af_ops *);
void _nl_auto_rtnl_link_af_ops_fcn(struct rtnl_link_af_ops **v) {
  if (*v)
    rtnl_link_af_ops_put(*v);
}


x86 assembly (clang, -O0):
<_nl_auto_rtnl_link_af_ops_fcn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <_nl_auto_rtnl_link_af_ops_fcn+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <rtnl_link_af_ops_put@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nl_auto_rtnl_link_af_ops_fcn>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <_nl_auto_rtnl_link_af_ops_fcn+0xd>
jmp    1030 <rtnl_link_af_ops_put@plt>
ret

LLVM IR (-O0):
%struct.rtnl_link_af_ops = type { i32 }
define void @_nl_auto_rtnl_link_af_ops_fcn(%struct.rtnl_link_af_ops** %0) {
%2 = alloca %struct.rtnl_link_af_ops**
store %struct.rtnl_link_af_ops** %0, %struct.rtnl_link_af_ops*** %2
%3 = load %struct.rtnl_link_af_ops**, %struct.rtnl_link_af_ops*** %2
%4 = load %struct.rtnl_link_af_ops*, %struct.rtnl_link_af_ops** %3
%5 = icmp ne %struct.rtnl_link_af_ops* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.rtnl_link_af_ops**, %struct.rtnl_link_af_ops*** %2
%8 = load %struct.rtnl_link_af_ops*, %struct.rtnl_link_af_ops** %7
%9 = call i32 @rtnl_link_af_ops_put(%struct.rtnl_link_af_ops* %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.rtnl_link_af_ops = type { i32 }
define void @_nl_auto_rtnl_link_af_ops_fcn(%struct.rtnl_link_af_ops** nocapture %0) {
%2 = load %struct.rtnl_link_af_ops*, %struct.rtnl_link_af_ops** %0
%3 = icmp eq %struct.rtnl_link_af_ops* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @rtnl_link_af_ops_put(%struct.rtnl_link_af_ops* %2)
br label %6
6: ; preds = %4, %1
ret void
}
void GIB_Method_Free(void *ele, void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @GIB_Method_Free(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void alarm_handler(int signum) { printf("Timer hit!\n"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Timer hit!\0A\00"
define void @alarm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"Timer hit!\00"
define void @alarm_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
void handler(int sig) { return; }


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

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

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

LLVM IR (-O2):
define void @handler(i32 %0) {
ret void
}
void Sound_AddLoopingSounds(void) {}


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

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

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

LLVM IR (-O2):
define void @Sound_AddLoopingSounds() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("This is text.\n");
  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    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"This is text.\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 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"This is text.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ no_op();
void do_n_times(int n) {
  for (int i = 0; i < n; i++) {
    no_op();
  }
}


x86 assembly (clang, -O0):
<do_n_times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1143 <do_n_times+0x33>
mov    $0x0,%al
call   1030 <no_op@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <do_n_times+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_n_times>:
push   %rbx
test   %edi,%edi
jle    112c <do_n_times+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <no_op@plt>
add    $0xffffffff,%ebx
jne    1120 <do_n_times+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @do_n_times(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 (...) @no_op()
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @do_n_times(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 (...) @no_op()
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *getLine(int /*<<< orphan*/ *);
char *tabGetPlainLine(FILE *fin) { return getLine(fin); }


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

x86 assembly (clang, -O2):
<tabGetPlainLine>:
jmp    1030 <getLine@plt>

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

LLVM IR (-O2):
define i8* @tabGetPlainLine(i32* %0) {
%2 = tail call i8* @getLine(i32* %0)
ret i8* %2
}
int ath10k_wow_init(struct ath10k *ar) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ath10k = type opaque
define i32 @ath10k_wow_init(%struct.ath10k* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int sa_family;
};

/* Variables and functions */
#define AF_INET 129
#define AF_INET6 128
unsigned int nfs_sockaddr_length(const struct sockaddr *sap) {
  switch (sap->sa_family) {
  case AF_INET:
    return (unsigned int)sizeof(struct sockaddr_in);
  case AF_INET6:
    return (unsigned int)0;
  }
  return (unsigned int)0;
}


x86 assembly (clang, -O0):
<nfs_sockaddr_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x80,%eax
je     1140 <nfs_sockaddr_length+0x40>
jmp    1121 <nfs_sockaddr_length+0x21>
mov    -0x14(%rbp),%eax
sub    $0x81,%eax
jne    114c <nfs_sockaddr_length+0x4c>
jmp    1134 <nfs_sockaddr_length+0x34>
movl   $0x4,-0x4(%rbp)
jmp    1153 <nfs_sockaddr_length+0x53>
movl   $0x0,-0x4(%rbp)
jmp    1153 <nfs_sockaddr_length+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nfs_sockaddr_length>:
xor    %eax,%eax
cmpl   $0x81,(%rdi)
sete   %al
shl    $0x2,%eax
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @nfs_sockaddr_length(%struct.sockaddr* %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %3
%4 = load %struct.sockaddr*, %struct.sockaddr** %3
%5 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %4, i32 0, i32 0
%6 = load i32, i32* %5
switch i32 %6, label %9 [
i32 129, label %7
i32 128, label %8
]
7: ; preds = %1
store i32 4, i32* %2
br label %10
8: ; preds = %1
store i32 0, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @nfs_sockaddr_length(%struct.sockaddr* nocapture %0) {
%2 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 129
%5 = select i1 %4, i32 4, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup(int /*<<< orphan*/);
int /*<<< orphan*/ open(char *, int /*<<< orphan*/);
void redirect_fds() {
  (void)close(0);
  (void)close(1);
  (void)close(2);
  open("/dev/null", O_RDWR);
  (void)dup(0);
  (void)dup(0);
}


x86 assembly (clang, -O0):
<redirect_fds>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <close@plt>
mov    $0x1,%edi
call   1040 <close@plt>
mov    $0x2,%edi
call   1040 <close@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
lea    0xea1(%rip),%rdi
call   1050 <open@plt>
xor    %edi,%edi
call   1030 <dup@plt>
xor    %edi,%edi
call   1030 <dup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<redirect_fds>:
push   %rax
xor    %edi,%edi
call   1040 <close@plt>
mov    $0x1,%edi
call   1040 <close@plt>
mov    $0x2,%edi
call   1040 <close@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
lea    0xea4(%rip),%rdi
call   1050 <open@plt>
xor    %edi,%edi
call   1030 <dup@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <dup@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/null\00"
@O_RDWR = global i32 0
define void @redirect_fds() {
%1 = call i32 @close(i32 0)
%2 = call i32 @close(i32 1)
%3 = call i32 @close(i32 2)
%4 = load i32, i32* @O_RDWR
%5 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @dup(i32 0)
%7 = call i32 @dup(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/null\00"
@O_RDWR = global i32 0
define void @redirect_fds() {
%1 = tail call i32 @close(i32 0)
%2 = tail call i32 @close(i32 1)
%3 = tail call i32 @close(i32 2)
%4 = load i32, i32* @O_RDWR
%5 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @dup(i32 0)
%7 = tail call i32 @dup(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(float *);
float *malloc(int);
int /*<<< orphan*/ twoLoops(float *, size_t);
int main(int argc, char **argv) {
  size_t size = 10;
  float *tabFloat = malloc(sizeof(float) * size);
  twoLoops(tabFloat, size);
  free(tabFloat);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0xa,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <twoLoops@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0xa,%esi
mov    %rax,%rdi
call   1050 <twoLoops@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca float*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 10, i64* %6
%8 = load i64, i64* %6
%9 = mul i64 4, %8
%10 = trunc i64 %9 to i32
%11 = call float* @malloc(i32 %10)
store float* %11, float** %7
%12 = load float*, float** %7
%13 = load i64, i64* %6
%14 = call i32 @twoLoops(float* %12, i64 %13)
%15 = load float*, float** %7
%16 = call i32 @free(float* %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call float* @malloc(i32 40)
%4 = tail call i32 @twoLoops(float* %3, i64 10)
%5 = tail call i32 @free(float* %3)
ret i32 0
}
void INT_Excep_TMR2_CMIB2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TMR2_CMIB2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void avifFree(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<avifFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @avifFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void *swap_byte2(short *theInt) {
  char tmp[4];
  int i;
  for (i = 0; i < sizeof(short); i++)
    tmp[i] = *((char *)theInt + (sizeof(short) - 1 - i));
  *theInt = *((short *)tmp);
}


x86 assembly (clang, -O0):
<swap_byte2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movslq -0x18(%rbp),%rax
cmp    $0x2,%rax
jae    1146 <swap_byte2+0x46>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rdx
mov    $0x1,%ecx
sub    %rdx,%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x18(%rbp),%rax
mov    %cl,-0x14(%rbp,%rax,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    110f <swap_byte2+0xf>
mov    -0x14(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_byte2>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
define i8* @swap_byte2(i16* %0) {
%2 = alloca i8*
%3 = alloca i16*
%4 = alloca [4 x i8]
%5 = alloca i32
store i16* %0, i16** %3
store i32 0, i32* %5
br label %6
6: ; preds = %21, %1
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = icmp ult i64 %8, 2
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i16*, i16** %3
%12 = bitcast i16* %11 to i8*
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = sub i64 1, %14
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i8, i8* %16
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 %19
store i8 %17, i8* %20
br label %21
21: ; preds = %10
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
%25 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%26 = bitcast i8* %25 to i16*
%27 = load i16, i16* %26
%28 = load i16*, i16** %3
store i16 %27, i16* %28
%29 = load i8*, i8** %2
ret i8* %29
}

LLVM IR (-O2):
define noalias i8* @swap_byte2(i16* nocapture %0) {
%2 = bitcast i16* %0 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = load i8, i8* %3
%5 = load i8, i8* %2
%6 = zext i8 %5 to i16
%7 = shl nuw i16 %6, 8
%8 = zext i8 %4 to i16
%9 = or i16 %7, %8
store i16 %9, i16* %0
ret i8* undef
}
/* Type definitions */
struct grecs_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ grecs_free(struct grecs_list *);
int /*<<< orphan*/ grecs_list_clear(struct grecs_list *);
void grecs_list_free(struct grecs_list *lp) {
  if (lp) {
    grecs_list_clear(lp);
    grecs_free(lp);
  }
}


x86 assembly (clang, -O0):
<grecs_list_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1149 <grecs_list_free+0x29>
mov    -0x8(%rbp),%rdi
call   1040 <grecs_list_clear@plt>
mov    -0x8(%rbp),%rdi
call   1030 <grecs_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.grecs_list = type { i32 }
define void @grecs_list_free(%struct.grecs_list* %0) {
%2 = alloca %struct.grecs_list*
store %struct.grecs_list* %0, %struct.grecs_list** %2
%3 = load %struct.grecs_list*, %struct.grecs_list** %2
%4 = icmp ne %struct.grecs_list* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load %struct.grecs_list*, %struct.grecs_list** %2
%7 = call i32 @grecs_list_clear(%struct.grecs_list* %6)
%8 = load %struct.grecs_list*, %struct.grecs_list** %2
%9 = call i32 @grecs_free(%struct.grecs_list* %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.grecs_list = type { i32 }
define void @grecs_list_free(%struct.grecs_list* %0) {
%2 = icmp eq %struct.grecs_list* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @grecs_list_clear(%struct.grecs_list* %0)
%5 = tail call i32 @grecs_free(%struct.grecs_list* %0)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *fcitx_utils_malloc(size_t size) {
  void *result = malloc(size);
  if (!result) {
    abort();
  }
  return result;
}


x86 assembly (clang, -O0):
<fcitx_utils_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    114b <fcitx_utils_malloc+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcitx_utils_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <fcitx_utils_malloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @fcitx_utils_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 %10, label %8
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @fcitx_utils_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
long numDigits(long n) {
  long len = 0;
  while (n) {
    n = n / 10;
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<numDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <numDigits+0x3e>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <numDigits+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numDigits>:
xor    %ecx,%ecx
test   %rdi,%rdi
je     1145 <numDigits+0x45>
movabs $0x6666666666666667,%rsi
66 66 66
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
imul   %rsi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
add    $0x1,%rcx
add    $0x9,%rdi
cmp    $0x12,%rdi
mov    %rdx,%rdi
ja     1120 <numDigits+0x20>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @numDigits(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %7, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i64, i64* %2
%9 = sdiv i64 %8, 10
store i64 %9, i64* %2
%10 = load i64, i64* %3
%11 = add nsw i64 %10, 1
store i64 %11, i64* %3
br label %4
12: ; preds = %4
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @numDigits(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i64 %5, 10
%7 = add nuw nsw i64 %4, 1
%8 = add i64 %5, 9
%9 = icmp ult i64 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i64 [ 0, %1 ], [ %7, %3 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ TestEmbedChars();
int /*<<< orphan*/ TestEmbedString();
int /*<<< orphan*/ TestFiles();
int /*<<< orphan*/ TestMaskBits();
int /*<<< orphan*/ printf(char *);
int main() {
  TestMaskBits();
  printf("\n");
  TestEmbedChars();
  printf("\n");
  TestEmbedString();
  printf("\n");
  TestFiles();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <TestMaskBits@plt>
lea    0xe93(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1060 <TestEmbedChars@plt>
lea    0xe80(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1040 <TestEmbedString@plt>
lea    0xe6d(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1030 <TestFiles@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <TestMaskBits@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1070 <TestEmbedChars@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <TestEmbedString@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <TestFiles@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @TestMaskBits()
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 (...) @TestEmbedChars()
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 (...) @TestEmbedString()
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 (...) @TestFiles()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ indirectyE();
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc8(int /*<<< orphan*/);
void sbcIndirectyE(void) { sbc8(readmem65816(indirectyE())); }


x86 assembly (clang, -O0):
<sbcIndirectyE>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <indirectyE@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <sbc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcIndirectyE>:
push   %rax
xor    %eax,%eax
call   1040 <indirectyE@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sbc8@plt>

LLVM IR (-O0):
define void @sbcIndirectyE() {
%1 = call i32 (...) @indirectyE()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @sbc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcIndirectyE() {
%1 = tail call i32 (...) @indirectyE()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @sbc8(i32 %2)
ret void
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec3_one(float *);
__attribute__((always_)) struct vec3 *psvec3_one(struct vec3 *result) {
  vec3_one((float *)result);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec3_one>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3_one@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_one(%struct.vec3* %0) {
%2 = alloca %struct.vec3*
store %struct.vec3* %0, %struct.vec3** %2
%3 = load %struct.vec3*, %struct.vec3** %2
%4 = bitcast %struct.vec3* %3 to float*
%5 = call i32 @vec3_one(float* %4)
%6 = load %struct.vec3*, %struct.vec3** %2
ret %struct.vec3* %6
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_one(%struct.vec3* returned %0) {
%2 = bitcast %struct.vec3* %0 to float*
%3 = tail call i32 @vec3_one(float* %2)
ret %struct.vec3* %0
}
int enclave_unlink() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @enclave_unlink() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcscspn(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void uninitvar_wcscspn(void) {
  wchar_t *cs;
  wchar_t *ct;
  (void)wcscspn(cs, ct);
}


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

x86 assembly (clang, -O2):
<uninitvar_wcscspn>:
jmp    1030 <wcscspn@plt>

LLVM IR (-O0):
define void @uninitvar_wcscspn() {
%1 = alloca i32*
%2 = alloca i32*
%3 = load i32*, i32** %1
%4 = load i32*, i32** %2
%5 = call i32 @wcscspn(i32* %3, i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wcscspn() {
%1 = tail call i32 @wcscspn(i32* undef, i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
void bitmap_c64_name(int num, char *dir, char *out) {
  if (num == 0)
    sprintf(out, "%stitle mpic", dir);
  else
    sprintf(out, "%spic%d", dir, num);
}


x86 assembly (clang, -O0):
<bitmap_c64_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1148 <bitmap_c64_name+0x38>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    1161 <bitmap_c64_name+0x51>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x4(%rbp),%ecx
lea    0xeb3(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_c64_name>:
mov    %rdx,%rax
mov    %rsi,%rdx
test   %edi,%edi
je     112d <bitmap_c64_name+0x1d>
mov    %edi,%ecx
lea    0xeea(%rip),%rsi
mov    %rax,%rdi
xor    %eax,%eax
jmp    1030 <sprintf@plt>
lea    0xecc(%rip),%rsi
mov    %rax,%rdi
xor    %eax,%eax
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%stitle mpic\00"
@.str.1 = [8 x i8] c"%spic%d\00"
define void @bitmap_c64_name(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %6
%11 = load i8*, i8** %5
%12 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %18
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = load i8*, i8** %5
%16 = load i32, i32* %4
%17 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %15, i32 %16)
br label %18
18: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%stitle mpic\00"
@.str.1 = [8 x i8] c"%spic%d\00"
define void @bitmap_c64_name(i32 %0, i8* %1, i8* nocapture writeonly %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (i8*, i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %9
7: ; preds = %3
%8 = tail call i32 (i8*, i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %0)
br label %9
9: ; preds = %7, %5
ret void
}