xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ CG_Printf(char *, char *);
void regerror(char *string) { CG_Printf("%s", string); }


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

x86 assembly (clang, -O2):
<regerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <CG_Printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @regerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @CG_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @regerror(i8* %0) {
%2 = tail call i32 @CG_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  extern char *__progname;
  fprintf(stderr, "usage: %s template infile outfile\n", __progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%rdx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"usage: %s template infile outfile\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"usage: %s template infile outfile\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
call1d(ul, uc, us, ui) unsigned long ul;
unsigned char uc;
unsigned short us;
unsigned int ui;
{
  uc = 5;
  us = 6;
  ui = 7;
  ul = 8;
}


x86 assembly (clang, -O0):
<call1d>:
push   %rbp
mov    %rsp,%rbp
mov    %edx,%eax
mov    %sil,%dl
mov    %rdi,-0x10(%rbp)
mov    %dl,-0x11(%rbp)
mov    %ax,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movb   $0x5,-0x11(%rbp)
movw   $0x6,-0x14(%rbp)
movl   $0x7,-0x18(%rbp)
movq   $0x8,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call1d(i64 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i8
%8 = alloca i16
%9 = alloca i32
%10 = trunc i32 %1 to i8
%11 = trunc i32 %2 to i16
store i64 %0, i64* %6
store i8 %10, i8* %7
store i16 %11, i16* %8
store i32 %3, i32* %9
store i8 5, i8* %7
store i16 6, i16* %8
store i32 7, i32* %9
store i64 8, i64* %6
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @call1d(i64 %0, i32 %1, i32 %2, i32 %3) {
ret i32 undef
}
int get_kind(int v) {
  volatile int k = v;
  return k;
}


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

x86 assembly (clang, -O2):
<get_kind>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @get_kind(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 %0, i32* %2
%4 = load volatile i32, i32* %2
ret i32 %4
}
/* Variables and functions */
char *strchr(const char *str, int c) {
  while (*str && *str != c)
    ++str;
  if (!*str && c)
    return NULL;
  else
    return (char *)str;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     1130 <strchr+0x30>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1140 <strchr+0x40>
jmp    1151 <strchr+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1175 <strchr+0x75>
cmpl   $0x0,-0x14(%rbp)
je     1175 <strchr+0x75>
movq   $0x0,-0x8(%rbp)
jmp    117d <strchr+0x7d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %ecx,%ecx
je     1120 <strchr+0x20>
cmp    %esi,%ecx
jne    1110 <strchr+0x10>
xor    %eax,%eax
test   %cl,%cl
cmovne %rdi,%rax
test   %esi,%esi
cmove  %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = sext i8 %5 to i32
%8 = icmp eq i32 %7, %1
%9 = or i1 %6, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = icmp ne i32 %1, 0
%13 = and i1 %12, %6
%14 = select i1 %13, i8* null, i8* %4
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int foo(int, int /*<<< orphan*/);
int main() {
  if (foo(2, 0) != 2)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
xor    %esi,%esi
call   1040 <foo@plt>
cmp    $0x2,%eax
je     114b <main+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
xor    %esi,%esi
call   1040 <foo@plt>
cmp    $0x2,%eax
jne    1136 <main+0x16>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 2, i32 0)
%3 = icmp ne i32 %2, 2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 2, i32 0)
%2 = icmp eq i32 %1, 2
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ test_read_write(char *, char *);
int main(int argc, char *argv[]) {
  if (argc != 3) {
    printf("%s [input bmpname] [output bmpname]\n", argv[0]);
    return -1;
  }
  test_read_write(argv[1], argv[2]);
  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)
cmpl   $0x3,-0x8(%rbp)
je     115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <main+0x5b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <test_read_write@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jne    1137 <main+0x17>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <test_read_write@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsi),%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"%s [input bmpname] [output bmpname]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 -1, i32* %3
br label %21
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i32 @test_read_write(i8* %16, i8* %19)
store i32 0, i32* %3
br label %21
21: ; preds = %13, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [37 x i8] c"%s [input bmpname] [output bmpname]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %13
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @test_read_write(i8* %9, i8* %11)
br label %13
13: ; preds = %7, %4
%14 = phi i32 [ -1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int random();
void init_arr(int *arr, const size_t len) {
  size_t i;
  for (i = 0; i < len; i++)
    arr[i] = 1 + random();
}


x86 assembly (clang, -O0):
<init_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115e <init_arr+0x4e>
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,%edx
add    $0x1,%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <init_arr+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_arr>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1147 <init_arr+0x37>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <random@plt>
add    $0x1,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <init_arr+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @init_arr(i32* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = tail call i32 (...) @random()
%7 = add nsw i32 %6, 1
%8 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %7, i32* %8
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret void
}
void _Z5__GNWv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @_Z5__GNWv() {
ret void
}
int execute_lookup_dcookie() { return 0; }


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

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

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

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

/* Variables and functions */
scalar_t__ cc_up_is_valid_system_return(int /*<<< orphan*/, char *);
int /*<<< orphan*/ system(char *);
int32_t cc_uci_system_shell(char *command) {
  pid_t status;
  status = system(command);
  if (cc_up_is_valid_system_return(status, command) < 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cc_uci_system_shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <system@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <cc_up_is_valid_system_return@plt>
cmp    $0x0,%rax
jge    115a <cc_uci_system_shell+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <cc_uci_system_shell+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_uci_system_shell>:
push   %rbx
mov    %rdi,%rbx
call   1040 <system@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <cc_up_is_valid_system_return@plt>
sar    $0x3f,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cc_uci_system_shell(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @system(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i8*, i8** %3
%9 = call i64 @cc_up_is_valid_system_return(i32 %7, i8* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @cc_uci_system_shell(i8* %0) {
%2 = tail call i32 @system(i8* %0)
%3 = tail call i64 @cc_up_is_valid_system_return(i32 %2, i8* %0)
%4 = ashr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void new_line() { putchar('\n'); }


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

x86 assembly (clang, -O2):
<new_line>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @new_line() {
%1 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @new_line() {
%1 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RST(int, int, int);
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_0xf7(void) {
  RST(0x30, 5, 8);
  T_WAIT_UNTIL(11);
  return;
}


x86 assembly (clang, -O0):
<op_0xf7>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30,%edi
mov    $0x5,%esi
mov    $0x8,%edx
call   1030 <RST@plt>
mov    $0xb,%edi
call   1040 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_0xf7>:
push   %rax
mov    $0x30,%edi
mov    $0x5,%esi
mov    $0x8,%edx
call   1030 <RST@plt>
mov    $0xb,%edi
pop    %rax
jmp    1040 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_0xf7() {
%1 = call i32 @RST(i32 48, i32 5, i32 8)
%2 = call i32 @T_WAIT_UNTIL(i32 11)
ret void
}

LLVM IR (-O2):
define void @op_0xf7() {
%1 = tail call i32 @RST(i32 48, i32 5, i32 8)
%2 = tail call i32 @T_WAIT_UNTIL(i32 11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strncmp(char *, char *, int);
void strncmp_diff_length_0() {
  char *x = "12345";
  char *y = "234";
  clang_analyzer_eval(strncmp(x, y, 5) < 0);
}


x86 assembly (clang, -O0):
<strncmp_diff_length_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xecc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_diff_length_0>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
shr    $0x3f,%rax
mov    %eax,%edi
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"12345\00"
@.str.1 = [4 x i8] c"234\00"
define void @strncmp_diff_length_0() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i64 @strncmp(i8* %3, i8* %4, i32 5)
%6 = icmp slt i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"12345\00"
@.str.1 = [4 x i8] c"234\00"
define void @strncmp_diff_length_0() {
%1 = tail call i64 @strncmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
%2 = lshr i64 %1, 63
%3 = trunc i64 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
int UARTCharGetNonBlocking(unsigned int baseAdd) {
  int retVal = -1;
  if ((*((volatile unsigned int *)(baseAdd + (0x14)))) & (0x00000001u)) {
    retVal = (*((volatile unsigned int *)(baseAdd + (0x0))));
  }
  return retVal;
}


x86 assembly (clang, -O0):
<UARTCharGetNonBlocking>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1131 <UARTCharGetNonBlocking+0x31>
mov    -0x4(%rbp),%eax
add    $0x0,%eax
mov    %eax,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharGetNonBlocking>:
lea    0x14(%rdi),%ecx
mov    $0xffffffff,%eax
testl  $0x1,(%rcx)
je     1114 <UARTCharGetNonBlocking+0x14>
mov    %edi,%eax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @UARTCharGetNonBlocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
%4 = load i32, i32* %2
%5 = add i32 %4, 20
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %1
%12 = load i32, i32* %2
%13 = add i32 %12, 0
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
store i32 %16, i32* %3
br label %17
17: ; preds = %11, %1
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @UARTCharGetNonBlocking(i32 %0) {
%2 = add i32 %0, 20
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = zext i32 %0 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
br label %12
12: ; preds = %8, %1
%13 = phi i32 [ %11, %8 ], [ -1, %1 ]
ret i32 %13
}
int codepageMap(int cp, int *map) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @codepageMap(i32 %0, i32* nocapture readnone %1) {
ret i32 0
}
unsigned int UARTModemStatusGet(unsigned int baseAdd) {
  return (*((volatile unsigned int *)(baseAdd + (0x18)))) &
         ((0x00000040u) | (0x00000020u) | (0x00000010u) | (0x00000008u));
}


x86 assembly (clang, -O0):
<UARTModemStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x18,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x78,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemStatusGet>:
add    $0x18,%edi
mov    (%rdi),%eax
and    $0x78,%eax
ret

LLVM IR (-O0):
define i32 @UARTModemStatusGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 24
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 120
ret i32 %8
}

LLVM IR (-O2):
define i32 @UARTModemStatusGet(i32 %0) {
%2 = add i32 %0, 24
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 120
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void enable_firewall() {
  printf("** RUN AS ADMINISTRATOR **\nEnabling firewall... [FORCED]\n");
  system("netsh advfirewall set all state on");
  printf("Done.\n");
  system("pause");
}


x86 assembly (clang, -O0):
<enable_firewall>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xf03(%rip),%rdi
call   1030 <system@plt>
lea    0xf1a(%rip),%rdi
call   1040 <printf@plt>
lea    0xf15(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_firewall>:
push   %rax
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <system@plt>
lea    0xf22(%rip),%rdi
call   1030 <puts@plt>
lea    0xed7(%rip),%rdi
pop    %rax
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"** RUN AS ADMINISTRATOR **\0AEnabling firewall... [FORCED]\0A\00"
@.str.1 = [35 x i8] c"netsh advfirewall set all state on\00"
@.str.2 = [7 x i8] c"Done.\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define void @enable_firewall() {
%1 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [35 x i8] c"netsh advfirewall set all state on\00"
@.str.3 = [6 x i8] c"pause\00"
@str = [57 x i8] c"** RUN AS ADMINISTRATOR **\0AEnabling firewall... [FORCED]\00"
@str.4 = [6 x i8] c"Done.\00"
define void @enable_firewall() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret void
}
__attribute((always_)) void glm_swapf(float *__restrict a,
                                      float *__restrict b) {
  float t;
  t = *a;
  *a = *b;
  *b = t;
}


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

x86 assembly (clang, -O2):
<glm_swapf>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movss  %xmm1,(%rdi)
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @glm_swapf(float* noalias %0, float* noalias %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = load float, float* %6
store float %7, float* %5
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = load float*, float** %3
store float %9, float* %10
%11 = load float, float* %5
%12 = load float*, float** %4
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @glm_swapf(float* noalias nocapture %0, float* noalias nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
store float %4, float* %0
store float %3, float* %1
ret void
}
double calc_Vout(double Vin, double R1, double R2) {
  return Vin * R2 / (R1 + R2);
}


x86 assembly (clang, -O0):
<calc_Vout>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_Vout>:
mulsd  %xmm2,%xmm0
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calc_Vout(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = fmul double %7, %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fadd double %10, %11
%13 = fdiv double %9, %12
ret double %13
}

LLVM IR (-O2):
define double @calc_Vout(double %0, double %1, double %2) {
%4 = fmul double %0, %2
%5 = fadd double %1, %2
%6 = fdiv double %4, %5
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void clear_log() {
  FILE *pFile;
  pFile = fopen("/var/www/active_log.txt", "w");
  fclose(pFile);
}


x86 assembly (clang, -O0):
<clear_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_log>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"/var/www/active_log.txt\00"
@.str.1 = [2 x i8] c"w\00"
define void @clear_log() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fclose(i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"/var/www/active_log.txt\00"
@.str.1 = [2 x i8] c"w\00"
define void @clear_log() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fclose(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float);
void finn_vec3_print(float *vec) {
  printf("[x: %f\ty: %f\tz: %f]\n", vec[0], vec[1], vec[2]);
}


x86 assembly (clang, -O0):
<finn_vec3_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finn_vec3_print>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  0x8(%rdi),%xmm2
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"[x: %f\09y: %f\09z: %f]\0A\00"
define void @finn_vec3_print(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 1
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 2
%11 = load float, float* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %5, float %8, float %11)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"[x: %f\09y: %f\09z: %f]\0A\00"
define void @finn_vec3_print(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = getelementptr inbounds float, float* %0, i64 2
%6 = load float, float* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %2, float %4, float %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  long tm_sec;
  int tm_isdst;
  scalar_t__ tm_min;
  scalar_t__ tm_hour;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ mktime(struct tm *);
time_t normalize_epoch(time_t epoch, long secondsinday) {
  struct tm tm;
  localtime_r(&epoch, &tm);
  tm.tm_hour = 0;
  tm.tm_min = 0;
  tm.tm_sec = secondsinday;
  tm.tm_isdst = -1;
  return mktime(&tm);
}


x86 assembly (clang, -O0):
<normalize_epoch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <localtime_r@plt>
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0xffffffff,-0x28(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <mktime@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_epoch>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%r14
mov    %r14,%rsi
call   1030 <localtime_r@plt>
xorps  %xmm0,%xmm0
movups %xmm0,0x18(%rsp)
mov    %rbx,0x8(%rsp)
movl   $0xffffffff,0x10(%rsp)
ff
mov    %r14,%rdi
call   1040 <mktime@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i64, i32, i64, i64 }
define i32 @normalize_epoch(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca %struct.tm
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = call i32 @localtime_r(i32* %3, %struct.tm* %5)
%7 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 3
store i64 0, i64* %7
%8 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 2
store i64 0, i64* %8
%9 = load i64, i64* %4
%10 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
store i64 %9, i64* %10
%11 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 1
store i32 -1, i32* %11
%12 = call i32 @mktime(%struct.tm* %5)
ret i32 %12
}

LLVM IR (-O2):
%struct.tm = type { i64, i32, i64, i64 }
define i32 @normalize_epoch(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca %struct.tm
store i32 %0, i32* %3
%5 = bitcast %struct.tm* %4 to i8*
%6 = call i32 @localtime_r(i32* %3, %struct.tm* %4)
%7 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 2
%8 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%9 = bitcast i64* %7 to i8*
store i64 %1, i64* %8
%10 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 1
store i32 -1, i32* %10
%11 = call i32 @mktime(%struct.tm* %4)
ret i32 %11
}
/* Variables and functions */
int __sapi_get_sock_type(int, char *);
int sapi_get_socktype(int sock, char *socket_type) {
  return __sapi_get_sock_type(sock, socket_type);
}


x86 assembly (clang, -O0):
<sapi_get_socktype>:
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 <__sapi_get_sock_type@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sapi_get_socktype>:
jmp    1030 <__sapi_get_sock_type@plt>

LLVM IR (-O0):
define i32 @sapi_get_socktype(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 @__sapi_get_sock_type(i32 %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sapi_get_socktype(i32 %0, i8* %1) {
%3 = tail call i32 @__sapi_get_sock_type(i32 %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ scene_deinit();
void world_deinit() { scene_deinit(); }


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

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

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

LLVM IR (-O2):
define void @world_deinit() {
%1 = tail call i32 (...) @scene_deinit()
ret void
}
/* Variables and functions */
int asserv_done();
int motion_done() { return asserv_done(); }


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

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

LLVM IR (-O0):
define i32 @motion_done() {
%1 = call i32 (...) @asserv_done()
ret i32 %1
}

LLVM IR (-O2):
define i32 @motion_done() {
%1 = tail call i32 (...) @asserv_done()
ret i32 %1
}
int icontains(int *array, int len, int a) {
  int i;
  for (i = 0; i < len; i++) {
    if (array[i] == a) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<icontains>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <icontains+0x54>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1141 <icontains+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <icontains+0x5b>
jmp    1146 <icontains+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <icontains+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icontains>:
test   %esi,%esi
jle    111e <icontains+0x1e>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rcx,4)
je     1121 <icontains+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <icontains+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @icontains(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
/* Type definitions */
struct quat {
  int dummy;
};

/* Variables and functions */
float quat_length(float *);
__attribute__((always_)) float psquat_length(struct quat *a) {
  return quat_length((float *)a);
}


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

x86 assembly (clang, -O2):
<psquat_length>:
jmp    1030 <quat_length@plt>

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

LLVM IR (-O2):
%struct.quat = type { i32 }
define float @psquat_length(%struct.quat* %0) {
%2 = bitcast %struct.quat* %0 to float*
%3 = tail call float @quat_length(float* %2)
ret float %3
}
int fn3(int a, int b) {
  int tem1 = a | b;
  int tem2 = b & a;
  return tem1 - tem2;
}


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = or i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = and i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn3(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef long long uint64_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
long long ubits(unsigned char *, unsigned int, unsigned int, int);
int64_t sbits(signed char buf[], unsigned int start, unsigned int width,
              bool le) {
  uint64_t fld = ubits((unsigned char *)buf, start, width, le);
  if (fld & (1LL << (width - 1))) {
    fld |= (-1LL << (width - 1));
  }
  return (int64_t)fld;
}


x86 assembly (clang, -O0):
<sbits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <ubits@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     117b <sbits+0x6b>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0xffffffffffffffff,%rax
shl    %cl,%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbits>:
push   %rbx
mov    %edx,%ebx
call   1030 <ubits@plt>
add    $0xff,%bl
movzbl %bl,%ecx
mov    $0xffffffffffffffff,%rdx
shl    %cl,%rdx
xor    %esi,%esi
bt     %rcx,%rax
cmovae %esi,%edx
or     %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sbits(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i64 @ubits(i8* %10, i32 %11, i32 %12, i32 %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
%16 = load i32, i32* %7
%17 = sub i32 %16, 1
%18 = zext i32 %17 to i64
%19 = shl i64 1, %18
%20 = and i64 %15, %19
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %29
22: ; preds = %4
%23 = load i32, i32* %7
%24 = sub i32 %23, 1
%25 = zext i32 %24 to i64
%26 = shl i64 -1, %25
%27 = load i64, i64* %9
%28 = or i64 %27, %26
store i64 %28, i64* %9
br label %29
29: ; preds = %22, %4
%30 = load i64, i64* %9
%31 = trunc i64 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @sbits(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i64 @ubits(i8* %0, i32 %1, i32 %2, i32 %3)
%6 = add i32 %2, -1
%7 = zext i32 %6 to i64
%8 = shl nuw i64 1, %7
%9 = and i64 %5, %8
%10 = icmp eq i64 %9, 0
%11 = shl nsw i64 -1, %7
%12 = select i1 %10, i64 0, i64 %11
%13 = or i64 %12, %5
%14 = trunc i64 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
long downtomult(long x, long y) {
  assert(x >= 0);
  return (x / y) * y;
}


x86 assembly (clang, -O0):
<downtomult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
imul   -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<downtomult>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
shr    $0x3f,%rdi
xor    $0x1,%edi
call   1030 <assert@plt>
mov    %rbx,%rax
or     %r14,%rax
shr    $0x20,%rax
je     113c <downtomult+0x2c>
mov    %rbx,%rax
cqto
idiv   %r14
jmp    1143 <downtomult+0x33>
mov    %ebx,%eax
xor    %edx,%edx
div    %r14d
sub    %rdx,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @downtomult(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 = icmp sge i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = sdiv i64 %9, %10
%12 = load i64, i64* %4
%13 = mul nsw i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @downtomult(i64 %0, i64 %1) {
%3 = lshr i64 %0, 63
%4 = trunc i64 %3 to i32
%5 = xor i32 %4, 1
%6 = tail call i32 @assert(i32 %5)
%7 = srem i64 %0, %1
%8 = sub i64 %0, %7
ret i64 %8
}
/* Variables and functions */
int find_number_of_snps_in_block_with_start_end_index(int, int, int *, char *,
                                                      int, int /*<<< orphan*/,
                                                      int);
int find_number_of_snps_in_block(int window_start_coordinate,
                                 int window_end_coordinate, int *snp_locations,
                                 char *child_sequence, int number_of_snps) {
  return find_number_of_snps_in_block_with_start_end_index(
      window_start_coordinate, window_end_coordinate, snp_locations,
      child_sequence, number_of_snps, 0, number_of_snps);
}


x86 assembly (clang, -O0):
<find_number_of_snps_in_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x1c(%rbp),%eax
xor    %r9d,%r9d
mov    %eax,(%rsp)
call   1030 <find_number_of_snps_in_block_with_start_end_index@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_number_of_snps_in_block>:
push   %rax
mov    %r8d,(%rsp)
xor    %r9d,%r9d
call   1030 <find_number_of_snps_in_block_with_start_end_index@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @find_number_of_snps_in_block(i32 %0, i32 %1, i32* %2, i8* %3, i32 %4) {
%6 = tail call i32 @find_number_of_snps_in_block_with_start_end_index(i32 %0, i32 %1, i32* %2, i8* %3, i32 %4, i32 0, i32 %4)
ret i32 %6
}
void wcn36xx_debugfs_exit(struct wcn36xx *wcn) {}


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

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

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

LLVM IR (-O2):
%struct.wcn36xx = type opaque
define void @wcn36xx_debugfs_exit(%struct.wcn36xx* nocapture %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int tv_usec;
};
struct itimerval {
  TYPE_1__ it_value;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct itimerval *, int /*<<< orphan*/, int);
void delay_setup_immed(struct itimerval *delay) {
  memset(delay, 0, sizeof(struct itimerval));
  delay->it_value.tv_usec = 1;
}


x86 assembly (clang, -O0):
<delay_setup_immed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_setup_immed>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
movl   $0x1,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.itimerval = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
define void @delay_setup_immed(%struct.itimerval* %0) {
%2 = alloca %struct.itimerval*
store %struct.itimerval* %0, %struct.itimerval** %2
%3 = load %struct.itimerval*, %struct.itimerval** %2
%4 = call i32 @memset(%struct.itimerval* %3, i32 0, i32 4)
%5 = load %struct.itimerval*, %struct.itimerval** %2
%6 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %5, i32 0, i32 0
%7 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %6, i32 0, i32 0
store i32 1, i32* %7
ret void
}

LLVM IR (-O2):
%struct.itimerval = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
define void @delay_setup_immed(%struct.itimerval* %0) {
%2 = tail call i32 @memset(%struct.itimerval* %0, i32 0, i32 4)
%3 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %0, i64 0, i32 0, i32 0
store i32 1, i32* %3
ret void
}
/* Variables and functions */
int mbsnwidth(char const *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strlen(char const *);
int gnu_mbswidth(const char *string, int flags) {
  return mbsnwidth(string, strlen(string), flags);
}


x86 assembly (clang, -O0):
<gnu_mbswidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
call   1040 <mbsnwidth@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnu_mbswidth>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <mbsnwidth@plt>

LLVM IR (-O0):
define i32 @gnu_mbswidth(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 i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i32, i32* %4
%9 = call i32 @mbsnwidth(i8* %5, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @gnu_mbswidth(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @mbsnwidth(i8* %0, i32 %3, i32 %1)
ret i32 %4
}