xunge/DecIR huggingface dataset:
/* Variables and functions */
char *get_kernel_stat() { return ("linux" == NULL) ? "" : "linux"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"linux\00"
define i8* @get_kernel_stat() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void test(unsigned long long x, unsigned long long y, unsigned long long q,
          unsigned long long r) {
  if ((x / y) != q || (x % y) != r)
    abort();
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
cmp    -0x18(%rbp),%rax
jne    1154 <test+0x44>
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
cmp    -0x20(%rbp),%rdx
je     115b <test+0x4b>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %rdx,%r8
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     112e <test+0x1e>
mov    %rdi,%rax
xor    %edx,%edx
div    %rsi
cmp    %r8,%rax
je     1139 <test+0x29>
jmp    113f <test+0x2f>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
cmp    %r8,%rax
jne    113f <test+0x2f>
cmp    %rcx,%rdx
jne    113f <test+0x2f>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @test(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = udiv i64 %9, %10
%12 = load i64, i64* %7
%13 = icmp ne i64 %11, %12
br i1 %13, label %20, label %14
14: ; preds = %4
%15 = load i64, i64* %5
%16 = load i64, i64* %6
%17 = urem i64 %15, %16
%18 = load i64, i64* %8
%19 = icmp ne i64 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %14, %4
%21 = call i32 (...) @abort()
unreachable
22: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @test(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = udiv i64 %0, %1
%6 = urem i64 %0, %1
%7 = icmp eq i64 %5, %2
%8 = icmp eq i64 %6, %3
%9 = and i1 %7, %8
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_mutexattr_gettype(const pthread_mutexattr_t *a, int *b) {
  assert(0);
}


x86 assembly (clang, -O0):
<pthread_mutexattr_gettype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutexattr_gettype>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_gettype(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ result;

/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, int /*<<< orphan*/ *, int);
double geopm_field_to_signal(uint64_t field) {
  double result;
  memcpy(&result, &field, sizeof(result));
  return result;
}


x86 assembly (clang, -O0):
<geopm_field_to_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geopm_field_to_signal>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
movsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @geopm_field_to_signal(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = call i32 @memcpy(double* %3, i32* %2, i32 8)
%5 = load double, double* %3
ret double %5
}

LLVM IR (-O2):
define double @geopm_field_to_signal(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = bitcast double* %3 to i8*
%5 = call i32 @memcpy(double* %3, i32* %2, i32 8)
%6 = load double, double* %3
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/, int);
void test_array_reference(int *arr) { __emit_expression_range(0, arr[100]); }


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

x86 assembly (clang, -O2):
<test_array_reference>:
mov    0x190(%rdi),%esi
xor    %edi,%edi
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_array_reference(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 100
%5 = load i32, i32* %4
%6 = call i32 @__emit_expression_range(i32 0, i32 %5)
ret void
}

LLVM IR (-O2):
define void @test_array_reference(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 100
%3 = load i32, i32* %2
%4 = tail call i32 @__emit_expression_range(i32 0, i32 %3)
ret void
}
void i2d_DISPLAYTEXT(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_DISPLAYTEXT() {
ret void
}
void RTManifestEntryAddIoStream(void) {}


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

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

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

LLVM IR (-O2):
define void @RTManifestEntryAddIoStream() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ A_UNDERLINE;
int /*<<< orphan*/ COLOR_BLACK;
int /*<<< orphan*/ COLOR_BLUE;
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ wattron(int /*<<< orphan*/ *, int /*<<< orphan*/);
void before_url(WINDOW *win) {
  init_pair(3, COLOR_BLUE, COLOR_BLACK);
  wattron(win, COLOR_PAIR(3));
  wattron(win, A_UNDERLINE);
}


x86 assembly (clang, -O0):
<before_url>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1030 <init_pair@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x3,%edi
call   1040 <COLOR_PAIR@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1050 <wattron@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e50(%rip),%rax
mov    (%rax),%esi
call   1050 <wattron@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<before_url>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%edi
call   1030 <init_pair@plt>
mov    $0x3,%edi
call   1040 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <wattron@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <wattron@plt>

LLVM IR (-O0):
@COLOR_BLUE = global i32 0
@COLOR_BLACK = global i32 0
@A_UNDERLINE = global i32 0
define void @before_url(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @COLOR_BLUE
%4 = load i32, i32* @COLOR_BLACK
%5 = call i32 @init_pair(i32 3, i32 %3, i32 %4)
%6 = load i32*, i32** %2
%7 = call i32 @COLOR_PAIR(i32 3)
%8 = call i32 @wattron(i32* %6, i32 %7)
%9 = load i32*, i32** %2
%10 = load i32, i32* @A_UNDERLINE
%11 = call i32 @wattron(i32* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@COLOR_BLUE = global i32 0
@COLOR_BLACK = global i32 0
@A_UNDERLINE = global i32 0
define void @before_url(i32* %0) {
%2 = load i32, i32* @COLOR_BLUE
%3 = load i32, i32* @COLOR_BLACK
%4 = tail call i32 @init_pair(i32 3, i32 %2, i32 %3)
%5 = tail call i32 @COLOR_PAIR(i32 3)
%6 = tail call i32 @wattron(i32* %0, i32 %5)
%7 = load i32, i32* @A_UNDERLINE
%8 = tail call i32 @wattron(i32* %0, i32 %7)
ret void
}
void __attribute__((weak)) dma2_stream6_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<dma2_stream6_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dma2_stream6_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.dma2_stream6_isr = [17 x i8] c"dma2_stream6_isr\00"
define weak void @dma2_stream6_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.dma2_stream6_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.dma2_stream6_isr = [17 x i8] c"dma2_stream6_isr\00"
define weak void @dma2_stream6_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.dma2_stream6_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
int syscall(int, char const *, char const *, void *, size_t, int);
int setxattr(const char *path, const char *name, void *value, size_t size,
             int flags) {
  return syscall(188, path, name, value, size, flags);
}


x86 assembly (clang, -O0):
<setxattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    $0xbc,%edi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setxattr>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xbc,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @setxattr(i8* %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = tail call i32 @syscall(i32 188, i8* %0, i8* %1, i8* %2, i64 %3, i32 %4)
ret i32 %6
}
int colleto(int v) { return v + 25; }


x86 assembly (clang, -O0):
<colleto>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x19,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<colleto>:
lea    0x19(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @colleto(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 25
ret i32 %4
}

LLVM IR (-O2):
define i32 @colleto(i32 %0) {
%2 = add nsw i32 %0, 25
ret i32 %2
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void integer_overflow_by_addition_l2_Bad(int x) {
  int32_t y;
  if (x) {
    y = 0;
  } else {
    y = 2000000000;
  }
  y = y + y;
}


x86 assembly (clang, -O0):
<integer_overflow_by_addition_l2_Bad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111d <integer_overflow_by_addition_l2_Bad+0x1d>
movl   $0x0,-0x8(%rbp)
jmp    1124 <integer_overflow_by_addition_l2_Bad+0x24>
movl   $0x77359400,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @integer_overflow_by_addition_l2_Bad(i32 %0) {
ret void
}
const char *_lexer_encode_unicode_char(long inCodePoint) {
  static char short_string[2];
  short_string[0] = inCodePoint;
  short_string[1] = 0;
  return short_string;
}


x86 assembly (clang, -O0):
<_lexer_encode_unicode_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %al,0x2f0f(%rip)
movb   $0x0,0x2f09(%rip)
lea    0x2f01(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lexer_encode_unicode_char>:
mov    %dil,0x2f1a(%rip)
lea    0x2f13(%rip),%rax
movb   $0x0,0x2f0d(%rip)
ret

LLVM IR (-O0):
@_lexer_encode_unicode_char.short_string = internal global [2 x i8] zeroinitializer
define i8* @_lexer_encode_unicode_char(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i8
store i8 %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @_lexer_encode_unicode_char.short_string, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @_lexer_encode_unicode_char.short_string, i64 0, i64 1)
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @_lexer_encode_unicode_char.short_string, i64 0, i64 0)
}

LLVM IR (-O2):
@_lexer_encode_unicode_char.short_string = internal global [2 x i8] zeroinitializer
define i8* @_lexer_encode_unicode_char(i64 %0) {
%2 = trunc i64 %0 to i8
store i8 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @_lexer_encode_unicode_char.short_string, i64 0, i64 0)
store i8 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @_lexer_encode_unicode_char.short_string, i64 0, i64 1)
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @_lexer_encode_unicode_char.short_string, i64 0, i64 0)
}
/* Variables and functions */
int foo(int);
int main(void) { return foo(4) - 6; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <foo@plt>
sub    $0x6,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <foo@plt>
add    $0xfffffffa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 4)
%3 = sub nsw i32 %2, 6
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 4)
%2 = add nsw i32 %1, -6
ret i32 %2
}
/* Type definitions */
struct stat {
  int dummy;
};
struct FTW {
  int dummy;
};

/* Variables and functions */
int remove(char const *);
int mill_mfunlink_cb(const char *fpath, const struct stat *sb, int typeflag,
                     struct FTW *ftwbuf) {
  return remove(fpath);
}


x86 assembly (clang, -O0):
<mill_mfunlink_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mill_mfunlink_cb>:
jmp    1030 <remove@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @mill_mfunlink_cb(i8* %0, %struct.stat* %1, i32 %2, %struct.FTW* %3) {
%5 = alloca i8*
%6 = alloca %struct.stat*
%7 = alloca i32
%8 = alloca %struct.FTW*
store i8* %0, i8** %5
store %struct.stat* %1, %struct.stat** %6
store i32 %2, i32* %7
store %struct.FTW* %3, %struct.FTW** %8
%9 = load i8*, i8** %5
%10 = call i32 @remove(i8* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.FTW = type { i32 }
define i32 @mill_mfunlink_cb(i8* nocapture %0, %struct.stat* nocapture readnone %1, i32 %2, %struct.FTW* nocapture readnone %3) {
%5 = tail call i32 @remove(i8* %0)
ret i32 %5
}
int f(int a, int b, int *d) {
  int c = a - b;
  *d = (c == 0);
  return c >= 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x0,-0x14(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
xor    %ecx,%ecx
sub    %esi,%eax
sete   %cl
mov    %ecx,(%rdx)
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = load i32*, i32** %6
store i32 %13, i32* %14
%15 = load i32, i32* %7
%16 = icmp sge i32 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = sub nsw i32 %0, %1
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
store i32 %6, i32* %2
%7 = xor i32 %4, -1
%8 = lshr i32 %7, 31
ret i32 %8
}
/* Variables and functions */
scalar_t__ CallBack1(int, char *);
int PossiblyQuoteName(char *name) { return (int)CallBack1(151, name); }


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

x86 assembly (clang, -O2):
<PossiblyQuoteName>:
mov    %rdi,%rsi
mov    $0x97,%edi
jmp    1030 <CallBack1@plt>

LLVM IR (-O0):
define i32 @PossiblyQuoteName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @CallBack1(i32 151, i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @PossiblyQuoteName(i8* %0) {
%2 = tail call i64 @CallBack1(i32 151, i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int S_IRWXG;
int S_IRWXU;
char *dirname(char *);
int /*<<< orphan*/ free(char *);
int mkpath(char *, int);
char *strdup(char const *);
int mksocketpath(const char *s) {
  char *tmp = strdup(s);
  char *tmpt = tmp;
  tmpt = dirname(tmpt);
  int r = mkpath(tmpt, S_IRWXU | S_IRWXG);
  free(tmp);
  return r;
}


x86 assembly (clang, -O0):
<mksocketpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <dirname@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
mov    0x2e5e(%rip),%rax
or     (%rax),%esi
call   1050 <mkpath@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mksocketpath>:
push   %rbp
push   %rbx
push   %rax
call   1060 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <dirname@plt>
mov    0x2e8e(%rip),%rcx
mov    0x2e7f(%rip),%rdx
mov    (%rdx),%esi
or     (%rcx),%esi
mov    %rax,%rdi
call   1050 <mkpath@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
define i32 @mksocketpath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = call i8* @dirname(i8* %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i32, i32* @S_IRWXU
%13 = load i32, i32* @S_IRWXG
%14 = or i32 %12, %13
%15 = call i32 @mkpath(i8* %11, i32 %14)
store i32 %15, i32* %5
%16 = load i8*, i8** %3
%17 = call i32 @free(i8* %16)
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
define i32 @mksocketpath(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i8* @dirname(i8* %2)
%4 = load i32, i32* @S_IRWXU
%5 = load i32, i32* @S_IRWXG
%6 = or i32 %5, %4
%7 = tail call i32 @mkpath(i8* %3, i32 %6)
%8 = tail call i32 @free(i8* %2)
ret i32 %7
}
int safety(short card) {
  switch (card) {
  case 5:
  case 10:
  case 15:
    return 15;
  case 6:
  case 11:
  case 16:
    return 16;
  case 7:
  case 12:
  case 17:
    return 17;
  case 13:
  case 8:
  case 18:
  case 9:
  case 14:
    return 18;
  }
  return (0);
}


x86 assembly (clang, -O0):
<safety>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%eax
add    $0xfffffffb,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xd,%eax
ja     1165 <safety+0x65>
mov    -0x10(%rbp),%rax
lea    0xed4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xf,-0x4(%rbp)
jmp    116c <safety+0x6c>
movl   $0x10,-0x4(%rbp)
jmp    116c <safety+0x6c>
movl   $0x11,-0x4(%rbp)
jmp    116c <safety+0x6c>
movl   $0x12,-0x4(%rbp)
jmp    116c <safety+0x6c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<safety>:
add    $0xfffffffb,%edi
xor    %eax,%eax
cmp    $0xd,%edi
ja     1117 <safety+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @safety(i16 signext %0) {
%2 = alloca i32
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
switch i32 %5, label %10 [
i32 5, label %6
i32 10, label %6
i32 15, label %6
i32 6, label %7
i32 11, label %7
i32 16, label %7
i32 7, label %8
i32 12, label %8
i32 17, label %8
i32 13, label %9
i32 8, label %9
i32 18, label %9
i32 9, label %9
i32 14, label %9
]
6: ; preds = %1, %1, %1
store i32 15, i32* %2
br label %11
7: ; preds = %1, %1, %1
store i32 16, i32* %2
br label %11
8: ; preds = %1, %1, %1
store i32 17, i32* %2
br label %11
9: ; preds = %1, %1, %1, %1, %1
store i32 18, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@switch.table.safety = [14 x i32] [i32 15, i32 16, i32 17, i32 18, i32 18, i32 15, i32 16, i32 17, i32 18, i32 18, i32 15, i32 16, i32 17, i32 18]
define i32 @safety(i16 signext %0) {
%2 = sext i16 %0 to i32
%3 = add nsw i32 %2, -5
%4 = icmp ult i32 %3, 14
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [14 x i32], [14 x i32]* @switch.table.safety, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}
int strlenm(char *s) {
  int i = 0;
  while (*s++ != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlenm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <strlenm+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlenm+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlenm>:
cmpb   $0x0,(%rdi)
je     111c <strlenm+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlenm+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlenm(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void out(int port, int value) { return; }


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

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

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

LLVM IR (-O2):
define void @out(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_char(char);
void print_bin(unsigned int i) {
  if (i > 1) {
    print_bin(i / 2);
    print_bin(i % 2);
  } else {
    print_char(i ? '1' : '0');
  }
}


x86 assembly (clang, -O0):
<print_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jbe    1150 <print_bin+0x30>
mov    -0x4(%rbp),%edi
shr    $0x1,%edi
call   1030 <print_bin@plt>
mov    -0x4(%rbp),%edi
and    $0x1,%edi
call   1030 <print_bin@plt>
jmp    116b <print_bin+0x4b>
mov    -0x4(%rbp),%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%edi
call   1040 <print_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bin>:
cmp    $0x2,%edi
jb     1135 <print_bin+0x15>
push   %rbx
mov    %edi,%ebx
and    $0x1,%ebx
shr    %edi
call   1030 <print_bin@plt>
mov    %ebx,%edi
pop    %rbx
cmp    $0x1,%edi
mov    $0x31,%edi
sbb    $0x0,%edi
jmp    1040 <print_char@plt>

LLVM IR (-O0):
define void @print_bin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 1
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = udiv i32 %6, 2
%8 = load i32, i32* %2
%9 = urem i32 %8, 2
br label %17
10: ; preds = %1
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 49, i32 48
%15 = trunc i32 %14 to i8
%16 = call i32 @print_char(i8 signext %15)
br label %17
17: ; preds = %10, %5
ret void
}

LLVM IR (-O2):
define void @print_bin(i32 %0) {
%2 = icmp ugt i32 %0, 1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = and i32 %0, 1
%5 = lshr i32 %0, 1
tail call void @print_bin(i32 %5)
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ %0, %1 ], [ %4, %3 ]
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8 48, i8 49
%10 = tail call i32 @print_char(i8 signext %9)
ret void
}
/* Variables and functions */
double sqrt(double);
double C(double arg) { return arg < 1 ? 1.0 / sqrt(2.0) : 1; }


x86 assembly (clang, -O0):
<C>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1156 <C+0x46>
movsd  0xed0(%rip),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xeb8(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1168 <C+0x58>
movsd  0xea2(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1168 <C+0x58>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xef0(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @C(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 1.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = call double @sqrt(double 2.000000e+00)
%7 = fdiv double 1.000000e+00, %6
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi double [ %7, %5 ], [ 1.000000e+00, %8 ]
ret double %10
}

LLVM IR (-O2):
define double @C(double %0) {
%2 = fcmp olt double %0, 1.000000e+00
%3 = select i1 %2, double 0x3FE6A09E667F3BCC, double 1.000000e+00
ret double %3
}
void proccess_cmd(unsigned int cmd) {}


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

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

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

LLVM IR (-O2):
define void @proccess_cmd(i32 %0) {
ret void
}
/* Variables and functions */
int fcntl(int, unsigned int, unsigned int);
int fcntl1(int i, unsigned int r, unsigned int d) { return fcntl(i, r, d); }


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

x86 assembly (clang, -O2):
<fcntl1>:
jmp    1030 <fcntl@plt>

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

LLVM IR (-O2):
define i32 @fcntl1(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @fcntl(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
int is_bit_aligned(int nbit, int val) {
  int pad = (1 << nbit) - 1;
  return (val & pad) == 0;
}


x86 assembly (clang, -O0):
<is_bit_aligned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bit_aligned>:
mov    %edi,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
not    %edx
xor    %eax,%eax
test   %esi,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_bit_aligned(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = shl i32 1, %6
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = and i32 %9, %10
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_bit_aligned(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %0
%4 = xor i32 %3, -1
%5 = and i32 %4, %1
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
scalar_t__ floor(int);
int uniformrng();
int integerrng(int a, int b) {
  return (int)(a + floor(uniformrng() * (b - a + 1)));
}


x86 assembly (clang, -O0):
<integerrng>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <uniformrng@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
imul   %eax,%edi
call   1040 <floor@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integerrng>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <uniformrng@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
imul   %eax,%ebx
mov    %ebx,%edi
call   1040 <floor@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @integerrng(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 = sext i32 %5 to i64
%7 = call i32 (...) @uniformrng()
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = mul nsw i32 %7, %11
%13 = call i64 @floor(i32 %12)
%14 = add nsw i64 %6, %13
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @integerrng(i32 %0, i32 %1) {
%3 = tail call i32 (...) @uniformrng()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = mul nsw i32 %3, %5
%7 = tail call i64 @floor(i32 %6)
%8 = trunc i64 %7 to i32
%9 = add i32 %8, %0
ret i32 %9
}
void cnrom_update() { return; }


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

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

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

LLVM IR (-O2):
define void @cnrom_update() {
ret void
}
void CG_DrawNotify(void) { return; }


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

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

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

LLVM IR (-O2):
define void @CG_DrawNotify() {
ret void
}
float quintic_ease_out(float p) {
  float f = (p - 1.0f);
  return f * f * f * f * f + 1.0f;
}


x86 assembly (clang, -O0):
<quintic_ease_out>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xebc(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quintic_ease_out>:
addss  0xef8(%rip),%xmm0
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm1,%xmm0
addss  0xee1(%rip),%xmm0
ret

LLVM IR (-O0):
define float @quintic_ease_out(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fsub float %4, 1.000000e+00
store float %5, float* %3
%6 = load float, float* %3
%7 = load float, float* %3
%8 = fmul float %6, %7
%9 = load float, float* %3
%10 = fmul float %8, %9
%11 = load float, float* %3
%12 = fmul float %10, %11
%13 = load float, float* %3
%14 = call float @llvm.fmuladd.f32(float %12, float %13, float 1.000000e+00)
ret float %14
}

LLVM IR (-O2):
define float @quintic_ease_out(float %0) {
%2 = fadd float %0, -1.000000e+00
%3 = fmul float %2, %2
%4 = fmul float %2, %3
%5 = fmul float %2, %4
%6 = tail call float @llvm.fmuladd.f32(float %5, float %2, float 1.000000e+00)
ret float %6
}
/* Variables and functions */
int eg_indirect_table_get(unsigned int, int, unsigned int, int, unsigned int *);
int eg_sak_table_get(unsigned int dev_id, unsigned int index,
                     unsigned int *pentry) {
  if ((index < 64) || (index > 95)) {
    return -1;
  }
  return eg_indirect_table_get(dev_id, 2, index, 4, pentry);
}


x86 assembly (clang, -O0):
<eg_sak_table_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x40,-0xc(%rbp)
jb     1136 <eg_sak_table_get+0x26>
cmpl   $0x5f,-0xc(%rbp)
jbe    1142 <eg_sak_table_get+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <eg_sak_table_get+0x4e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    $0x2,%esi
mov    $0x4,%ecx
call   1030 <eg_indirect_table_get@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eg_sak_table_get>:
mov    %rdx,%r8
mov    %esi,%edx
lea    -0x60(%rdx),%eax
cmp    $0xffffffe0,%eax
jae    1123 <eg_sak_table_get+0x13>
mov    $0xffffffff,%eax
ret
mov    $0x2,%esi
mov    $0x4,%ecx
jmp    1030 <eg_indirect_table_get@plt>

LLVM IR (-O0):
define i32 @eg_sak_table_get(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 64
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ugt i32 %11, 95
br i1 %12, label %13, label %14
13: ; preds = %10, %3
store i32 -1, i32* %4
br label %19
14: ; preds = %10
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load i32*, i32** %7
%18 = call i32 @eg_indirect_table_get(i32 %15, i32 2, i32 %16, i32 4, i32* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @eg_sak_table_get(i32 %0, i32 %1, i32* %2) {
%4 = add i32 %1, -96
%5 = icmp ult i32 %4, -32
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @eg_indirect_table_get(i32 %0, i32 2, i32 %1, i32 4, i32* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t lsli31(uint32_t x) { return x << 31; }


x86 assembly (clang, -O0):
<lsli31>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsli31>:
mov    %edi,%eax
shl    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @lsli31(i32 %0) {
%2 = shl i32 %0, 31
ret i32 %2
}
long return_long_0() { return -1073741825; }


x86 assembly (clang, -O0):
<return_long_0>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffbfffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_long_0>:
mov    $0xffffffffbfffffff,%rax
ret

LLVM IR (-O0):
define i64 @return_long_0() {
ret i64 -1073741825
}

LLVM IR (-O2):
define i64 @return_long_0() {
ret i64 -1073741825
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ fputwc(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
wint_t putwchar(wchar_t wc) { return fputwc(wc, stdout); }


x86 assembly (clang, -O0):
<putwchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <fputwc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putwchar>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputwc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @putwchar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputwc(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @putwchar(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputwc(i32 %0, i32 %2)
ret i32 %3
}
/* Type definitions */
struct timeval {
  double tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double tvFloat(struct timeval time) {
  return ((double)time.tv_sec + (time.tv_usec / 1000000.0));
}


x86 assembly (clang, -O0):
<tvFloat>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tvFloat>:
cvtsi2sd %rdi,%xmm1
divsd  0xef3(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @tvFloat(double %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to { double, i64 }*
%5 = getelementptr inbounds { double, i64 }, { double, i64 }* %4, i32 0, i32 0
store double %0, double* %5
%6 = getelementptr inbounds { double, i64 }, { double, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%11 = load double, double* %10
%12 = fdiv double %11, 1.000000e+06
%13 = fadd double %9, %12
ret double %13
}

LLVM IR (-O2):
define double @tvFloat(double %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = fdiv double %0, 1.000000e+06
%5 = fadd double %4, %3
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void crt_exception(int c, const char *s) {
  perror(s);
  exit(c);
}


x86 assembly (clang, -O0):
<crt_exception>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<crt_exception>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <perror@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @crt_exception(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @perror(i8* %5)
%7 = load i32, i32* %3
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
define void @crt_exception(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @perror(i8* %1)
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
scalar_t__ kmemmem(char const *, int /*<<< orphan*/, char const *,
                   int /*<<< orphan*/, int **);
int /*<<< orphan*/ strlen(char const *);
char *kstrstr(const char *str, const char *pat, int **_prep) {
  return (char *)kmemmem(str, strlen(str), pat, strlen(pat), _prep);
}


x86 assembly (clang, -O0):
<kstrstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
mov    -0x18(%rbp),%r8
call   1040 <kmemmem@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kstrstr>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15,%rdx
mov    %eax,%ecx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <kmemmem@plt>

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

LLVM IR (-O2):
define i8* @kstrstr(i8* %0, i8* %1, i32** %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i64 @kmemmem(i8* %0, i32 %4, i8* %1, i32 %5, i32** %2)
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
void reverse(char *from, char *to) {
  char tmp;
  while (from < to) {
    tmp = *from;
    *from++ = *to;
    *to-- = tmp;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1153 <reverse+0x53>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <reverse+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    %rsi,%rdi
jae    112c <reverse+0x2c>
add    $0xffffffffffffffff,%rsi
nopl   0x0(%rax)
movzbl (%rdi),%eax
movzbl 0x1(%rsi),%ecx
mov    %cl,(%rdi)
add    $0x1,%rdi
mov    %al,0x1(%rsi)
lea    -0x1(%rsi),%rax
cmp    %rsi,%rdi
mov    %rax,%rsi
jb     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define void @reverse(i8* %0, i8* %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i8* [ %9, %4 ], [ %0, %2 ]
%6 = phi i8* [ %10, %4 ], [ %1, %2 ]
%7 = load i8, i8* %5
%8 = load i8, i8* %6
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %8, i8* %5
%10 = getelementptr inbounds i8, i8* %6, i64 -1
store i8 %7, i8* %6
%11 = icmp ult i8* %9, %10
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
void gensdr() {}


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

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

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

LLVM IR (-O2):
define void @gensdr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arc_kflag(int);
void bar(void) { __builtin_arc_kflag(0x10); }


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

x86 assembly (clang, -O2):
<bar>:
mov    $0x10,%edi
jmp    1030 <__builtin_arc_kflag@plt>

LLVM IR (-O0):
define void @bar() {
%1 = call i32 @__builtin_arc_kflag(i32 16)
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 @__builtin_arc_kflag(i32 16)
ret void
}