xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int psd_test();
int /*<<< orphan*/ start_file(int /*<<< orphan*/ *);
int stbi_psd_test_file(FILE *f) {
  int r, n = ftell(f);
  start_file(f);
  r = psd_test();
  fseek(f, n, SEEK_SET);
  return r;
}


x86 assembly (clang, -O0):
<stbi_psd_test_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <start_file@plt>
mov    $0x0,%al
call   1060 <psd_test@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    0x2e67(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi_psd_test_file>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1040 <ftell@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <start_file@plt>
xor    %eax,%eax
call   1060 <psd_test@plt>
mov    %eax,%ebp
mov    0x2e79(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1050 <fseek@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @stbi_psd_test_file(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @ftell(i32* %5)
store i32 %6, i32* %4
%7 = load i32*, i32** %2
%8 = call i32 @start_file(i32* %7)
%9 = call i32 (...) @psd_test()
store i32 %9, i32* %3
%10 = load i32*, i32** %2
%11 = load i32, i32* %4
%12 = load i32, i32* @SEEK_SET
%13 = call i32 @fseek(i32* %10, i32 %11, i32 %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @stbi_psd_test_file(i32* %0) {
%2 = tail call i32 @ftell(i32* %0)
%3 = tail call i32 @start_file(i32* %0)
%4 = tail call i32 (...) @psd_test()
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 %2, i32 %5)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ localtime_r(scalar_t__ *, struct tm *);
scalar_t__ time(int /*<<< orphan*/ *);
scalar_t__ timegm(struct tm *);
time_t local_time_offset(void) {
  time_t now = time(NULL);
  struct tm tm;
  localtime_r(&now, &tm);
  return timegm(&tm) - now;
}


x86 assembly (clang, -O0):
<local_time_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <localtime_r@plt>
lea    -0x10(%rbp),%rdi
call   1050 <timegm@plt>
sub    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_time_offset>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,(%rsp)
mov    %rsp,%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <localtime_r@plt>
mov    %rbx,%rdi
call   1050 <timegm@plt>
sub    (%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i64 @local_time_offset() {
%1 = alloca i64
%2 = alloca %struct.tm
%3 = call i64 @time(i32* null)
store i64 %3, i64* %1
%4 = call i32 @localtime_r(i64* %1, %struct.tm* %2)
%5 = call i64 @timegm(%struct.tm* %2)
%6 = load i64, i64* %1
%7 = sub nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i64 @local_time_offset() {
%1 = alloca i64
%2 = alloca %struct.tm
%3 = bitcast i64* %1 to i8*
%4 = tail call i64 @time(i32* null)
store i64 %4, i64* %1
%5 = bitcast %struct.tm* %2 to i8*
%6 = call i32 @localtime_r(i64* %1, %struct.tm* %2)
%7 = call i64 @timegm(%struct.tm* %2)
%8 = load i64, i64* %1
%9 = sub nsw i64 %7, %8
ret i64 %9
}
void foo582(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo582(i32 %0) {
ret void
}
int main() {
  int a = 0;
  int b = 0x7fffffff;
  int t = (a - 2) > (b - 1);
  if (t != 0)
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x7fffffff,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1155 <main+0x45>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 2147483647, i32* %3
%5 = load i32, i32* %2
%6 = sub nsw i32 %5, 2
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
%9 = icmp sgt i32 %6, %8
%10 = zext i1 %9 to i32
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %0
unreachable
14: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ip_get_ihl(const uint8_t *p_ip) { return p_ip[0] & 0xf; }


x86 assembly (clang, -O0):
<ip_get_ihl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_get_ihl>:
mov    (%rdi),%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @ip_get_ihl(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, 15
ret i32 %6
}

LLVM IR (-O2):
define i32 @ip_get_ihl(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 15
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ LOG_ERR;
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, size_t);
void *xcalloc(size_t size, size_t item_size) {
  void *p = calloc(size, item_size);
  if (p == NULL) {
    syslog(LOG_ERR, "calloc() failed to allocate %d bytes", size);
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1183 <xcalloc+0x53>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1040 <syslog@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <calloc@plt>
test   %rax,%rax
je     1140 <xcalloc+0x10>
pop    %rbx
ret
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <syslog@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [37 x i8] c"calloc() failed to allocate %d bytes\00"
@EXIT_FAILURE = global i32 0
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i32, i32* @LOG_ERR
%13 = load i64, i64* %3
%14 = call i32 @syslog(i32 %12, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %2
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [37 x i8] c"calloc() failed to allocate %d bytes\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @LOG_ERR
%7 = tail call i32 @syslog(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %0)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void grandson() { printf("grandson\n"); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @RTSocketSelectOneEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
void bar(int x) { __VERIFIER_assert(x < x + 1); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = icmp slt i32 %3, %5
%7 = zext i1 %6 to i32
%8 = call i32 @__VERIFIER_assert(i32 %7)
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = tail call i32 @__VERIFIER_assert(i32 1)
ret void
}
int HuanQi_KuangNuQiangFa_cost(struct Ability *self) { return 63; }


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

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

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

LLVM IR (-O2):
%struct.Ability = type opaque
define i32 @HuanQi_KuangNuQiangFa_cost(%struct.Ability* nocapture readnone %0) {
ret i32 63
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void daughter_say(void) { printf("My Dad,are you call me?/n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"My Dad,are you call me?/n\00"
define void @daughter_say() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"My Dad,are you call me?/n\00"
define void @daughter_say() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
int Operand_br8_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~(0x1 << 3)) != 0;
  *valp = *valp >> 3;
  return error;
}


x86 assembly (clang, -O0):
<Operand_br8_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xfffffff7,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shr    $0x3,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_br8_encode>:
mov    (%rdi),%ecx
xor    %eax,%eax
test   $0xfffffff7,%ecx
setne  %al
shr    $0x3,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define i32 @Operand_br8_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = and i32 %5, -9
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = lshr i32 %10, 3
%12 = load i32*, i32** %2
store i32 %11, i32* %12
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @Operand_br8_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, -9
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = lshr i32 %2, 3
store i32 %6, i32* %0
ret i32 %5
}
/* Variables and functions */
scalar_t__ __is_zero_mb(unsigned long);
int /*<<< orphan*/ page_is_valid(unsigned long);
int is_zero_mb(unsigned long addr) {
  if (!page_is_valid(addr))
    return 1;
  if (__is_zero_mb(addr))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_zero_mb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <page_is_valid@plt>
cmp    $0x0,%eax
jne    114a <is_zero_mb+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1170 <is_zero_mb+0x50>
mov    -0x10(%rbp),%rdi
call   1030 <__is_zero_mb@plt>
cmp    $0x0,%rax
je     1169 <is_zero_mb+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1170 <is_zero_mb+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_zero_mb>:
push   %rbx
mov    %rdi,%rbx
call   1040 <page_is_valid@plt>
test   %eax,%eax
je     1142 <is_zero_mb+0x22>
mov    %rbx,%rdi
call   1030 <__is_zero_mb@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_zero_mb(i64 %0) {
%2 = tail call i32 @page_is_valid(i64 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @__is_zero_mb(i64 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XFontsOfFontSet() {
  printf("XFontsOfFontSet called\n");
  return 0;
}


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

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

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

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ *fshm_open(char const *, int /*<<< orphan*/, int);
FILE *fshm_guest_open(const char *name) { return fshm_open(name, 0, 2); }


x86 assembly (clang, -O0):
<fshm_guest_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <fshm_open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fshm_guest_open>:
xor    %esi,%esi
mov    $0x2,%edx
jmp    1030 <fshm_open@plt>

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

LLVM IR (-O2):
define i32* @fshm_guest_open(i8* %0) {
%2 = tail call i32* @fshm_open(i8* %0, i32 0, i32 2)
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
int check_size_available(char *file_memory, int size) {
  int mem_ptr = 0;
  mem_ptr = *file_memory;
  mem_ptr = (mem_ptr << 8) + *(file_memory + 1);
  if ((mem_ptr + size + 2) > 0x1000) {
    memset(file_memory, '\0', 0x1000);
  }
  return mem_ptr;
}


x86 assembly (clang, -O0):
<check_size_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x2,%eax
cmp    $0x1000,%eax
jle    1167 <check_size_available+0x57>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_size_available>:
push   %rbx
movsbl (%rdi),%eax
shl    $0x8,%eax
movsbl 0x1(%rdi),%ebx
add    %eax,%ebx
add    %ebx,%esi
cmp    $0xfff,%esi
jl     1133 <check_size_available+0x23>
xor    %esi,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @check_size_available(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = shl nsw i32 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = add nsw i32 %5, %8
%10 = add nsw i32 %9, %1
%11 = icmp sgt i32 %10, 4094
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = tail call i32 @memset(i8* %0, i8 signext 0, i32 4096)
br label %14
14: ; preds = %12, %2
ret i32 %9
}
/* Type definitions */
struct trace_seq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ scsi_trace_parse_cdb(struct trace_seq *, unsigned char *,
                                        unsigned long long);
unsigned long long process_scsi_trace_parse_cdb(struct trace_seq *s,
                                                unsigned long long *args) {
  scsi_trace_parse_cdb(s, (unsigned char *)args[1], args[2]);
  return 0;
}


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

x86 assembly (clang, -O2):
<process_scsi_trace_parse_cdb>:
push   %rax
mov    0x8(%rsi),%rax
mov    0x10(%rsi),%rdx
mov    %rax,%rsi
call   1030 <scsi_trace_parse_cdb@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.trace_seq = type { i32 }
define i64 @process_scsi_trace_parse_cdb(%struct.trace_seq* %0, i64* %1) {
%3 = alloca %struct.trace_seq*
%4 = alloca i64*
store %struct.trace_seq* %0, %struct.trace_seq** %3
store i64* %1, i64** %4
%5 = load %struct.trace_seq*, %struct.trace_seq** %3
%6 = load i64*, i64** %4
%7 = getelementptr inbounds i64, i64* %6, i64 1
%8 = load i64, i64* %7
%9 = inttoptr i64 %8 to i8*
%10 = load i64*, i64** %4
%11 = getelementptr inbounds i64, i64* %10, i64 2
%12 = load i64, i64* %11
%13 = call i32 @scsi_trace_parse_cdb(%struct.trace_seq* %5, i8* %9, i64 %12)
ret i64 0
}

LLVM IR (-O2):
%struct.trace_seq = type { i32 }
define i64 @process_scsi_trace_parse_cdb(%struct.trace_seq* %0, i64* nocapture %1) {
%3 = getelementptr inbounds i64, i64* %1, i64 1
%4 = load i64, i64* %3
%5 = inttoptr i64 %4 to i8*
%6 = getelementptr inbounds i64, i64* %1, i64 2
%7 = load i64, i64* %6
%8 = tail call i32 @scsi_trace_parse_cdb(%struct.trace_seq* %0, i8* %5, i64 %7)
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void j1_vert(int unknown, int push) { printf("J1 VERT: %i\n", push); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"J1 VERT: %i\0A\00"
define void @j1_vert(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"J1 VERT: %i\0A\00"
define void @j1_vert(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double Timespec_diff(const struct timespec x, const struct timespec y) {
  return ((double)(x.tv_sec - y.tv_sec) +
          ((double)(x.tv_nsec - y.tv_nsec)) / (1000.0 * 1000.0 * 1000.0));
}


x86 assembly (clang, -O0):
<Timespec_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x18(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    -0x10(%rbp),%rax
sub    -0x20(%rbp),%rax
cvtsi2sd %rax,%xmm1
movsd  0xeca(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Timespec_diff>:
sub    %rcx,%rsi
cvtsi2sd %rsi,%xmm1
sub    %rdx,%rdi
cvtsi2sd %rdi,%xmm0
divsd  0xee8(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define double @Timespec_diff(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timespec
%6 = alloca %struct.timespec
%7 = bitcast %struct.timespec* %5 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = bitcast %struct.timespec* %6 to { i64, i64 }*
%11 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 0
store i64 %2, i64* %11
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 1
store i64 %3, i64* %12
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 1
%14 = load i64, i64* %13
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 1
%16 = load i64, i64* %15
%17 = sub nsw i64 %14, %16
%18 = sitofp i64 %17 to double
%19 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%20 = load i64, i64* %19
%21 = getelementptr inbounds %struct.timespec, %struct.timespec* %6, i32 0, i32 0
%22 = load i64, i64* %21
%23 = sub nsw i64 %20, %22
%24 = sitofp i64 %23 to double
%25 = fdiv double %24, 1.000000e+09
%26 = fadd double %18, %25
ret double %26
}

LLVM IR (-O2):
define double @Timespec_diff(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub nsw i64 %1, %3
%6 = sitofp i64 %5 to double
%7 = sub nsw i64 %0, %2
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+09
%10 = fadd double %9, %6
ret double %10
}
BOOST_AUTO_TEST_CASE(tan) { TESTCASE1(tan, 0, 0); }


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <TESTCASE1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <TESTCASE1@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %4, i32 0, i32 0)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 0, i32 0)
ret i32 undef
}
int null_read_mixer() { return 100; }


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

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

LLVM IR (-O0):
define i32 @null_read_mixer() {
ret i32 100
}

LLVM IR (-O2):
define i32 @null_read_mixer() {
ret i32 100
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t imin64(int64_t a, int64_t b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<imin64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <imin64+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <imin64+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imin64>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @imin64(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void ff_hevc_put_hevc_qpel_h48_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h48_8_avx2() {
ret void
}
/* Variables and functions */
scalar_t__ isatty(int);
int IsAtty(int fd) {
  if (isatty(fd))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IsAtty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isatty@plt>
cmp    $0x0,%rax
je     1139 <IsAtty+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1140 <IsAtty+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsAtty>:
push   %rax
call   1030 <isatty@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @IsAtty(i32 %0) {
%2 = tail call i64 @isatty(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int eh_par(int);
int /*<<< orphan*/ puts(int);
void test() {
  puts(eh_par(6) == 1);
  puts(eh_par(3) == 0);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1030 <eh_par@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <puts@plt>
mov    $0x3,%edi
call   1030 <eh_par@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x6,%edi
call   1030 <eh_par@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <puts@plt>
mov    $0x3,%edi
call   1030 <eh_par@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
define void @test() {
%1 = call i32 @eh_par(i32 6)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = call i32 @puts(i32 %3)
%5 = call i32 @eh_par(i32 3)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @puts(i32 %7)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @eh_par(i32 6)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @puts(i32 %3)
%5 = tail call i32 @eh_par(i32 3)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @puts(i32 %7)
ret void
}
/* Type definitions */
struct ns_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ns_call(struct ns_connection *, int, char *);
void do_ssi_call(struct ns_connection *nc, char *tag) { ns_call(nc, 105, tag); }


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

x86 assembly (clang, -O2):
<do_ssi_call>:
mov    %rsi,%rdx
mov    $0x69,%esi
jmp    1030 <ns_call@plt>

LLVM IR (-O0):
%struct.ns_connection = type { i32 }
define void @do_ssi_call(%struct.ns_connection* %0, i8* %1) {
%3 = alloca %struct.ns_connection*
%4 = alloca i8*
store %struct.ns_connection* %0, %struct.ns_connection** %3
store i8* %1, i8** %4
%5 = load %struct.ns_connection*, %struct.ns_connection** %3
%6 = load i8*, i8** %4
%7 = call i32 @ns_call(%struct.ns_connection* %5, i32 105, i8* %6)
ret void
}

LLVM IR (-O2):
%struct.ns_connection = type { i32 }
define void @do_ssi_call(%struct.ns_connection* %0, i8* %1) {
%3 = tail call i32 @ns_call(%struct.ns_connection* %0, i32 105, i8* %1)
ret void
}
void callee3() {}


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

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

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

LLVM IR (-O2):
define void @callee3() {
ret void
}
int fastcompare(const char *s1, const char *s2, int length) {
  unsigned int i;
  for (i = 0; i < length; i++) {
    if (*(s1 + i) != *(s2 + i))
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fastcompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jae    115f <fastcompare+0x5f>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%edx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     114c <fastcompare+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1166 <fastcompare+0x66>
jmp    1151 <fastcompare+0x51>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <fastcompare+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastcompare>:
test   %edx,%edx
je     1122 <fastcompare+0x22>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movzbl (%rdi,%rcx,1),%edx
cmp    (%rsi,%rcx,1),%dl
jne    1125 <fastcompare+0x25>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <fastcompare+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ *smdb_load_netkey(int, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ **,
                                     int /*<<< orphan*/ **,
                                     int /*<<< orphan*/ **,
                                     int /*<<< orphan*/ **);
uint8_t *smdb_load_kr_netkey(uint32_t idx, uint8_t *nid, uint8_t **nwk_id,
                             uint8_t **enc_key, uint8_t **pri_key,
                             uint8_t **bcon_key) {
  idx |= (0x80000000);
  return smdb_load_netkey(idx, nid, nwk_id, enc_key, pri_key, bcon_key);
}


x86 assembly (clang, -O0):
<smdb_load_kr_netkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%eax
or     $0x80000000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <smdb_load_netkey@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smdb_load_kr_netkey>:
or     $0x80000000,%edi
jmp    1030 <smdb_load_netkey@plt>

LLVM IR (-O0):
define i32* @smdb_load_kr_netkey(i32 %0, i32* %1, i32** %2, i32** %3, i32** %4, i32** %5) {
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32**
%10 = alloca i32**
%11 = alloca i32**
%12 = alloca i32**
store i32 %0, i32* %7
store i32* %1, i32** %8
store i32** %2, i32*** %9
store i32** %3, i32*** %10
store i32** %4, i32*** %11
store i32** %5, i32*** %12
%13 = load i32, i32* %7
%14 = or i32 %13, -2147483648
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = load i32*, i32** %8
%17 = load i32**, i32*** %9
%18 = load i32**, i32*** %10
%19 = load i32**, i32*** %11
%20 = load i32**, i32*** %12
%21 = call i32* @smdb_load_netkey(i32 %15, i32* %16, i32** %17, i32** %18, i32** %19, i32** %20)
ret i32* %21
}

LLVM IR (-O2):
define i32* @smdb_load_kr_netkey(i32 %0, i32* %1, i32** %2, i32** %3, i32** %4, i32** %5) {
%7 = or i32 %0, -2147483648
%8 = tail call i32* @smdb_load_netkey(i32 %7, i32* %1, i32** %2, i32** %3, i32** %4, i32** %5)
ret i32* %8
}
/* Type definitions */
struct nfa {
  int dummy;
};

/* Variables and functions */
struct nfa *new_range_nfa(int, int /*<<< orphan*/);
struct nfa *new_empty_nfa(void) {
  return new_range_nfa((127 + 1), 0);
}


x86 assembly (clang, -O0):
<new_empty_nfa>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80,%edi
xor    %esi,%esi
call   1030 <new_range_nfa@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_empty_nfa>:
mov    $0x80,%edi
xor    %esi,%esi
jmp    1030 <new_range_nfa@plt>

LLVM IR (-O0):
%struct.nfa = type { i32 }
define %struct.nfa* @new_empty_nfa() {
%1 = call %struct.nfa* @new_range_nfa(i32 128, i32 0)
ret %struct.nfa* %1
}

LLVM IR (-O2):
%struct.nfa = type { i32 }
define %struct.nfa* @new_empty_nfa() {
%1 = tail call %struct.nfa* @new_range_nfa(i32 128, i32 0)
ret %struct.nfa* %1
}
/* Variables and functions */
int /*<<< orphan*/ gps_init();
int main(void) {
  gps_init();
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <gps_init@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <gps_init@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gps_init()
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gps_init()
br label %2
2: ; preds = %0, %2
br label %2
}
void J420ToRAW() {}


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

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

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

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

/* Variables and functions */
char *wpa_config_write_wep_key(struct wpa_ssid *, int);
char *wpa_config_write_wep_key2(const struct parse_data *data,
                                struct wpa_ssid *ssid) {
  return wpa_config_write_wep_key(ssid, 2);
}


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

x86 assembly (clang, -O2):
<wpa_config_write_wep_key2>:
mov    %rsi,%rdi
mov    $0x2,%esi
jmp    1030 <wpa_config_write_wep_key@plt>

LLVM IR (-O0):
%struct.parse_data = type { i32 }
%struct.wpa_ssid = type { i32 }
define i8* @wpa_config_write_wep_key2(%struct.parse_data* %0, %struct.wpa_ssid* %1) {
%3 = alloca %struct.parse_data*
%4 = alloca %struct.wpa_ssid*
store %struct.parse_data* %0, %struct.parse_data** %3
store %struct.wpa_ssid* %1, %struct.wpa_ssid** %4
%5 = load %struct.wpa_ssid*, %struct.wpa_ssid** %4
%6 = call i8* @wpa_config_write_wep_key(%struct.wpa_ssid* %5, i32 2)
ret i8* %6
}

LLVM IR (-O2):
%struct.parse_data = type { i32 }
%struct.wpa_ssid = type { i32 }
define i8* @wpa_config_write_wep_key2(%struct.parse_data* nocapture readnone %0, %struct.wpa_ssid* %1) {
%3 = tail call i8* @wpa_config_write_wep_key(%struct.wpa_ssid* %1, i32 2)
ret i8* %3
}
/* Variables and functions */
int lexLookahead();
int /*<<< orphan*/ lexSkipLookahead();
void lexSkipWhite() {
  int c = lexLookahead();
  while (c == ' ' || c == '\t') {
    lexSkipLookahead();
    c = lexLookahead();
  }
}


x86 assembly (clang, -O0):
<lexSkipWhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <lexLookahead@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114b <lexSkipWhite+0x2b>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    115b <lexSkipWhite+0x3b>
jmp    1171 <lexSkipWhite+0x51>
mov    $0x0,%al
call   1030 <lexSkipLookahead@plt>
mov    $0x0,%al
call   1040 <lexLookahead@plt>
mov    %eax,-0x4(%rbp)
jmp    1132 <lexSkipWhite+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lexSkipWhite>:
push   %rax
jmp    1137 <lexSkipWhite+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <lexSkipLookahead@plt>
xor    %eax,%eax
call   1040 <lexLookahead@plt>
cmp    $0x20,%eax
je     1130 <lexSkipWhite+0x10>
cmp    $0x9,%eax
je     1130 <lexSkipWhite+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @lexSkipWhite() {
%1 = alloca i32
%2 = call i32 (...) @lexLookahead()
store i32 %2, i32* %1
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 32
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 9
br label %9
9: ; preds = %6, %3
%10 = phi i1 [ true, %3 ], [ %8, %6 ]
br i1 %10, label %11, label %14
11: ; preds = %9
%12 = call i32 (...) @lexSkipLookahead()
%13 = call i32 (...) @lexLookahead()
store i32 %13, i32* %1
br label %3
14: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @lexSkipWhite() {
br label %1
1: ; preds = %3, %0
%2 = tail call i32 (...) @lexLookahead()
switch i32 %2, label %5 [
i32 32, label %3
i32 9, label %3
]
3: ; preds = %1, %1
%4 = tail call i32 (...) @lexSkipLookahead()
br label %1
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit2(int);
int empty_return_int(int a) {
  if (a > 0) {
    return 1;
  } else {
    exit2(-1);
  }
}


x86 assembly (clang, -O0):
<empty_return_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1131 <empty_return_int+0x21>
movl   $0x1,-0x4(%rbp)
jmp    113b <empty_return_int+0x2b>
mov    $0xffffffff,%edi
call   1030 <exit2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_return_int>:
test   %edi,%edi
jle    111a <empty_return_int+0xa>
mov    $0x1,%eax
ret
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit2@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @empty_return_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %9
7: ; preds = %1
%8 = call i32 @exit2(i32 -1)
br label %9
9: ; preds = %6, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @empty_return_int(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @exit2(i32 -1)
br label %5
5: ; preds = %1, %3
ret i32 1
}
/* Variables and functions */
int GCD(int, int);
char const *va(char *, int, int);
const char *UI_DisplayAspectString(int w, int h) {
  int gcd = GCD(w, h);
  w /= gcd;
  h /= gcd;
  if (w == 8 && h == 5) {
    w = 16;
    h = 10;
  }
  return va("%d:%d", w, h);
}


x86 assembly (clang, -O0):
<UI_DisplayAspectString>:
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 <GCD@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x8,-0x4(%rbp)
jne    1176 <UI_DisplayAspectString+0x56>
cmpl   $0x5,-0x8(%rbp)
jne    1176 <UI_DisplayAspectString+0x56>
movl   $0x10,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe7d(%rip),%rdi
call   1030 <va@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_DisplayAspectString>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <GCD@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%edi
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %edi,%ecx
xor    $0x8,%ecx
mov    %eax,%edx
xor    $0x5,%edx
or     %ecx,%edx
mov    $0xa,%edx
cmovne %eax,%edx
mov    $0x10,%esi
cmovne %edi,%esi
lea    0xea3(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <va@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%d:%d\00"
define i8* @UI_DisplayAspectString(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 = load i32, i32* %4
%8 = call i32 @GCD(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %3
%11 = sdiv i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %5
%13 = load i32, i32* %4
%14 = sdiv i32 %13, %12
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 8
br i1 %16, label %17, label %21
17: ; preds = %2
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 5
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 16, i32* %3
store i32 10, i32* %4
br label %21
21: ; preds = %20, %17, %2
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = call i8* @va(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %23)
ret i8* %24
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d:%d\00"
define i8* @UI_DisplayAspectString(i32 %0, i32 %1) {
%3 = tail call i32 @GCD(i32 %0, i32 %1)
%4 = sdiv i32 %0, %3
%5 = sdiv i32 %1, %3
%6 = icmp eq i32 %4, 8
%7 = icmp eq i32 %5, 5
%8 = and i1 %6, %7
%9 = select i1 %8, i32 10, i32 %5
%10 = select i1 %8, i32 16, i32 %4
%11 = tail call i8* @va(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, int *, float *);
int main() {
  int X;
  float Y, totalFuel;
  scanf("%d %f", &X, &Y);
  totalFuel = X / Y;
  printf("%.3f km/l\n", totalFuel);
  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
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cvtsi2ssl -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cvtsi2ssl 0x4(%rsp),%xmm0
divss  (%rsp),%xmm0
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %f\00"
@.str.1 = [11 x i8] c"%.3f km/l\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, float* %3)
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to float
%8 = load float, float* %3
%9 = fdiv float %7, %8
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %f\00"
@.str.1 = [11 x i8] c"%.3f km/l\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, float* %2)
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to float
%8 = load float, float* %2
%9 = fdiv float %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %9)
ret i32 0
}
void socksswitch_init() {}


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

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

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

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