xunge/DecIR huggingface dataset:
int search_link_failure(struct NETWORK *NTW, int fiber,
                        struct SPARAMETERS *SM_Parameters, int wave, int dest,
                        int ndr) {
  int blocked, i, jj, INITIAL_FIBER, N2;
  blocked = 0;
  return blocked;
}


x86 assembly (clang, -O0):
<search_link_failure>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.NETWORK = type opaque
%struct.SPARAMETERS = type opaque
define i32 @search_link_failure(%struct.NETWORK* %0, i32 %1, %struct.SPARAMETERS* %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca %struct.NETWORK*
%8 = alloca i32
%9 = alloca %struct.SPARAMETERS*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
store %struct.NETWORK* %0, %struct.NETWORK** %7
store i32 %1, i32* %8
store %struct.SPARAMETERS* %2, %struct.SPARAMETERS** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
store i32 0, i32* %13
%18 = load i32, i32* %13
ret i32 %18
}

LLVM IR (-O2):
%struct.NETWORK = type opaque
%struct.SPARAMETERS = type opaque
define i32 @search_link_failure(%struct.NETWORK* nocapture readnone %0, i32 %1, %struct.SPARAMETERS* nocapture readnone %2, i32 %3, i32 %4, i32 %5) {
ret i32 0
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ sprintf(char *, char *, int);
int system(char *);
int ignore_oom() {
  char buf[64];
  sprintf(buf, "echo -17 > /proc/%d/oom_adj", getpid());
  return system(buf);
}


x86 assembly (clang, -O0):
<ignore_oom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%edx
lea    0xeac(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1040 <system@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_oom>:
push   %rbx
sub    $0x40,%rsp
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xebd(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"echo -17 > /proc/%d/oom_adj\00"
define i32 @ignore_oom() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 (...) @getpid()
%4 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [28 x i8] c"echo -17 > /proc/%d/oom_adj\00"
define i32 @ignore_oom() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @getpid()
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @system(i8* %2)
ret i32 %5
}
void mss2_init(void) {}


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

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

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

LLVM IR (-O2):
define void @mss2_init() {
ret void
}
unsigned long long __read_8_sw(void *ptr) {
  unsigned long long data = *(unsigned long long *)ptr;
  unsigned long long swap;
  swap = ((data & 0xffULL) << 56) | ((data & (0xffULL << 8)) << 40) |
         ((data & (0xffULL << 16)) << 24) | ((data & (0xffULL << 24)) << 8) |
         ((data & (0xffULL << 32)) >> 8) | ((data & (0xffULL << 40)) >> 24) |
         ((data & (0xffULL << 48)) >> 40) | ((data & (0xffULL << 56)) >> 56);
  return swap;
}


x86 assembly (clang, -O0):
<__read_8_sw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
shl    $0x38,%rax
mov    -0x10(%rbp),%rcx
and    $0xff00,%rcx
shl    $0x28,%rcx
or     %rcx,%rax
mov    -0x10(%rbp),%rcx
and    $0xff0000,%rcx
shl    $0x18,%rcx
or     %rcx,%rax
movabs $0xff000000,%rcx
and    -0x10(%rbp),%rcx
shl    $0x8,%rcx
or     %rcx,%rax
movabs $0xff00000000,%rcx
and    -0x10(%rbp),%rcx
shr    $0x8,%rcx
or     %rcx,%rax
movabs $0xff0000000000,%rcx
and    -0x10(%rbp),%rcx
shr    $0x18,%rcx
or     %rcx,%rax
movabs $0xff000000000000,%rcx
and    -0x10(%rbp),%rcx
shr    $0x28,%rcx
or     %rcx,%rax
movabs $0xff00000000000000,%rcx
and    -0x10(%rbp),%rcx
shr    $0x38,%rcx
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__read_8_sw>:
mov    (%rdi),%rax
bswap  %rax
ret

LLVM IR (-O0):
define i64 @__read_8_sw(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = and i64 %8, 255
%10 = shl i64 %9, 56
%11 = load i64, i64* %3
%12 = and i64 %11, 65280
%13 = shl i64 %12, 40
%14 = or i64 %10, %13
%15 = load i64, i64* %3
%16 = and i64 %15, 16711680
%17 = shl i64 %16, 24
%18 = or i64 %14, %17
%19 = load i64, i64* %3
%20 = and i64 %19, 4278190080
%21 = shl i64 %20, 8
%22 = or i64 %18, %21
%23 = load i64, i64* %3
%24 = and i64 %23, 1095216660480
%25 = lshr i64 %24, 8
%26 = or i64 %22, %25
%27 = load i64, i64* %3
%28 = and i64 %27, 280375465082880
%29 = lshr i64 %28, 24
%30 = or i64 %26, %29
%31 = load i64, i64* %3
%32 = and i64 %31, 71776119061217280
%33 = lshr i64 %32, 40
%34 = or i64 %30, %33
%35 = load i64, i64* %3
%36 = and i64 %35, -72057594037927936
%37 = lshr i64 %36, 56
%38 = or i64 %34, %37
store i64 %38, i64* %4
%39 = load i64, i64* %4
ret i64 %39
}

LLVM IR (-O2):
define i64 @__read_8_sw(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = tail call i64 @llvm.bswap.i64(i64 %3)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ getuid();
int shutdown();
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (getuid() != 0) {
    fprintf(stderr, "halt: must be superuser\n");
    return 1;
  } else {
    return shutdown();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getuid@plt>
cmp    $0x0,%rax
je     1178 <main+0x48>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1182 <main+0x52>
mov    $0x0,%al
call   1030 <shutdown@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getuid@plt>
test   %rax,%rax
je     1159 <main+0x29>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <shutdown@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"halt: must be superuser\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 (...) @getuid()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %13
11: ; preds = %2
%12 = call i32 (...) @shutdown()
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"halt: must be superuser\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @getuid()
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %2
%9 = tail call i32 (...) @shutdown()
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ 1, %5 ], [ %9, %8 ]
ret i32 %11
}
void spl_debug_bug(char *file, const char *fn, const int line, int fl) {
  return;
}


x86 assembly (clang, -O0):
<spl_debug_bug>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @spl_debug_bug(i8* %0, i8* %1, i32 %2, i32 %3) {
%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 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @spl_debug_bug(i8* nocapture %0, i8* nocapture %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_entry(char *, int, void *, size_t);
int /*<<< orphan*/ die_mem(char *, int);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *safe_malloc_internal(size_t size, char *file, int line) {
  void *ret = malloc(size);
  if (!ret)
    die_mem(file, line);
  memset(ret, 0, size);
  add_entry(file, line, ret, size);
  return ret;
}


x86 assembly (clang, -O0):
<safe_malloc_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1177 <safe_malloc_internal+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <die_mem@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rcx
call   1040 <add_entry@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc_internal>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbx
call   1050 <malloc@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1168 <safe_malloc_internal+0x28>
mov    %r15,%rdi
mov    %r14d,%esi
call   1060 <die_mem@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbp,%rdx
mov    %rbx,%rcx
call   1040 <add_entry@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @safe_malloc_internal(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @die_mem(i8* %1, i32 %2)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @memset(i8* %4, i32 0, i64 %0)
%10 = tail call i32 @add_entry(i8* %1, i32 %2, i8* %4, i64 %0)
ret i8* %4
}
const char *esd_audio_devices() { return "speaker, lineout, headphone"; }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"speaker, lineout, headphone\00"
define i8* @esd_audio_devices() {
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [28 x i8] c"speaker, lineout, headphone\00"
define i8* @esd_audio_devices() {
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ filename(char *);
int main() {
  filename("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/google/llvm-propeller/refs/heads/"
           "bb-clusters/clang/test/CoverageMapping/builtinmacro.c"
           "test.c");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [183 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/google/llvm-propeller/refs/heads/bb-clusters/clang/test/CoverageMapping/builtinmacro.ctest.c\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @filename(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [183 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/google/llvm-propeller/refs/heads/bb-clusters/clang/test/CoverageMapping/builtinmacro.ctest.c\00"
define i32 @main() {
%1 = tail call i32 @filename(i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int _fstat(int fd, struct stat *buf) { return 0; }


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @_fstat(i32 %0, %struct.stat* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCGETS;
int errno;
scalar_t__ ioctl(int, int /*<<< orphan*/, struct termios *);
int isatty(int fd) {
  int save;
  int is_tty;
  struct termios term;
  save = errno;
  is_tty = ioctl(fd, TCGETS, &term) == 0;
  errno = save;
  return is_tty;
}


x86 assembly (clang, -O0):
<isatty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    0x2e83(%rip),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isatty>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ebe(%rip),%rbx
mov    (%rbx),%ebp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ebp,(%rbx)
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@errno = global i32 0
@TCGETS = global i32 0
define i32 @isatty(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.termios
store i32 %0, i32* %2
%6 = load i32, i32* @errno
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @TCGETS
%9 = call i64 @ioctl(i32 %7, i32 %8, %struct.termios* %5)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
store i32 %11, i32* %4
%12 = load i32, i32* %3
store i32 %12, i32* @errno
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@errno = global i32 0
@TCGETS = global i32 0
define i32 @isatty(i32 %0) {
%2 = alloca %struct.termios
%3 = bitcast %struct.termios* %2 to i8*
%4 = load i32, i32* @errno
%5 = load i32, i32* @TCGETS
%6 = call i64 @ioctl(i32 %0, i32 %5, %struct.termios* %2)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
store i32 %4, i32* @errno
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int a, b;
  a = 077;
  b = a & 3;
  printf("\40:The a & b(decimal) is %d\n", b);
  b &= 7;
  printf("\40:The a & b(decimal) is %d\n", b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3f,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c" :The a & b(decimal) is %d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 63, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 3
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
%8 = and i32 %7, 7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c" :The a & b(decimal) is %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}
/* Variables and functions */
char *_resposta_padrao(int, int, char *);
char *ComunicarCertificadoICPBRASIL(int sessao, char *codigo_ativacao,
                                    char *certificado) {
  return _resposta_padrao(sessao, 5000, "Certificado transmitido com sucesso");
}


x86 assembly (clang, -O0):
<ComunicarCertificadoICPBRASIL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1388,%esi
lea    0xece(%rip),%rdx
call   1030 <_resposta_padrao@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComunicarCertificadoICPBRASIL>:
lea    0xee9(%rip),%rdx
mov    $0x1388,%esi
jmp    1030 <_resposta_padrao@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Certificado transmitido com sucesso\00"
define i8* @ComunicarCertificadoICPBRASIL(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = call i8* @_resposta_padrao(i32 %7, i32 5000, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}

LLVM IR (-O2):
@.str = [36 x i8] c"Certificado transmitido com sucesso\00"
define i8* @ComunicarCertificadoICPBRASIL(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i8* @_resposta_padrao(i32 %0, i32 5000, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
void GUI_Model3dDraw() {}


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

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

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

LLVM IR (-O2):
define void @GUI_Model3dDraw() {
ret void
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ this_comparison_is_false();
void bla3gt(int var) {
  if (var - 10 > INT_MAX - 10)
    this_comparison_is_false();
}


x86 assembly (clang, -O0):
<bla3gt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%ecx
sub    $0xa,%ecx
cmp    %ecx,%eax
jle    113c <bla3gt+0x2c>
mov    $0x0,%al
call   1030 <this_comparison_is_false@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bla3gt>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jge    1122 <bla3gt+0x12>
xor    %eax,%eax
jmp    1030 <this_comparison_is_false@plt>
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define void @bla3gt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 10
%5 = load i32, i32* @INT_MAX
%6 = sub nsw i32 %5, 10
%7 = icmp sgt i32 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @this_comparison_is_false()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define void @bla3gt(i32 %0) {
%2 = load i32, i32* @INT_MAX
%3 = icmp slt i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @this_comparison_is_false()
br label %6
6: ; preds = %4, %1
ret void
}
void NullLine(struct ADrawTag *ctx __attribute__((unused)),
              unsigned int x1 __attribute__((unused)),
              unsigned int y1 __attribute__((unused)),
              unsigned int x2 __attribute__((unused)),
              unsigned int y2 __attribute__((unused))) {}


x86 assembly (clang, -O0):
<NullLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ADrawTag = type opaque
define void @NullLine(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.ADrawTag*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.ADrawTag* %0, %struct.ADrawTag** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type opaque
define void @NullLine(%struct.ADrawTag* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret void
}
double cal(double a, double b, int operators) {
  if (operators == 0)
    return (a + b);
  else if (operators == 1)
    return (a - b);
  else if (operators == 2)
    return (a * b);
  else if (operators == 3)
    return (a / b);
}


x86 assembly (clang, -O0):
<cal>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    112f <cal+0x2f>
movsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1198 <cal+0x98>
cmpl   $0x1,-0x1c(%rbp)
jne    114d <cal+0x4d>
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1198 <cal+0x98>
cmpl   $0x2,-0x1c(%rbp)
jne    116b <cal+0x6b>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1198 <cal+0x98>
cmpl   $0x3,-0x1c(%rbp)
jne    1189 <cal+0x89>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1198 <cal+0x98>
jmp    118e <cal+0x8e>
jmp    1193 <cal+0x93>
jmp    1198 <cal+0x98>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cal>:
cmp    $0x3,%edi
ja     111c <cal+0x1c>
mov    %edi,%eax
lea    0xef2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
addsd  %xmm1,%xmm0
ret
ret
subsd  %xmm1,%xmm0
ret
mulsd  %xmm1,%xmm0
ret
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cal(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store double %0, double* %5
store double %1, double* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load double, double* %5
%12 = load double, double* %6
%13 = fadd double %11, %12
store double %13, double* %4
br label %38
14: ; preds = %3
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load double, double* %5
%19 = load double, double* %6
%20 = fsub double %18, %19
store double %20, double* %4
br label %38
21: ; preds = %14
%22 = load i32, i32* %7
%23 = icmp eq i32 %22, 2
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load double, double* %5
%26 = load double, double* %6
%27 = fmul double %25, %26
store double %27, double* %4
br label %38
28: ; preds = %21
%29 = load i32, i32* %7
%30 = icmp eq i32 %29, 3
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = load double, double* %5
%33 = load double, double* %6
%34 = fdiv double %32, %33
store double %34, double* %4
br label %38
35: ; preds = %28
br label %36
36: ; preds = %35
br label %37
37: ; preds = %36
br label %38
38: ; preds = %10, %17, %24, %31, %37
%39 = load double, double* %4
ret double %39
}

LLVM IR (-O2):
define double @cal(double %0, double %1, i32 %2) {
switch i32 %2, label %12 [
i32 0, label %4
i32 1, label %6
i32 2, label %8
i32 3, label %10
]
4: ; preds = %3
%5 = fadd double %0, %1
br label %12
6: ; preds = %3
%7 = fsub double %0, %1
br label %12
8: ; preds = %3
%9 = fmul double %0, %1
br label %12
10: ; preds = %3
%11 = fdiv double %0, %1
br label %12
12: ; preds = %3, %4, %6, %8, %10
%13 = phi double [ %5, %4 ], [ %7, %6 ], [ %9, %8 ], [ %11, %10 ], [ undef, %3 ]
ret double %13
}
/* Type definitions */
struct timeb {
  scalar_t__ millitm;
  scalar_t__ time;
};

/* Variables and functions */
int /*<<< orphan*/ ftime(struct timeb *);
double timestamp_mili() {
  struct timeb tmb;
  ftime(&tmb);
  return ((double)tmb.time) + ((double)tmb.millitm) / 1000.0;
}


x86 assembly (clang, -O0):
<timestamp_mili>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <ftime@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xecb(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestamp_mili>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <ftime@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xecc(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeb = type { i64, i64 }
define double @timestamp_mili() {
%1 = alloca %struct.timeb
%2 = call i32 @ftime(%struct.timeb* %1)
%3 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+03
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeb = type { i64, i64 }
define double @timestamp_mili() {
%1 = alloca %struct.timeb
%2 = bitcast %struct.timeb* %1 to i8*
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+03
%11 = fadd double %10, %6
ret double %11
}
/* Type definitions */
struct jx_database {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ log_message(struct jx_database *, char *, char const *);
void log_delete(struct jx_database *db, const char *key) {
  log_message(db, "D %s\n", key);
}


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

x86 assembly (clang, -O2):
<log_delete>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <log_message@plt>

LLVM IR (-O0):
%struct.jx_database = type { i32 }
@.str = [6 x i8] c"D %s\0A\00"
define void @log_delete(%struct.jx_database* %0, i8* %1) {
%3 = alloca %struct.jx_database*
%4 = alloca i8*
store %struct.jx_database* %0, %struct.jx_database** %3
store i8* %1, i8** %4
%5 = load %struct.jx_database*, %struct.jx_database** %3
%6 = load i8*, i8** %4
%7 = call i32 @log_message(%struct.jx_database* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
%struct.jx_database = type { i32 }
@.str = [6 x i8] c"D %s\0A\00"
define void @log_delete(%struct.jx_database* %0, i8* %1) {
%3 = tail call i32 @log_message(%struct.jx_database* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
scalar_t__ takes_charptr(char *);
int test2() {
  int size;
  if (takes_charptr((char *)&size))
    return -1;
  return size;
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <takes_charptr@plt>
cmp    $0x0,%rax
je     1137 <test2+0x27>
movl   $0xffffffff,-0x4(%rbp)
jmp    113d <test2+0x2d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <takes_charptr@plt>
neg    %rax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @takes_charptr(i8* %2)
%4 = icmp eq i64 %3, 0
%5 = load i32, i32* %1
%6 = select i1 %4, i32 %5, i32 -1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ IFF_UP;
int ifc_set_flags(char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int ifc_down(const char *name) {
  int ret = ifc_set_flags(name, 0, IFF_UP);
  return ret;
}


x86 assembly (clang, -O0):
<ifc_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <ifc_set_flags@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifc_down>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <ifc_set_flags@plt>

LLVM IR (-O0):
@IFF_UP = global i32 0
define i32 @ifc_down(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @IFF_UP
%6 = call i32 @ifc_set_flags(i8* %4, i32 0, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@IFF_UP = global i32 0
define i32 @ifc_down(i8* %0) {
%2 = load i32, i32* @IFF_UP
%3 = tail call i32 @ifc_set_flags(i8* %0, i32 0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ debug_free(void *);
int /*<<< orphan*/ free(void *);
void do_free(void *ptr) {
  debug_free(ptr);
  free(ptr);
}


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

x86 assembly (clang, -O2):
<do_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <debug_free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @do_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @debug_free(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @do_free(i8* %0) {
%2 = tail call i32 @debug_free(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
void f(int a[9]) {}


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

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

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

LLVM IR (-O2):
define void @f(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tcc_error(char *, char const *);
void expect(const char *msg) { tcc_error("%s expected", msg); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"%s expected\00"
define void @expect(i8* %0) {
%2 = tail call i32 @tcc_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void i8042_write_data(int val) {
  outb(val, 0x60);
  return;
}


x86 assembly (clang, -O0):
<i8042_write_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x60,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i8042_write_data>:
mov    $0x60,%esi
jmp    1030 <outb@plt>

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

LLVM IR (-O2):
define void @i8042_write_data(i32 %0) {
%2 = tail call i32 @outb(i32 %0, i32 96)
ret void
}
void chomp(char *string) {
  char *s = string;
  while (*s) {
    if (*s == '\r' || *s == '\n') {
      *s = '\0';
      return;
    }
    s++;
  }
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <chomp+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     113d <chomp+0x3d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1149 <chomp+0x49>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    115a <chomp+0x5a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <chomp+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
movzbl (%rdi),%eax
test   %al,%al
je     1118 <chomp+0x18>
cmp    $0xd,%al
je     1115 <chomp+0x15>
cmp    $0xa,%al
je     1115 <chomp+0x15>
add    $0x1,%rdi
jmp    1100 <chomp>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @chomp(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 13, label %5
i8 10, label %5
]
5: ; preds = %2, %2
store i8 0, i8* %3
br label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2, %5
ret void
}
void SK_NV(void) {}


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

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

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

LLVM IR (-O2):
define void @SK_NV() {
ret void
}
/* Variables and functions */
int Headers();
int video_sequence(int *);
int Decode_Bitstream() {
  int ret;
  int Bitstream_Framenum;
  Bitstream_Framenum = 0;
  for (;;) {
    ret = Headers();
    if (ret == 1) {
      ret = video_sequence(&Bitstream_Framenum);
    } else
      return (ret);
  }
}


x86 assembly (clang, -O0):
<Decode_Bitstream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <Headers@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1154 <Decode_Bitstream+0x34>
lea    -0x8(%rbp),%rdi
call   1030 <video_sequence@plt>
mov    %eax,-0x4(%rbp)
jmp    115d <Decode_Bitstream+0x3d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    112f <Decode_Bitstream+0xf>

x86 assembly (clang, -O2):
<Decode_Bitstream>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
xor    %eax,%eax
call   1040 <Headers@plt>
cmp    $0x1,%eax
jne    1154 <Decode_Bitstream+0x34>
lea    0xc(%rsp),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <video_sequence@plt>
xor    %eax,%eax
call   1040 <Headers@plt>
cmp    $0x1,%eax
je     1140 <Decode_Bitstream+0x20>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @Decode_Bitstream() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 (...) @Headers()
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %9
5: ; preds = %0, %5
%6 = call i32 @video_sequence(i32* %1)
%7 = call i32 (...) @Headers()
%8 = icmp eq i32 %7, 1
br i1 %8, label %5, label %9
9: ; preds = %5, %0
%10 = phi i32 [ %3, %0 ], [ %7, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ g();
int main() {
  f(1);
  f(2);
  g();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <f@plt>
mov    $0x2,%edi
call   1030 <f@plt>
mov    $0x0,%al
call   1040 <g@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <f@plt>
mov    $0x2,%edi
call   1030 <f@plt>
xor    %eax,%eax
call   1040 <g@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 1)
%2 = call i32 @f(i32 2)
%3 = call i32 (...) @g()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
%2 = tail call i32 @f(i32 2)
%3 = tail call i32 (...) @g()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ leftShift(int, int);
int /*<<< orphan*/ rightShift(int /*<<< orphan*/, int);
int signExtend(int /*<<< orphan*/);
int decodeExceptionParameter(int status) {
  return signExtend(rightShift(leftShift(status, 16), 16));
}


x86 assembly (clang, -O0):
<decodeExceptionParameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x10,%esi
call   1050 <leftShift@plt>
mov    %eax,%edi
mov    $0x10,%esi
call   1040 <rightShift@plt>
mov    %eax,%edi
call   1030 <signExtend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decodeExceptionParameter>:
push   %rax
mov    $0x10,%esi
call   1050 <leftShift@plt>
mov    %eax,%edi
mov    $0x10,%esi
call   1040 <rightShift@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <signExtend@plt>

LLVM IR (-O0):
define i32 @decodeExceptionParameter(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @leftShift(i32 %3, i32 16)
%5 = call i32 @rightShift(i32 %4, i32 16)
%6 = call i32 @signExtend(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @decodeExceptionParameter(i32 %0) {
%2 = tail call i32 @leftShift(i32 %0, i32 16)
%3 = tail call i32 @rightShift(i32 %2, i32 16)
%4 = tail call i32 @signExtend(i32 %3)
ret i32 %4
}
void g_string_prepend_unichar() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @dsp_mem_ipi_init() {
ret void
}
/* Variables and functions */
int longjmp(void *);
int siglongjmp(void *a, int x) { return longjmp(a); }


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

x86 assembly (clang, -O2):
<siglongjmp>:
jmp    1030 <longjmp@plt>

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

LLVM IR (-O2):
define i32 @siglongjmp(i8* %0, i32 %1) {
%3 = tail call i32 @longjmp(i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_hello(void) { printf("Hello, library !\n"); }


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"Hello, library !\00"
define void @print_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_trace(int, int, int);
int /*<<< orphan*/ printf(char *, int);
void test(int a, int b) {
  printf("a+b=%d\n", a + b);
  print_trace(0x11, 0x22, 0x33);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x11,%edi
mov    $0x22,%esi
mov    $0x33,%edx
call   1040 <print_trace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
add    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x11,%edi
mov    $0x22,%esi
mov    $0x33,%edx
pop    %rax
jmp    1040 <print_trace@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"a+b=%d\0A\00"
define void @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @print_trace(i32 17, i32 34, i32 51)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"a+b=%d\0A\00"
define void @test(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @print_trace(i32 17, i32 34, i32 51)
ret void
}
unsigned xfs_sb_version_toold(unsigned v) {
  if (v & (0x0040 | 0x0080))
    return 0;
  if (v & 0x0020)
    return 3;
  if (v & 0x0010)
    return 2;
  return 1;
}


x86 assembly (clang, -O0):
<xfs_sb_version_toold>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xc0,%eax
cmp    $0x0,%eax
je     1124 <xfs_sb_version_toold+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1161 <xfs_sb_version_toold+0x61>
mov    -0x8(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     113f <xfs_sb_version_toold+0x3f>
movl   $0x3,-0x4(%rbp)
jmp    1161 <xfs_sb_version_toold+0x61>
mov    -0x8(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     115a <xfs_sb_version_toold+0x5a>
movl   $0x2,-0x4(%rbp)
jmp    1161 <xfs_sb_version_toold+0x61>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfs_sb_version_toold>:
xor    %eax,%eax
test   $0xc0,%dil
je     1109 <xfs_sb_version_toold+0x9>
ret
mov    $0x3,%eax
test   $0x20,%dil
jne    1108 <xfs_sb_version_toold+0x8>
and    $0x10,%edi
cmp    $0x1,%edi
mov    $0x2,%eax
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @xfs_sb_version_toold(i32 %0) {
%2 = and i32 %0, 192
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = and i32 %0, 32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = and i32 %0, 16
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 2
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %1 ], [ 3, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
gen_swap_stack() { output_line("xthl"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"xthl\00"
define i32 @gen_swap_stack() {
%1 = alloca i32
%2 = call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [5 x i8] c"xthl\00"
define i32 @gen_swap_stack() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void compat_setup_restart_syscall(struct pt_regs *regs) {}


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

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

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

LLVM IR (-O2):
%struct.pt_regs = type opaque
define void @compat_setup_restart_syscall(%struct.pt_regs* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void setjmp() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @setjmp() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
int benchmarkIterationsCount() { return 16; }


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

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

LLVM IR (-O0):
define i32 @benchmarkIterationsCount() {
ret i32 16
}

LLVM IR (-O2):
define i32 @benchmarkIterationsCount() {
ret i32 16
}