xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strcasecmp(char *, char *);
int strcmp(char *, char *);
main() {
  int k;
  printf("%d\n", strcmp("ABC", "abc"));
  printf("%d\n", strcasecmp("ABC", "abc"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec5(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1050 <strcmp@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
lea    0xea1(%rip),%rsi
call   1030 <strcasecmp@plt>
mov    %eax,%esi
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xffffffff,%esi
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1030 <strcasecmp@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"ABC\00"
@.str.2 = [4 x i8] c"abc\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -1)
%2 = tail call i32 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Type definitions */
struct hostent {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int _nss_localtld_gethostbyname2_r(char const *, int /*<<< orphan*/,
                                   struct hostent *, char *, size_t, int *,
                                   int *);
enum nss_status _nss_localtld_gethostbyname_r(const char *name,
                                              struct hostent *result,
                                              char *buffer, size_t buflen,
                                              int *errnop, int *h_errnop) {
  return _nss_localtld_gethostbyname2_r(name, AF_INET, result, buffer, buflen,
                                        errnop, h_errnop);
}


x86 assembly (clang, -O0):
<_nss_localtld_gethostbyname_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <_nss_localtld_gethostbyname2_r@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_localtld_gethostbyname_r>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    0x2ec4(%rip),%rsi
mov    (%rsi),%esi
mov    %r9,(%rsp)
mov    %rax,%r9
call   1030 <_nss_localtld_gethostbyname2_r@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
@AF_INET = global i32 0
define i32 @_nss_localtld_gethostbyname_r(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, i32* %4, i32* %5) {
%7 = alloca i8*
%8 = alloca %struct.hostent*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32*
%12 = alloca i32*
store i8* %0, i8** %7
store %struct.hostent* %1, %struct.hostent** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%13 = load i8*, i8** %7
%14 = load i32, i32* @AF_INET
%15 = load %struct.hostent*, %struct.hostent** %8
%16 = load i8*, i8** %9
%17 = load i64, i64* %10
%18 = load i32*, i32** %11
%19 = load i32*, i32** %12
%20 = call i32 @_nss_localtld_gethostbyname2_r(i8* %13, i32 %14, %struct.hostent* %15, i8* %16, i64 %17, i32* %18, i32* %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@AF_INET = global i32 0
define i32 @_nss_localtld_gethostbyname_r(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, i32* %4, i32* %5) {
%7 = load i32, i32* @AF_INET
%8 = tail call i32 @_nss_localtld_gethostbyname2_r(i8* %0, i32 %7, %struct.hostent* %1, i8* %2, i64 %3, i32* %4, i32* %5)
ret i32 %8
}
_Noreturn void _start(int argc, char *argv[]) {
  int ret = main(argc, argv);
  exit(ret);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <main@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @_start(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @main to i32 (i32, i8**, ...)*)(i32 %6, i8** %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
unreachable
}

LLVM IR (-O2):
define void @_start(i32 %0, i8** %1) {
%3 = tail call i32 (i32, i8**, ...) bitcast (i32 (...)* @main to i32 (i32, i8**, ...)*)(i32 %0, i8** %1)
tail call void @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ p;

/* Variables and functions */
int *malloc(int);
int *malloc_returned_ok() {
  int *p = malloc(sizeof(p));
  return p;
}


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

x86 assembly (clang, -O2):
<malloc_returned_ok>:
mov    $0x8,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @malloc_returned_ok() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 8)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
ret i32* %3
}

LLVM IR (-O2):
define noalias i32* @malloc_returned_ok() {
%1 = tail call i32* @malloc(i32 8)
ret i32* %1
}
/* Variables and functions */
scalar_t__ starts_withn(char const *, char *, int);
int is_rooted_trash_dir(const char spec[]) {
  return starts_withn((spec), ("%r/"),
                      sizeof("%r/") / sizeof(("%r/")[0]) - 1U) &&
         spec[(sizeof("%r/") - 1)] != '\0';
}


x86 assembly (clang, -O0):
<is_rooted_trash_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x3,%edx
call   1030 <starts_withn@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1154 <is_rooted_trash_dir+0x44>
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_rooted_trash_dir>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x3,%edx
call   1030 <starts_withn@plt>
test   %rax,%rax
je     1135 <is_rooted_trash_dir+0x25>
xor    %eax,%eax
cmpb   $0x0,0x3(%rbx)
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%r/\00"
define i32 @is_rooted_trash_dir(i8* %0) {
%2 = tail call i64 @starts_withn(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
float __attribute__((no)) float_min2(float a, float b) {
  return ((a) <= (b) ? (a) : (b));
}


x86 assembly (clang, -O0):
<float_min2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1130 <float_min2+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <float_min2+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_min2>:
movaps %xmm0,%xmm2
cmpless %xmm1,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @float_min2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ole float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @float_min2(float %0, float %1) {
%3 = fcmp ole float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
void kasan_record_aux_stack(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @kasan_record_aux_stack(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ REAL_internal_gamemode_request_end();
scalar_t__ internal_load_libgamemode();
__attribute__((always_)) int gamemode_request_end(void) {
  if (internal_load_libgamemode() < 0) {
    return -1;
  }
  if (REAL_internal_gamemode_request_end() < 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<gamemode_request_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <internal_load_libgamemode@plt>
cmp    $0x0,%rax
jge    1145 <gamemode_request_end+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <gamemode_request_end+0x49>
mov    $0x0,%al
call   1030 <REAL_internal_gamemode_request_end@plt>
cmp    $0x0,%rax
jge    1162 <gamemode_request_end+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <gamemode_request_end+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamemode_request_end>:
push   %rax
xor    %eax,%eax
call   1040 <internal_load_libgamemode@plt>
test   %rax,%rax
js     113a <gamemode_request_end+0x1a>
xor    %eax,%eax
call   1030 <REAL_internal_gamemode_request_end@plt>
sar    $0x3f,%rax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gamemode_request_end() {
%1 = tail call i64 (...) @internal_load_libgamemode()
%2 = icmp slt i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i64 (...) @REAL_internal_gamemode_request_end()
%5 = ashr i64 %4, 63
%6 = trunc i64 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ -1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef unsigned long FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(unsigned long *);
int read_uint32_from_file(unsigned long *, int /*<<< orphan*/ *);
int read_unsigned_long_int_from_file(FILE *f, unsigned long int *num) {
  assert(f);
  assert(num);
  return read_uint32_from_file(f, (uint32_t *)num);
}


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

x86 assembly (clang, -O2):
<read_unsigned_long_int_from_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <read_uint32_from_file@plt>

LLVM IR (-O0):
define i32 @read_unsigned_long_int_from_file(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = call i32 @assert(i64* %5)
%7 = load i64*, i64** %4
%8 = call i32 @assert(i64* %7)
%9 = load i64*, i64** %3
%10 = load i64*, i64** %4
%11 = bitcast i64* %10 to i32*
%12 = call i32 @read_uint32_from_file(i64* %9, i32* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @read_unsigned_long_int_from_file(i64* %0, i64* %1) {
%3 = tail call i32 @assert(i64* %0)
%4 = tail call i32 @assert(i64* %1)
%5 = bitcast i64* %1 to i32*
%6 = tail call i32 @read_uint32_from_file(i64* %0, i32* %5)
ret i32 %6
}
void ff_hevc_put_hevc_bi_epel_hv24_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv24_10_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sw_setup_lines();
int /*<<< orphan*/ sw_setup_timer();
void sw_setup(void) {
  sw_setup_lines();
  sw_setup_timer();
}


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

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

LLVM IR (-O0):
define void @sw_setup() {
%1 = call i32 (...) @sw_setup_lines()
%2 = call i32 (...) @sw_setup_timer()
ret void
}

LLVM IR (-O2):
define void @sw_setup() {
%1 = tail call i32 (...) @sw_setup_lines()
%2 = tail call i32 (...) @sw_setup_timer()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_cmd(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  int i;
  setbuf(stdout, NULL);
  for (i = 1; i < argc; i++)
    do_cmd(argv[i]);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    118a <main+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <do_cmd@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115f <main+0x2f>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <setbuf@plt>
cmp    $0x2,%ebp
jl     1172 <main+0x42>
mov    %ebp,%ebp
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1040 <do_cmd@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1160 <main+0x30>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @setbuf(i32 %3, i32* null)
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %15
6: ; preds = %2
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 1, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @do_cmd(i8* %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %2
%16 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double M_PI;
double quadrat(int);
double kreis_flaeche(int zahl) { return M_PI * quadrat(zahl); }


x86 assembly (clang, -O0):
<kreis_flaeche>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <quadrat@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kreis_flaeche>:
push   %rax
mov    0x2ed0(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,(%rsp)
call   1030 <quadrat@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @kreis_flaeche(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load double, double* @M_PI
%4 = load i32, i32* %2
%5 = call double @quadrat(i32 %4)
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @kreis_flaeche(i32 %0) {
%2 = load double, double* @M_PI
%3 = tail call double @quadrat(i32 %0)
%4 = fmul double %2, %3
ret double %4
}
/* Variables and functions */
int ArgNum();
scalar_t__ GetFlag(int);
int /*<<< orphan*/ SetFlag(int, scalar_t__);
void Act_AddF(void) {
  int a = ArgNum();
  SetFlag(a, GetFlag(a) + GetFlag(ArgNum()));
}


x86 assembly (clang, -O0):
<Act_AddF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <ArgNum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <GetFlag@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <ArgNum@plt>
mov    %eax,%edi
call   1040 <GetFlag@plt>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edi
add    %rax,%rsi
call   1030 <SetFlag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_AddF>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <ArgNum@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <GetFlag@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <ArgNum@plt>
mov    %eax,%edi
call   1040 <GetFlag@plt>
add    %rax,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <SetFlag@plt>

LLVM IR (-O0):
define void @Act_AddF() {
%1 = alloca i32
%2 = call i32 (...) @ArgNum()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = call i64 @GetFlag(i32 %4)
%6 = call i32 (...) @ArgNum()
%7 = call i64 @GetFlag(i32 %6)
%8 = add nsw i64 %5, %7
%9 = call i32 @SetFlag(i32 %3, i64 %8)
ret void
}

LLVM IR (-O2):
define void @Act_AddF() {
%1 = tail call i32 (...) @ArgNum()
%2 = tail call i64 @GetFlag(i32 %1)
%3 = tail call i32 (...) @ArgNum()
%4 = tail call i64 @GetFlag(i32 %3)
%5 = add nsw i64 %4, %2
%6 = tail call i32 @SetFlag(i32 %1, i64 %5)
ret void
}
void RTSemEventCreateEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemEventCreateEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_init();
int /*<<< orphan*/ uart_puts(char *);
int main() {
  uart_init();
  uart_puts("Hello, World!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, World!\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @uart_init()
%2 = tail call i32 @uart_puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *lrealloc(char *, scalar_t__);
int /*<<< orphan*/ strlcpy(char *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
char *lrestrdup(char *old, const char *new) {
  char *result = lrealloc(old, strlen(new) + 1);
  strlcpy(result, new, strlen(new) + 1);
  return result;
}


x86 assembly (clang, -O0):
<lrestrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1040 <lrealloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1050 <strlcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrestrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %r14,%rdi
call   1040 <lrealloc@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strlcpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @lrestrdup(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
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @lrealloc(i8* %6, i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = load i8*, i8** %4
%14 = call i64 @strlen(i8* %13)
%15 = add nsw i64 %14, 1
%16 = call i32 @strlcpy(i8* %11, i8* %12, i64 %15)
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @lrestrdup(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @lrealloc(i8* %0, i64 %4)
%6 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%7 = add nsw i64 %6, 1
%8 = tail call i32 @strlcpy(i8* %5, i8* %1, i64 %7)
ret i8* %5
}
/* Variables and functions */
int rand();
int main(int argc, char **argv) {
  int x, y;
  int r = rand();
  if (0 == r) {
    rand();
    y = rand();
    x = 7;
  } else {
    y = rand();
    x = 42;
  }
  return x;
}


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    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmp    -0x1c(%rbp),%eax
jne    1158 <main+0x48>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x7,-0x14(%rbp)
jmp    1169 <main+0x59>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
mov    $0x2a,%eax
test   %ebx,%ebx
je     112c <main+0x1c>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <rand@plt>
mov    $0x7,%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 i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (...) @rand()
store i32 %9, i32* %8
%10 = load i32, i32* %8
%11 = icmp eq i32 0, %10
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 (...) @rand()
%14 = call i32 (...) @rand()
store i32 %14, i32* %7
store i32 7, i32* %6
br label %17
15: ; preds = %2
%16 = call i32 (...) @rand()
store i32 %16, i32* %7
store i32 42, i32* %6
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %6
ret i32 %18
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = icmp eq i32 %3, 0
%5 = tail call i32 (...) @rand()
br i1 %4, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @rand()
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ 7, %6 ], [ 42, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void KTError(char *msg, char *str) {
  fprintf(stderr, "keytouch-init: ");
  fprintf(stderr, msg, str);
  putc('\n', stderr);
}


x86 assembly (clang, -O0):
<KTError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KTError>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eae(%rip),%r15
mov    (%r15),%edi
lea    0xec4(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%esi
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"keytouch-init: \00"
define void @KTError(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* %8, i8* %9)
%11 = load i32, i32* @stderr
%12 = call i32 @putc(i8 signext 10, i32 %11)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"keytouch-init: \00"
define void @KTError(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* %0, i8* %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 @putc(i8 signext 10, i32 %7)
ret void
}
int test_imm_68uint16_reg(unsigned short val) {
  return ((val) & (-0x68 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_68uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -104
%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_68uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -104
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  printf("sum = %d\n", 3 + 4);
  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
mov    $0x7,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"sum = %d\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 ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"sum = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int show_menu() {
  printf("*************** Menu ******************************\n");
  printf("* ps  chname  fork  switch  wait  exit debug exec *\n");
  printf("***************************************************\n");
}


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

x86 assembly (clang, -O2):
<show_menu>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf10(%rip),%rdi
call   1030 <puts@plt>
lea    0xf38(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"*************** Menu ******************************\0A\00"
@.str.1 = [53 x i8] c"* ps chname fork switch wait exit debug exec *\0A\00"
@.str.2 = [53 x i8] c"***************************************************\0A\00"
define i32 @show_menu() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@str = [52 x i8] c"*************** Menu ******************************\00"
@str.3 = [52 x i8] c"* ps chname fork switch wait exit debug exec *\00"
@str.4 = [52 x i8] c"***************************************************\00"
define i32 @show_menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.4, i64 0, i64 0))
ret i32 undef
}
_Bool line_hdr_cont(struct line *l) {
  return line_starts(l, " ") || line_starts(l, "\t");
}


x86 assembly (clang, -O0):
<line_hdr_cont>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1030 <line_starts@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    1159 <line_hdr_cont+0x49>
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   1030 <line_starts@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_hdr_cont>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
xor    %eax,%eax
call   1030 <line_starts@plt>
mov    %eax,%ecx
mov    $0x1,%al
test   %ecx,%ecx
je     112c <line_hdr_cont+0x1c>
pop    %rbx
ret
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <line_starts@plt>
test   %eax,%eax
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.line = type opaque
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"\09\00"
define zeroext i1 @line_hdr_cont(%struct.line* %0) {
%2 = alloca %struct.line*
store %struct.line* %0, %struct.line** %2
%3 = load %struct.line*, %struct.line** %2
%4 = call i32 (%struct.line*, i8*, ...) bitcast (i32 (...)* @line_starts to i32 (%struct.line*, i8*, ...)*)(%struct.line* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load %struct.line*, %struct.line** %2
%8 = call i32 (%struct.line*, i8*, ...) bitcast (i32 (...)* @line_starts to i32 (%struct.line*, i8*, ...)*)(%struct.line* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
ret i1 %11
}

LLVM IR (-O2):
%struct.line = type opaque
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"\09\00"
define zeroext i1 @line_hdr_cont(%struct.line* %0) {
%2 = tail call i32 (%struct.line*, i8*, ...) bitcast (i32 (...)* @line_starts to i32 (%struct.line*, i8*, ...)*)(%struct.line* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 (%struct.line*, i8*, ...) bitcast (i32 (...)* @line_starts to i32 (%struct.line*, i8*, ...)*)(%struct.line* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br label %7
7: ; preds = %4, %1
%8 = phi i1 [ true, %1 ], [ %6, %4 ]
ret i1 %8
}
/* Variables and functions */
int /*<<< orphan*/ unsetenv(char *);
void sanitizeenv(void) {
  unsetenv("COLUMNS");
  unsetenv("DISPLAY");
  unsetenv("INPUTRC");
  unsetenv("LINES");
  unsetenv("SHLVL");
  unsetenv("TERM");
}


x86 assembly (clang, -O0):
<sanitizeenv>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <unsetenv@plt>
lea    0xee1(%rip),%rdi
call   1030 <unsetenv@plt>
lea    0xedd(%rip),%rdi
call   1030 <unsetenv@plt>
lea    0xed9(%rip),%rdi
call   1030 <unsetenv@plt>
lea    0xed3(%rip),%rdi
call   1030 <unsetenv@plt>
lea    0xecd(%rip),%rdi
call   1030 <unsetenv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sanitizeenv>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <unsetenv@plt>
lea    0xee4(%rip),%rdi
call   1030 <unsetenv@plt>
lea    0xee0(%rip),%rdi
call   1030 <unsetenv@plt>
lea    0xedc(%rip),%rdi
call   1030 <unsetenv@plt>
lea    0xed6(%rip),%rdi
call   1030 <unsetenv@plt>
lea    0xed0(%rip),%rdi
pop    %rax
jmp    1030 <unsetenv@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"COLUMNS\00"
@.str.1 = [8 x i8] c"DISPLAY\00"
@.str.2 = [8 x i8] c"INPUTRC\00"
@.str.3 = [6 x i8] c"LINES\00"
@.str.4 = [6 x i8] c"SHLVL\00"
@.str.5 = [5 x i8] c"TERM\00"
define void @sanitizeenv() {
%1 = call i32 @unsetenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @unsetenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @unsetenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @unsetenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @unsetenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @unsetenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"COLUMNS\00"
@.str.1 = [8 x i8] c"DISPLAY\00"
@.str.2 = [8 x i8] c"INPUTRC\00"
@.str.3 = [6 x i8] c"LINES\00"
@.str.4 = [6 x i8] c"SHLVL\00"
@.str.5 = [5 x i8] c"TERM\00"
define void @sanitizeenv() {
%1 = tail call i32 @unsetenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @unsetenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @unsetenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @unsetenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @unsetenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 @unsetenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret void
}
unsigned int IWM_SCD_QUEUE_WRPTR(unsigned int chnl) {
  if (chnl < 20)
    return ((0x00000) + 0xa02c00) + 0x18 + chnl * 4;
  return ((0x00000) + 0xa02c00) + 0x284 + (chnl - 20) * 4;
}


x86 assembly (clang, -O0):
<IWM_SCD_QUEUE_WRPTR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jae    1124 <IWM_SCD_QUEUE_WRPTR+0x24>
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
add    $0xa02c18,%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <IWM_SCD_QUEUE_WRPTR+0x35>
mov    -0x8(%rbp),%eax
sub    $0x14,%eax
shl    $0x2,%eax
add    $0xa02e84,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IWM_SCD_QUEUE_WRPTR>:
cmp    $0x14,%edi
lea    0xa02c18(,%rdi,4),%ecx
lea    0xa02e34(,%rdi,4),%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @IWM_SCD_QUEUE_WRPTR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ult i32 %4, 20
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = mul i32 %7, 4
%9 = add i32 10497048, %8
store i32 %9, i32* %2
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub i32 %11, 20
%13 = mul i32 %12, 4
%14 = add i32 10497668, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %10, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @IWM_SCD_QUEUE_WRPTR(i32 %0) {
%2 = icmp ult i32 %0, 20
%3 = shl i32 %0, 2
%4 = select i1 %2, i32 10497048, i32 10497588
%5 = add i32 %4, %3
ret i32 %5
}
/* Type definitions */
struct tempfile {
  int dummy;
};

/* Variables and functions */
struct tempfile *mks_tempfile_sm(char const *, int, int);
struct tempfile *mks_tempfile_s(const char *filename_template, int suffixlen) {
  return mks_tempfile_sm(filename_template, suffixlen, 0600);
}


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

x86 assembly (clang, -O2):
<mks_tempfile_s>:
mov    $0x180,%edx
jmp    1030 <mks_tempfile_sm@plt>

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

LLVM IR (-O2):
%struct.tempfile = type { i32 }
define %struct.tempfile* @mks_tempfile_s(i8* %0, i32 %1) {
%3 = tail call %struct.tempfile* @mks_tempfile_sm(i8* %0, i32 %1, i32 384)
ret %struct.tempfile* %3
}
/* Variables and functions */
int /*<<< orphan*/ my_reboot(int);
void do_halt(void) { my_reboot(0xCDEF0123); }


x86 assembly (clang, -O0):
<do_halt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcdef0123,%edi
call   1030 <my_reboot@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_halt>:
mov    $0xcdef0123,%edi
jmp    1030 <my_reboot@plt>

LLVM IR (-O0):
define void @do_halt() {
%1 = call i32 @my_reboot(i32 -839974621)
ret void
}

LLVM IR (-O2):
define void @do_halt() {
%1 = tail call i32 @my_reboot(i32 -839974621)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printTopBottomBoarder() {
  printf("   --------------------     --------------------     "
         "--------------------\n");
}


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

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

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

LLVM IR (-O2):
@str = [74 x i8] c" -------------------- -------------------- --------------------\00"
define void @printTopBottomBoarder() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
ret void
}
void foo_1_1_2_2_1_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_1_2_2_2_1() {
ret void
}
void arm_dt_init_cpu_maps(void) {}


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

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

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

LLVM IR (-O2):
define void @arm_dt_init_cpu_maps() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
int /*<<< orphan*/ padding(int);
void vt52cuf1(void) {
  esc("C");
  padding(5);
}


x86 assembly (clang, -O0):
<vt52cuf1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <esc@plt>
mov    $0x5,%edi
call   1030 <padding@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt52cuf1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <esc@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <padding@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"C\00"
define void @vt52cuf1() {
%1 = call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @padding(i32 5)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"C\00"
define void @vt52cuf1() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @padding(i32 5)
ret void
}
/* Variables and functions */
int strncasecmp(char const *, char const *, size_t);
int strnicmp(const char *s1, const char *s2, size_t len) {
  return strncasecmp(s1, s2, len);
}


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

x86 assembly (clang, -O2):
<strnicmp>:
jmp    1030 <strncasecmp@plt>

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

LLVM IR (-O2):
define i32 @strnicmp(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @strncasecmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SYS_write;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, char *, int);
main() { syscall(SYS_write, 1, "\nHello\n", 7); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
lea    0xed7(%rip),%rdx
mov    $0x7,%ecx
call   1030 <syscall@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rdx
mov    $0x1,%esi
mov    $0x7,%ecx
call   1030 <syscall@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SYS_write = global i32 0
@.str = [8 x i8] c"\0AHello\0A\00"
define i32 @main() {
%1 = load i32, i32* @SYS_write
%2 = call i32 @syscall(i32 %1, i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}

LLVM IR (-O2):
@SYS_write = global i32 0
@.str = [8 x i8] c"\0AHello\0A\00"
define i32 @main() {
%1 = load i32, i32* @SYS_write
%2 = tail call i32 @syscall(i32 %1, i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}
int GreatestCommonDenominator(int iNumber1, int iNumber2) {
  int iGCD = iNumber2;
  int iOther = iNumber1;
  while (iOther % iGCD != 0) {
    int iGCDTmp = iGCD;
    int iOtherTmp = iOther;
    iOther = iGCDTmp;
    iGCD = iOtherTmp % iGCDTmp;
  }
  return iGCD;
}


x86 assembly (clang, -O0):
<GreatestCommonDenominator>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1147 <GreatestCommonDenominator+0x47>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %edx,-0xc(%rbp)
jmp    1116 <GreatestCommonDenominator+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GreatestCommonDenominator>:
mov    %esi,%edx
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <GreatestCommonDenominator+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @GreatestCommonDenominator(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
store i32 %9, i32* %5
%10 = load i32, i32* %3
store i32 %10, i32* %6
br label %11
11: ; preds = %16, %2
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %23
16: ; preds = %11
%17 = load i32, i32* %5
store i32 %17, i32* %7
%18 = load i32, i32* %6
store i32 %18, i32* %8
%19 = load i32, i32* %7
store i32 %19, i32* %6
%20 = load i32, i32* %8
%21 = load i32, i32* %7
%22 = srem i32 %20, %21
store i32 %22, i32* %5
br label %11
23: ; preds = %11
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @GreatestCommonDenominator(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %5, %3 ]
%5 = phi i32 [ %1, %2 ], [ %6, %3 ]
%6 = srem i32 %4, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %5
}