xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int time_t;
struct tm {
  scalar_t__ tm_hour;
  scalar_t__ tm_min;
  scalar_t__ tm_sec;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(int *, struct tm *);
int mktime(struct tm *);
time_t normalize_timestamp(time_t t) {
  struct tm tm;
  if (!localtime_r(&t, &tm))
    return -1;
  tm.tm_sec = tm.tm_min = tm.tm_hour = 0;
  return mktime(&tm);
}


x86 assembly (clang, -O0):
<normalize_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <localtime_r@plt>
cmp    $0x0,%eax
jne    114d <normalize_timestamp+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <normalize_timestamp+0x51>
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <mktime@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_timestamp>:
sub    $0x28,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <localtime_r@plt>
test   %eax,%eax
je     115b <normalize_timestamp+0x3b>
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
lea    0x10(%rsp),%rdi
call   1040 <mktime@plt>
add    $0x28,%rsp
ret
mov    $0xffffffff,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i64, i64, i64 }
define i32 @normalize_timestamp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.tm
store i32 %0, i32* %3
%5 = call i32 @localtime_r(i32* %3, %struct.tm* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 -1, i32* %2
br label %13
8: ; preds = %1
%9 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
store i64 0, i64* %9
%10 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 1
store i64 0, i64* %10
%11 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 2
store i64 0, i64* %11
%12 = call i32 @mktime(%struct.tm* %4)
store i32 %12, i32* %2
br label %13
13: ; preds = %8, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.tm = type { i64, i64, i64 }
define i32 @normalize_timestamp(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm
store i32 %0, i32* %2
%4 = bitcast %struct.tm* %3 to i8*
%5 = call i32 @localtime_r(i32* %2, %struct.tm* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = bitcast %struct.tm* %3 to i8*
%9 = call i32 @mktime(%struct.tm* %3)
br label %10
10: ; preds = %1, %7
%11 = phi i32 [ %9, %7 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
char const *getenv(char *);
const char *bgr_settings_get_base_dir(void) {
  char *rv = getenv("BLOGC_GIT_RECEIVER_BASE_DIR");
  if (rv != NULL) {
    return rv;
  }
  return getenv("HOME");
}


x86 assembly (clang, -O0):
<bgr_settings_get_base_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <bgr_settings_get_base_dir+0x30>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1150 <bgr_settings_get_base_dir+0x40>
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgr_settings_get_base_dir>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1124 <bgr_settings_get_base_dir+0x14>
pop    %rcx
ret
lea    0xef1(%rip),%rdi
pop    %rax
jmp    1030 <getenv@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"BLOGC_GIT_RECEIVER_BASE_DIR\00"
@.str.1 = [5 x i8] c"HOME\00"
define i8* @bgr_settings_get_base_dir() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @getenv(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i8*, i8** %2
store i8* %7, i8** %1
br label %10
8: ; preds = %0
%9 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i8* %9, i8** %1
br label %10
10: ; preds = %8, %6
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [28 x i8] c"BLOGC_GIT_RECEIVER_BASE_DIR\00"
@.str.1 = [5 x i8] c"HOME\00"
define i8* @bgr_settings_get_base_dir() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i8* [ %4, %3 ], [ %1, %0 ]
ret i8* %6
}
int GFX_SetVideoProp(int mode, int sx, int sy, int swidth, int sheight, int ox,
                     int oy, int owidth, int oheight, int alpha,
                     int activewin) {
  return 0;
}


x86 assembly (clang, -O0):
<GFX_SetVideoProp>:
push   %rbp
mov    %rsp,%rbp
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @GFX_SetVideoProp(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10) {
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
store i32 %0, i32* %12
store i32 %1, i32* %13
store i32 %2, i32* %14
store i32 %3, i32* %15
store i32 %4, i32* %16
store i32 %5, i32* %17
store i32 %6, i32* %18
store i32 %7, i32* %19
store i32 %8, i32* %20
store i32 %9, i32* %21
store i32 %10, i32* %22
ret i32 0
}

LLVM IR (-O2):
define i32 @GFX_SetVideoProp(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10) {
ret i32 0
}
/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main(void) {
  int N;
  while (scanf("%d", &N) != EOF)
    printf("%d\n", --N);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     1169 <main+0x49>
mov    -0x8(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0x8(%rbp)
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea8(%rip),%r12
cmp    (%r12),%rax
je     1184 <main+0x64>
lea    0xeb6(%rip),%r14
lea    0xeac(%rip),%r15
lea    0x4(%rsp),%rbx
nopl   0x0(%rax)
mov    0x4(%rsp),%esi
add    $0xffffffff,%esi
mov    %esi,0x4(%rsp)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i32, i32* %2
%9 = add nsw i32 %8, -1
store i32 %9, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %13, label %6
6: ; preds = %0, %6
%7 = load i32, i32* %1
%8 = add nsw i32 %7, -1
store i32 %8, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%11 = load i64, i64* @EOF
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %6
13: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void blah(void) { write(2, "atexit\n", 7); }


x86 assembly (clang, -O0):
<blah>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xee0(%rip),%rsi
mov    $0x7,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<blah>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
mov    $0x7,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"atexit\0A\00"
define void @blah() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"atexit\0A\00"
define void @blah() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
ret void
}
int foo(int a, int b, int *c, short *d) {
  return (c[0] ? b : 0) == 'y' && ((a ? d[0] : c[0]) ? b : 0) == 'c';
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     112a <foo+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1134 <foo+0x34>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    1134 <foo+0x34>
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    $0x79,%ecx
mov    %al,-0x1d(%rbp)
jne    1192 <foo+0x92>
cmpl   $0x0,-0x4(%rbp)
je     1164 <foo+0x64>
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
cmp    $0x0,%eax
jne    1171 <foo+0x71>
jmp    117c <foo+0x7c>
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     117c <foo+0x7c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1186 <foo+0x86>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1186 <foo+0x86>
mov    -0x24(%rbp),%eax
cmp    $0x63,%eax
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1, i32* %2, i16* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i16*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i16* %3, i16** %8
%9 = load i32*, i32** %7
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i32, i32* %6
br label %16
15: ; preds = %4
br label %16
16: ; preds = %15, %13
%17 = phi i32 [ %14, %13 ], [ 0, %15 ]
%18 = icmp eq i32 %17, 121
br i1 %18, label %19, label %39
19: ; preds = %16
%20 = load i32, i32* %5
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %28
22: ; preds = %19
%23 = load i16*, i16** %8
%24 = getelementptr inbounds i16, i16* %23, i64 0
%25 = load i16, i16* %24
%26 = sext i16 %25 to i32
%27 = icmp ne i32 %26, 0
br i1 %27, label %33, label %35
28: ; preds = %19
%29 = load i32*, i32** %7
%30 = getelementptr inbounds i32, i32* %29, i64 0
%31 = load i32, i32* %30
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %28, %22
%34 = load i32, i32* %6
br label %36
35: ; preds = %28, %22
br label %36
36: ; preds = %35, %33
%37 = phi i32 [ %34, %33 ], [ 0, %35 ]
%38 = icmp eq i32 %37, 99
br label %39
39: ; preds = %36, %16
%40 = phi i1 [ false, %16 ], [ %38, %36 ]
%41 = zext i1 %40 to i32
ret i32 %41
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32* nocapture %2, i16* nocapture %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("\nUsage :  wrksets -p <union | intersection | "
         "difference> \"set A\" \"set B\" \n\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [76 x i8] c"\0AUsage : wrksets -p <union | intersection | difference> \22set A\22 \22set B\22 \0A\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [75 x i8] c"\0AUsage : wrksets -p <union | intersection | difference> \22set A\22 \22set B\22 \0A\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int hash_rot(int, int);
int mhash_add__(int, int);
uint32_t mhash_add(uint32_t hash, uint32_t data) {
  hash = mhash_add__(hash, data);
  hash = hash_rot(hash, 13);
  return hash * 5 + 0xe6546b64;
}


x86 assembly (clang, -O0):
<mhash_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <mhash_add__@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xd,%esi
call   1030 <hash_rot@plt>
mov    %eax,-0x4(%rbp)
imul   $0x5,-0x4(%rbp),%eax
add    $0xe6546b64,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mhash_add>:
push   %rax
call   1040 <mhash_add__@plt>
mov    %eax,%edi
mov    $0xd,%esi
call   1030 <hash_rot@plt>
lea    (%rax,%rax,4),%eax
add    $0xe6546b64,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mhash_add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @mhash_add__(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @hash_rot(i32 %8, i32 13)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 5
%12 = add i32 %11, -430675100
ret i32 %12
}

LLVM IR (-O2):
define i32 @mhash_add(i32 %0, i32 %1) {
%3 = tail call i32 @mhash_add__(i32 %0, i32 %1)
%4 = tail call i32 @hash_rot(i32 %3, i32 13)
%5 = mul nsw i32 %4, 5
%6 = add i32 %5, -430675100
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ op_to_dn(char *, int /*<<< orphan*/, int);
void i_and_dn(void) { op_to_dn("and", 0, 1); }


x86 assembly (clang, -O0):
<i_and_dn>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <op_to_dn@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_and_dn>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <op_to_dn@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"and\00"
define void @i_and_dn() {
%1 = tail call i32 @op_to_dn(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint16_t sancus_u16zd(ssize_t v) {
  assert((v >= 0) && (v <= 0xffff));
  return (uint16_t)v;
}


x86 assembly (clang, -O0):
<sancus_u16zd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1137 <sancus_u16zd+0x27>
cmpl   $0xffff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_u16zd>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x10000,%ebx
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sancus_u16zd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 65535
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @sancus_u16zd(i32 returned %0) {
%2 = icmp ult i32 %0, 65536
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 %0
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ err_quit(char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void Close(int sockfd) {
  if (close(sockfd) < 0)
    do {
      strerror(errno);
      puts("\n");
      err_quit("close error");
    } while (1);
}


x86 assembly (clang, -O0):
<Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
jge    119c <Close+0x5c>
jmp    1162 <Close+0x22>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7f(%rip),%rdi
call   1050 <err_quit@plt>
mov    $0x1,%al
test   $0x1,%al
jne    1162 <Close+0x22>
jmp    1197 <Close+0x57>
jmp    119c <Close+0x5c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Close>:
push   %r15
push   %r14
push   %rbx
call   1040 <close@plt>
test   %rax,%rax
js     1155 <Close+0x15>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    0x2e84(%rip),%r15
lea    0xe9d(%rip),%r14
lea    0xe98(%rip),%rbx
nopw   0x0(%rax,%rax,1)
mov    (%r15),%edi
call   1060 <strerror@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <err_quit@plt>
jmp    1170 <Close+0x30>

LLVM IR (-O0):
@errno = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [12 x i8] c"close error\00"
define void @Close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @close(i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
br label %7
7: ; preds = %12, %6
%8 = load i32, i32* @errno
%9 = call i32 @strerror(i32 %8)
%10 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @err_quit(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %7
br i1 true, label %7, label %13
13: ; preds = %12
br label %14
14: ; preds = %13, %1
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [12 x i8] c"close error\00"
define void @Close(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = load i32, i32* @errno
%6 = tail call i32 @strerror(i32 %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @err_quit(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %4
9: ; preds = %1
ret void
}
int char2dec(int c) {
  if (c >= '0' && c <= '9')
    return (c - 48);
  else
    return -1;
}


x86 assembly (clang, -O0):
<char2dec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <char2dec+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <char2dec+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <char2dec+0x30>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char2dec>:
lea    -0x30(%rdi),%ecx
cmp    $0xa,%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @char2dec(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = select i1 %3, i32 %2, i32 -1
ret i32 %4
}
/* Variables and functions */
void *__coverity_alloc__(int);
int /*<<< orphan*/ __coverity_mark_as_afm_allocated__(void *, char *);
void *H5Acreate(void *loc_id, const char *attr_name, void *type_id,
                void *space_id, void *acpl_id, void *aapl_id) {
  void *id = __coverity_alloc__(10);
  __coverity_mark_as_afm_allocated__(id, "H5Aclose");
  return id;
}


x86 assembly (clang, -O0):
<H5Acreate>:
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    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    -0x38(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<H5Acreate>:
push   %rbx
mov    $0xa,%edi
call   1040 <__coverity_alloc__@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    %rax,%rdi
call   1030 <__coverity_mark_as_afm_allocated__@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"H5Aclose\00"
define i8* @H5Acreate(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%14 = call i8* @__coverity_alloc__(i32 10)
store i8* %14, i8** %13
%15 = load i8*, i8** %13
%16 = call i32 @__coverity_mark_as_afm_allocated__(i8* %15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%17 = load i8*, i8** %13
ret i8* %17
}

LLVM IR (-O2):
@.str = [9 x i8] c"H5Aclose\00"
define i8* @H5Acreate(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = tail call i8* @__coverity_alloc__(i32 10)
%8 = tail call i32 @__coverity_mark_as_afm_allocated__(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}
/* Variables and functions */
scalar_t__ rename(char *, char *);
int smm_errno_update(int);
int smm_rename(char *oldname, char *newname) {
  if (rename(oldname, newname) < 0) {
    return smm_errno_update((0xC0000000 | (12)));
  }
  return smm_errno_update(0);
}


x86 assembly (clang, -O0):
<smm_rename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <rename@plt>
cmp    $0x0,%rax
jge    1159 <smm_rename+0x39>
mov    $0xc000000c,%edi
call   1030 <smm_errno_update@plt>
mov    %eax,-0x4(%rbp)
jmp    1163 <smm_rename+0x43>
xor    %edi,%edi
call   1030 <smm_errno_update@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smm_rename>:
push   %rax
call   1040 <rename@plt>
sar    $0x3f,%rax
and    $0xc000000c,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <smm_errno_update@plt>

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

LLVM IR (-O2):
define i32 @smm_rename(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @rename(i8* %0, i8* %1)
%4 = icmp slt i64 %3, 0
%5 = select i1 %4, i32 -1073741812, i32 0
%6 = tail call i32 @smm_errno_update(i32 %5)
ret i32 %6
}
/* Variables and functions */
scalar_t__ GetChar();
int ComFlushInput(void) {
  int loop;
  for (loop = 0; GetChar() >= 0 && loop < 100; loop++)
    ;
  return loop;
}


x86 assembly (clang, -O0):
<ComFlushInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <GetChar@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jl     1142 <ComFlushInput+0x32>
cmpl   $0x64,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    1152 <ComFlushInput+0x42>
jmp    1165 <ComFlushInput+0x55>
jmp    1157 <ComFlushInput+0x47>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <ComFlushInput+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComFlushInput>:
push   %rbx
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <GetChar@plt>
test   %rax,%rax
js     1134 <ComFlushInput+0x24>
cmp    $0x64,%ebx
jb     1120 <ComFlushInput+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ComFlushInput() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %11, %0
%3 = call i64 (...) @GetChar()
%4 = icmp sge i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 100
br label %8
8: ; preds = %5, %2
%9 = phi i1 [ false, %2 ], [ %7, %5 ]
br i1 %9, label %10, label %14
10: ; preds = %8
br label %11
11: ; preds = %10
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
br label %2
14: ; preds = %8
%15 = load i32, i32* %1
ret i32 %15
}

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

/* Variables and functions */
int /*<<< orphan*/ scan_to_eol(int /*<<< orphan*/ *);
void scan_comment(FILE *f) { scan_to_eol(f); }


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

x86 assembly (clang, -O2):
<scan_comment>:
jmp    1030 <scan_to_eol@plt>

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

LLVM IR (-O2):
define void @scan_comment(i32* %0) {
%2 = tail call i32 @scan_to_eol(i32* %0)
ret void
}
long long foonegdi(long long a) { return a ? 30 : -30; }


x86 assembly (clang, -O0):
<foonegdi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0xffffffe2,%eax
mov    $0x1e,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<foonegdi>:
test   %rdi,%rdi
mov    $0xffffffffffffffe2,%rcx
mov    $0x1e,%eax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @foonegdi(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 30, i32 -30
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @foonegdi(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 -30, i64 30
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ foo(char *, char const *, int);
int main(void) {
  if (foo("abcde", (const char *)0, 3) != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x3,%edx
call   1040 <foo@plt>
cmp    $0x0,%rax
je     1155 <main+0x35>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1040 <foo@plt>
test   %rax,%rax
jne    113d <main+0x1d>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"abcde\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @foo(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* null, i32 3)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"abcde\00"
define i32 @main() {
%1 = tail call i64 @foo(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* null, i32 3)
%2 = icmp eq i64 %1, 0
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 */
#define SIGTERM 128
int /*<<< orphan*/ _log(int, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void signal_handler(int sig) {
  switch (sig) {
  case SIGTERM:
    _log(1, "init: reached target reboot\n");
    exit(0);
  default:
    return;
  }
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
jne    1156 <signal_handler+0x36>
jmp    113e <signal_handler+0x1e>
mov    $0x1,%edi
lea    0xeb6(%rip),%rsi
call   1030 <_log@plt>
xor    %edi,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
cmp    $0x80,%edi
je     1129 <signal_handler+0x9>
ret
push   %rax
lea    0xecf(%rip),%rsi
mov    $0x1,%edi
call   1030 <_log@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"init: reached target reboot\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %7 [
i32 128, label %4
]
4: ; preds = %1
%5 = call i32 @_log(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"init: reached target reboot\0A\00"
define void @signal_handler(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @_log(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %1
ret void
}
void freertos_exc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @freertos_exc_init() {
ret void
}
void ff_hevc_put_hevc_uni_epel_h12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h12_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
char *strdup(char const *);
char *xstrdup(const char *str) {
  char *buf;
  buf = strdup(str);
  if (buf == NULL)
    err(1, "strdup");
  return (buf);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <xstrdup+0x35>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xstrdup+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"strdup\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @err(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"strdup\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
char *sljit_get_platform_name() { return "x86-64"; }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"x86-64\00"
define i8* @sljit_get_platform_name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"x86-64\00"
define i8* @sljit_get_platform_name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int failedCheck(int i, int j) {
  if (i != j) {
    printf("[FAIL] launch-image-cache: expected %d but got %d\n", j, i);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<failedCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1148 <failedCheck+0x38>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    114f <failedCheck+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<failedCheck>:
xor    %eax,%eax
cmp    %esi,%edi
je     112e <failedCheck+0x1e>
push   %rax
mov    %edi,%edx
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [51 x i8] c"[FAIL] launch-image-cache: expected %d but got %d\0A\00"
define i32 @failedCheck(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %9
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@.str = [51 x i8] c"[FAIL] launch-image-cache: expected %d but got %d\0A\00"
define i32 @failedCheck(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %7
}
int putchar(c)
int c;
{
  ;
  return __send_to_ppe(0x2100, 24, &c);
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2100,%edi
mov    $0x18,%esi
lea    -0x4(%rbp),%rdx
mov    $0x0,%al
call   1030 <__send_to_ppe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x2100,%edi
mov    $0x18,%esi
xor    %eax,%eax
call   1030 <__send_to_ppe@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @__send_to_ppe to i32 (i32, i32, i32*, ...)*)(i32 8448, i32 24, i32* %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i32, i32*, ...) bitcast (i32 (...)* @__send_to_ppe to i32 (i32, i32, i32*, ...)*)(i32 8448, i32 24, i32* %2)
ret i32 %3
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int num;
  printf("Enter the term you want to find\n");
  scanf("%d", &num);
  printf("\nthe term is:%d\n", fib(num));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1050 <fib@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1060 <fib@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Enter the term you want to find\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"\0Athe term is:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fib(i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"\0Athe term is:%d\0A\00"
@str = [32 x i8] c"Enter the term you want to find\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fib(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
int tup_privileged(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @tup_privileged() {
ret i32 1
}
void RTVfsChainElementDeregisterProvider(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsChainElementDeregisterProvider() {
ret void
}
/* Type definitions */
struct Table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Table *);
void destroy(struct Table *tbl) { free(tbl); }


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

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

LLVM IR (-O0):
%struct.Table = type { i32 }
define void @destroy(%struct.Table* %0) {
%2 = alloca %struct.Table*
store %struct.Table* %0, %struct.Table** %2
%3 = load %struct.Table*, %struct.Table** %2
%4 = call i32 @free(%struct.Table* %3)
ret void
}

LLVM IR (-O2):
%struct.Table = type { i32 }
define void @destroy(%struct.Table* nocapture %0) {
%2 = tail call i32 @free(%struct.Table* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *argv0) {
  fprintf(stderr,
          "usage: %s filein alpha_min alpha_max nb_bins [xoffset yoffset width "
          "height]\n",
          argv0);
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [77 x i8] c"usage: %s filein alpha_min alpha_max nb_bins [xoffset yoffset width height]\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [77 x i8] c"usage: %s filein alpha_min alpha_max nb_bins [xoffset yoffset width height]\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int getNumber();
int /*<<< orphan*/ printf(char *, int);
int magic(int argument) {
  printf("Nice %d!\n", argument);
  return -getNumber();
}


x86 assembly (clang, -O0):
<magic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getNumber@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magic>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getNumber@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Nice %d!\0A\00"
define i32 @magic(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @getNumber()
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@.str = [10 x i8] c"Nice %d!\0A\00"
define i32 @magic(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @getNumber()
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
struct mcuio_packet {
  int dummy;
};

/* Variables and functions */
int BIT(int);
int mcuio_packet_type(struct mcuio_packet *);
int mcuio_packet_is_reply(struct mcuio_packet *p) {
  return (mcuio_packet_type(p) & BIT(6));
}


x86 assembly (clang, -O0):
<mcuio_packet_is_reply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mcuio_packet_type@plt>
mov    %eax,-0xc(%rbp)
mov    $0x6,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcuio_packet_is_reply>:
push   %rbx
call   1040 <mcuio_packet_type@plt>
mov    %eax,%ebx
mov    $0x6,%edi
call   1030 <BIT@plt>
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mcuio_packet = type { i32 }
define i32 @mcuio_packet_is_reply(%struct.mcuio_packet* %0) {
%2 = alloca %struct.mcuio_packet*
store %struct.mcuio_packet* %0, %struct.mcuio_packet** %2
%3 = load %struct.mcuio_packet*, %struct.mcuio_packet** %2
%4 = call i32 @mcuio_packet_type(%struct.mcuio_packet* %3)
%5 = call i32 @BIT(i32 6)
%6 = and i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.mcuio_packet = type { i32 }
define i32 @mcuio_packet_is_reply(%struct.mcuio_packet* %0) {
%2 = tail call i32 @mcuio_packet_type(%struct.mcuio_packet* %0)
%3 = tail call i32 @BIT(i32 6)
%4 = and i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int dsp_open(void) { return open("/dev/DspBridge", O_RDWR); }


x86 assembly (clang, -O0):
<dsp_open>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <open@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsp_open>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"/dev/DspBridge\00"
@O_RDWR = global i32 0
define i32 @dsp_open() {
%1 = load i32, i32* @O_RDWR
%2 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [15 x i8] c"/dev/DspBridge\00"
@O_RDWR = global i32 0
define i32 @dsp_open() {
%1 = load i32, i32* @O_RDWR
%2 = tail call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
/* Type definitions */
struct physical_device {
  int dummy;
};
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
scalar_t__ get_major_minor(int /*<<< orphan*/ *, char const *);
int get_physical_device(struct physical_device *, int /*<<< orphan*/,
                        char const *);
int get_physical_device_dir(struct physical_device *pd, const char *directory) {
  dev_t dev;
  if (get_major_minor(&dev, directory) != 0)
    return -1;
  return get_physical_device(pd, dev, directory);
}


x86 assembly (clang, -O0):
<get_physical_device_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdi
call   1030 <get_major_minor@plt>
cmp    $0x0,%rax
je     1153 <get_physical_device_dir+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <get_physical_device_dir+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <get_physical_device@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_physical_device_dir>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x4(%rsp),%rdi
call   1030 <get_major_minor@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1150 <get_physical_device_dir+0x30>
mov    0x4(%rsp),%esi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1040 <get_physical_device@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.physical_device = type { i32 }
define i32 @get_physical_device_dir(%struct.physical_device* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.physical_device*
%5 = alloca i8*
%6 = alloca i32
store %struct.physical_device* %0, %struct.physical_device** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = call i64 @get_major_minor(i32* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %16
11: ; preds = %2
%12 = load %struct.physical_device*, %struct.physical_device** %4
%13 = load i32, i32* %6
%14 = load i8*, i8** %5
%15 = call i32 @get_physical_device(%struct.physical_device* %12, i32 %13, i8* %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %11, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.physical_device = type { i32 }
define i32 @get_physical_device_dir(%struct.physical_device* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @get_major_minor(i32* %3, i8* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = call i32 @get_physical_device(%struct.physical_device* %0, i32 %8, i8* %1)
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ %9, %7 ], [ -1, %2 ]
ret i32 %11
}