xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *realloc(void *, size_t);
void *safe_realloc(void *ptr, size_t size) {
  void *ret = realloc(ptr, size);
  if (ret == NULL)
    fatal("safe_realloc: Out of memory");
  return ret;
}


x86 assembly (clang, -O0):
<safe_realloc>:
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 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <safe_realloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_realloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <safe_realloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"safe_realloc: Out of memory\00"
define i8* @safe_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %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 %13
11: ; preds = %2
%12 = call i32 @fatal(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [28 x i8] c"safe_realloc: Out of memory\00"
define noalias i8* @safe_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void inputData(int *nd, int *y) {
  printf("Enter the day: ");
  scanf("%d", nd);
  printf("Enter the year: ");
  scanf("%d", y);
  return;
}


x86 assembly (clang, -O0):
<inputData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputData>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Enter the day: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"Enter the year: \00"
define void @inputData(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %3
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter the day: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"Enter the year: \00"
define void @inputData(i32* %0, i32* %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret void
}
int func2(void) {
  int x;
  int *p;
  int **pp;
  x = 1;
  p = &x;
  pp = &p;
  if (p != 0)
    **pp = 0;
  p = 0;
  return x;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1133 <func2+0x33>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movl   $0x0,(%rax)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @func2() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
long strtol(char *, int /*<<< orphan*/ *, int);
long Buf_toLong(const char *x) {
  int len = sizeof(long) + 1;
  char buf[len];
  memcpy(buf, x, sizeof(long));
  buf[len - 1] = '\0';
  return strtol(buf, NULL, 10);
}


x86 assembly (clang, -O0):
<Buf_toLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x9,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cltq
movb   $0x0,(%rdi,%rax,1)
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Buf_toLong>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
movb   $0x0,0x8(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @Buf_toLong(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %2
store i32 9, i32* %3
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %4
%9 = alloca i8, i64 %7
store i64 %7, i64* %5
%10 = load i8*, i8** %2
%11 = call i32 @memcpy(i8* %9, i8* %10, i32 8)
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %9, i64 %14
store i8 0, i8* %15
%16 = call i64 @strtol(i8* %9, i32* null, i32 10)
%17 = load i8*, i8** %4
ret i64 %16
}

LLVM IR (-O2):
define i64 @Buf_toLong(i8* %0) {
%2 = alloca [9 x i8]
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%4 = call i32 @memcpy(i8* %3, i8* %0, i32 8)
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 8
store i8 0, i8* %5
%6 = call i64 @strtol(i8* nocapture %3, i32* null, i32 10)
ret i64 %6
}
/* Variables and functions */
void *mem_allocate(size_t);
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void *_managed_reallocate(void *memory, size_t old_size, size_t new_size) {
  void *new_memory = mem_allocate(new_size);
  memcpy(new_memory, memory, old_size);
  return new_memory;
}


x86 assembly (clang, -O0):
<_managed_reallocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <mem_allocate@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_managed_reallocate>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <mem_allocate@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @_managed_reallocate(i8* %0, i64 %1, i64 %2) {
%4 = tail call i8* @mem_allocate(i64 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ gtk_init(int *, char ***);
int /*<<< orphan*/ x3initqs();
void x3init(int *pargc, char ***pargv) {
  gtk_init(pargc, pargv);
  x3initqs();
}


x86 assembly (clang, -O0):
<x3init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gtk_init@plt>
mov    $0x0,%al
call   1040 <x3initqs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x3init>:
push   %rax
call   1030 <gtk_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <x3initqs@plt>

LLVM IR (-O0):
define void @x3init(i32* %0, i8*** %1) {
%3 = alloca i32*
%4 = alloca i8***
store i32* %0, i32** %3
store i8*** %1, i8**** %4
%5 = load i32*, i32** %3
%6 = load i8***, i8**** %4
%7 = call i32 @gtk_init(i32* %5, i8*** %6)
%8 = call i32 (...) @x3initqs()
ret void
}

LLVM IR (-O2):
define void @x3init(i32* %0, i8*** %1) {
%3 = tail call i32 @gtk_init(i32* %0, i8*** %1)
%4 = tail call i32 (...) @x3initqs()
ret void
}
/* Type definitions */
struct sembuf {
  int sem_op;
  scalar_t__ sem_flg;
  scalar_t__ sem_num;
};

/* Variables and functions */
int semop(int, struct sembuf *, int);
int up(int id) {
  struct sembuf op;
  op.sem_num = 0;
  op.sem_op = 1;
  op.sem_flg = 0;
  return semop(id, &op, 1);
}


x86 assembly (clang, -O0):
<up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<up>:
sub    $0x18,%rsp
movl   $0x1,(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i64, i64 }
define i32 @up(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sembuf
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 2
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 0
store i32 1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i32 0, i32 1
store i64 0, i64* %6
%7 = load i32, i32* %2
%8 = call i32 @semop(i32 %7, %struct.sembuf* %3, i32 1)
ret i32 %8
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i64, i64 }
define i32 @up(i32 %0) {
%2 = alloca %struct.sembuf
%3 = bitcast %struct.sembuf* %2 to i8*
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 0
store i32 1, i32* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 1
%6 = bitcast i64* %5 to <2 x i64>*
store <2 x i64> zeroinitializer, <2 x i64>* %6
%7 = call i32 @semop(i32 %0, %struct.sembuf* %2, i32 1)
ret i32 %7
}
void av_imdct_calc() {}


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

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

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

LLVM IR (-O2):
define void @av_imdct_calc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void emit_pusha() {
  assem_debug("pusha\n");
  assert(0);
}


x86 assembly (clang, -O0):
<emit_pusha>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <assem_debug@plt>
xor    %edi,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_pusha>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <assem_debug@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <assert@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"pusha\0A\00"
define void @emit_pusha() {
%1 = tail call i32 @assem_debug(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 0)
ret void
}
void ff_hevc_put_hevc_qpel_h32_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h32_10_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int system(char *);
void check_llstat() {
  int status;
  status = system("which llstat.pl &> /dev/null");
  if (status) {
    fprintf(stderr, "Error: llstat.pl not found in PATH\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_llstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1170 <check_llstat+0x40>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_llstat>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <system@plt>
test   %eax,%eax
jne    1143 <check_llstat+0x13>
pop    %rax
ret
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"which llstat.pl &> /dev/null\00"
@stderr = global i32 0
@.str.1 = [36 x i8] c"Error: llstat.pl not found in PATH\0A\00"
define void @check_llstat() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"which llstat.pl &> /dev/null\00"
@stderr = global i32 0
@.str.1 = [36 x i8] c"Error: llstat.pl not found in PATH\0A\00"
define void @check_llstat() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %0
ret void
}
void print_help_46(void) {}


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

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

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

LLVM IR (-O2):
define void @print_help_46() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int write(int, char *, int /*<<< orphan*/);
int inet_write(int sock, char *str) { return write(sock, str, strlen(str)); }


x86 assembly (clang, -O0):
<inet_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @inet_write(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @inet_write(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ hs_exit();
void dexFini() { hs_exit(); }


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

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

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

LLVM IR (-O2):
define void @dexFini() {
%1 = tail call i32 (...) @hs_exit()
ret void
}
/* Variables and functions */
scalar_t__ test1();
scalar_t__ test2();
int main() {
  if (test1() < 0)
    return 1;
  if (test2() < 0)
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test1@plt>
cmp    $0x0,%rax
jge    114c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1170 <main+0x50>
mov    $0x0,%al
call   1040 <test2@plt>
cmp    $0x0,%rax
jge    1169 <main+0x49>
movl   $0x2,-0x4(%rbp)
jmp    1170 <main+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test1@plt>
test   %rax,%rax
js     113d <main+0x1d>
xor    %eax,%eax
call   1040 <test2@plt>
shr    $0x3e,%rax
and    $0xfffffffe,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @test1()
%2 = icmp slt i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i64 (...) @test2()
%5 = lshr i64 %4, 62
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 2
br label %8
8: ; preds = %3, %0
%9 = phi i32 [ 1, %0 ], [ %7, %3 ]
ret i32 %9
}
/* Variables and functions */
void *memcpy_aligned(void *, void const *, size_t);
void *memmove_aligned(void *dest, const void *src, size_t n) {
  return memcpy_aligned(dest, src, n);
}


x86 assembly (clang, -O0):
<memmove_aligned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy_aligned@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmove_aligned>:
jmp    1030 <memcpy_aligned@plt>

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

LLVM IR (-O2):
define i8* @memmove_aligned(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @memcpy_aligned(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
_Bool Double__EQ_(double x, double y) { return x == y; }


x86 assembly (clang, -O0):
<Double__EQ_>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Double__EQ_>:
cmpeqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define zeroext i1 @Double__EQ_(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oeq double %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @Double__EQ_(double %0, double %1) {
%3 = fcmp oeq double %0, %1
ret i1 %3
}
void PMC_IRQHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<PMC_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <PMC_IRQHandler+0x9>
jmp    1109 <PMC_IRQHandler+0x9>

x86 assembly (clang, -O2):
<PMC_IRQHandler>:
jmp    1100 <PMC_IRQHandler>

LLVM IR (-O0):
define void @PMC_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @PMC_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
float drand48();
float *fvec_new(long);
float *fvec_new_rand(long n) {
  float *f = fvec_new(n);
  long i;
  for (i = 0; i < n; i++) {
    f[i] = drand48();
  }
  return f;
}


x86 assembly (clang, -O0):
<fvec_new_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fvec_new@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1174 <fvec_new_rand+0x54>
mov    $0x0,%al
call   1040 <drand48@plt>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1141 <fvec_new_rand+0x21>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fvec_new_rand>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <fvec_new@plt>
mov    %rax,%r15
test   %r14,%r14
jle    1156 <fvec_new_rand+0x36>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <drand48@plt>
movss  %xmm0,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <fvec_new_rand+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define float* @fvec_new_rand(i64 %0) {
%2 = tail call float* @fvec_new(i64 %0)
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = tail call float (...) @drand48()
%7 = getelementptr inbounds float, float* %2, i64 %5
store float %6, float* %7
%8 = add nuw nsw i64 %5, 1
%9 = icmp eq i64 %8, %0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret float* %2
}
/* Variables and functions */
int /*<<< orphan*/ in(int);
int /*<<< orphan*/ out(int, int /*<<< orphan*/);
int partvariavel(int ghost_number) {
  do {
    out(11, 0);
    in(ghost_number);
  } while (ghost_number > 4 || ghost_number < 1);
  return ghost_number;
}


x86 assembly (clang, -O0):
<partvariavel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xb,%edi
xor    %esi,%esi
call   1030 <out@plt>
mov    -0x4(%rbp),%edi
call   1040 <in@plt>
mov    $0x1,%al
cmpl   $0x4,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     1158 <partvariavel+0x38>
cmpl   $0x1,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    112b <partvariavel+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<partvariavel>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    -0x5(%rbx),%ebp
nopl   0x0(%rax,%rax,1)
mov    $0xb,%edi
xor    %esi,%esi
call   1030 <out@plt>
mov    %ebx,%edi
call   1040 <in@plt>
cmp    $0xfffffffc,%ebp
jb     1130 <partvariavel+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @partvariavel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %13, %1
%4 = call i32 @out(i32 11, i32 0)
%5 = load i32, i32* %2
%6 = call i32 @in(i32 %5)
br label %7
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 4
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 1
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ true, %7 ], [ %12, %10 ]
br i1 %14, label %3, label %15
15: ; preds = %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @partvariavel(i32 returned %0) {
%2 = add i32 %0, -5
%3 = icmp ult i32 %2, -4
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @out(i32 11, i32 0)
%6 = tail call i32 @in(i32 %0)
br i1 %3, label %4, label %7
7: ; preds = %4
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ ascending();
int main() {
  ascending();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <ascending@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @ascending()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ascending()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ func(int /*<<< orphan*/);
int main(int argc, const char *argv[]) { func(0); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <func@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @func(i32 0)
ret i32 0
}
void div_m32abs(unsigned int *m32) {
  if ((long)m32 & 0xFFFFFFFF80000000LL) {
    printf("Error: destination %lx not in lower 2GB for div_m32abs()\n",
           (long)m32);
    asm(" int $3; ");
  }
  put8(0xF7);
  put8(0x34);
  put8(0x25);
  put32((int)(unsigned long)m32);
}


x86 assembly (clang, -O0):
<div_m32abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffffffff80000000,%rax
cmp    $0x0,%rax
je     1163 <div_m32abs+0x33>
mov    -0x8(%rbp),%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
int3
mov    $0xf7,%edi
mov    $0x0,%al
call   1030 <put8@plt>
mov    $0x34,%edi
mov    $0x0,%al
call   1030 <put8@plt>
mov    $0x25,%edi
mov    $0x0,%al
call   1030 <put8@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    $0x0,%al
call   1050 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_m32abs>:
push   %rbx
mov    %rdi,%rbx
test   $0xffffffff80000000,%rdi
je     114f <div_m32abs+0x1f>
lea    0xebc(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
int3
mov    $0xf7,%edi
xor    %eax,%eax
call   1030 <put8@plt>
mov    $0x34,%edi
xor    %eax,%eax
call   1030 <put8@plt>
mov    $0x25,%edi
xor    %eax,%eax
call   1030 <put8@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1050 <put32@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"Error: destination %lx not in lower 2GB for div_m32abs()\0A\00"
define void @div_m32abs(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = and i64 %4, -2147483648
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = ptrtoint i32* %8 to i64
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %7, %1
%12 = call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 247)
%13 = call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 52)
%14 = call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 37)
%15 = load i32*, i32** %2
%16 = ptrtoint i32* %15 to i64
%17 = trunc i64 %16 to i32
%18 = call i32 (i32, ...) bitcast (i32 (...)* @put32 to i32 (i32, ...)*)(i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"Error: destination %lx not in lower 2GB for div_m32abs()\0A\00"
define void @div_m32abs(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = icmp ult i32* %0, inttoptr (i64 2147483648 to i32*)
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i64 %2)
tail call void asm sideeffect " int $$3; ", "~{dirflag},~{fpsr},~{flags}"()
br label %6
6: ; preds = %4, %1
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 247)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 52)
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @put8 to i32 (i32, ...)*)(i32 37)
%10 = trunc i64 %2 to i32
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @put32 to i32 (i32, ...)*)(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ distance1(char *, char *, int, int);
int strlen(char *);
void main() {
  char str1[] = "aabbcc";
  int len = strlen(str1);
  char str2[len];
  distance1(str1, str2, len, 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x636362,-0x5(%rbp)
movl   $0x62626161,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x20(%rbp)
lea    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x3,%ecx
call   1040 <distance1@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x636362,-0x15(%rbp)
movl   $0x62626161,-0x18(%rbp)
lea    -0x18(%rbp),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rsp,%rbx
mov    %eax,%ecx
mov    %rsp,%rsi
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %r14,%rdi
mov    %eax,%edx
mov    $0x3,%ecx
call   1040 <distance1@plt>
mov    %rbx,%rsp
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.str1 = [7 x i8] c"aabbcc\00"
define void @main() {
%1 = alloca [7 x i8]
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = bitcast [7 x i8]* %1 to i8*
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %3
%11 = alloca i8, i64 %9
store i64 %9, i64* %4
%12 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%13 = load i32, i32* %2
%14 = call i32 @distance1(i8* %12, i8* %11, i32 %13, i32 3)
%15 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@__const.main.str1 = [7 x i8] c"aabbcc\00"
define void @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = zext i32 %3 to i64
%5 = call i8* @llvm.stacksave()
%6 = alloca i8, i64 %4
%7 = call i32 @distance1(i8* %2, i8* %6, i32 %3, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sendto(unsigned short, unsigned short *, int, int,
                          int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  unsigned short i = 0;
  for (i = 0; i < 0xffff; i++) {
    sendto(i, &i, sizeof(unsigned short), 0x20000, 0, 0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movw   $0x0,-0x12(%rbp)
movw   $0x0,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
cmp    $0xffff,%eax
jge    116f <main+0x5f>
lea    -0x12(%rbp),%rsi
mov    $0x2,%edx
mov    $0x20000,%ecx
xor    %r9d,%r9d
movzwl -0x12(%rbp),%edi
mov    %r9d,%r8d
call   1030 <sendto@plt>
mov    -0x12(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x12(%rbp)
jmp    1132 <main+0x22>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x0,0xe(%rsp)
xor    %eax,%eax
lea    0xe(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzwl %ax,%edi
mov    %rbx,%rsi
mov    $0x2,%edx
mov    $0x20000,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <sendto@plt>
movzwl 0xe(%rsp),%eax
add    $0x1,%eax
mov    %ax,0xe(%rsp)
cmp    $0xffff,%ax
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i16 0, i16* %6
store i16 0, i16* %6
br label %7
7: ; preds = %14, %2
%8 = load i16, i16* %6
%9 = zext i16 %8 to i32
%10 = icmp slt i32 %9, 65535
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i16, i16* %6
%13 = call i32 @sendto(i16 zeroext %12, i16* %6, i32 2, i32 131072, i32 0, i32 0)
br label %14
14: ; preds = %11
%15 = load i16, i16* %6
%16 = add i16 %15, 1
store i16 %16, i16* %6
br label %7
17: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i16
%4 = bitcast i16* %3 to i8*
store i16 0, i16* %3
br label %5
5: ; preds = %2, %5
%6 = phi i16 [ 0, %2 ], [ %9, %5 ]
%7 = call i32 @sendto(i16 zeroext %6, i16* %3, i32 2, i32 131072, i32 0, i32 0)
%8 = load i16, i16* %3
%9 = add i16 %8, 1
store i16 %9, i16* %3
%10 = icmp eq i16 %9, -1
br i1 %10, label %11, label %5
11: ; preds = %5
ret i32 0
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ f(int);
int main(void) {
  int i, sum = 0;
  struct timespec req;
  req.tv_sec = 0;
  req.tv_nsec = 100 * 1000 * 1000;
  for (i = 0; i < 1000 * 1000 * 10; i++) {
    sum += f(i & 0xff);
  }
  return (sum == 0xdeadbeef ? 1 : 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x5f5e100,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x989680,-0x8(%rbp)
jge    1172 <main+0x62>
mov    -0x8(%rbp),%edi
and    $0xff,%edi
call   1030 <f@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113c <main+0x2c>
mov    -0xc(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0xdeadbeef,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movzbl %bpl,%edi
call   1030 <f@plt>
add    %eax,%ebx
add    $0x1,%ebp
cmp    $0x989680,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
cmp    $0xdeadbeef,%ebx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.timespec
store i32 0, i32* %1
store i32 0, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 1
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
store i32 100000000, i32* %6
store i32 0, i32* %2
br label %7
7: ; preds = %18, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 10000000
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i32, i32* %2
%12 = and i32 %11, 255
%13 = call i64 @f(i32 %12)
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %3
br label %18
18: ; preds = %10
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %7
21: ; preds = %7
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, -559038737
%24 = zext i1 %23 to i64
%25 = select i1 %23, i32 1, i32 0
ret i32 %25
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %8, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = and i32 %2, 255
%5 = tail call i64 @f(i32 %4)
%6 = trunc i64 %5 to i32
%7 = add i32 %3, %6
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 10000000
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = icmp eq i32 %7, -559038737
%12 = zext i1 %11 to i32
ret i32 %12
}
int ft_strchri(const char *str, char c) {
  int i;
  i = 0;
  while (*str) {
    if (*str == c)
      return (i);
    str++;
    i++;
  }
  return (-1);
}


x86 assembly (clang, -O0):
<ft_strchri>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <ft_strchri+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1140 <ft_strchri+0x40>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <ft_strchri+0x61>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <ft_strchri+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strchri>:
mov    (%rdi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <ft_strchri+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %sil,%dl
je     1123 <ft_strchri+0x23>
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <ft_strchri+0x10>
ret
mov    %ecx,%eax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int Lia_ExamSizeof() {
  int *p;
  int str[10];
  char *pstr = "Bocom";
  struct {
    char a;
    int b[5];
  } stx[2];
  printf("sizeof p:%d\n", sizeof(p));
  printf("sizeof str:%d\n", sizeof(str));
  printf("sizeof str:%d\n", sizeof(pstr));
  printf("sizeof stx1:%d\n", sizeof(stx));
  return 0;
}


x86 assembly (clang, -O0):
<Lia_ExamSizeof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xedc(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x30,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lia_ExamSizeof>:
push   %rbx
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xee4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x28,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x30,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.anon = type { i8, [5 x i32] }
@.str = [6 x i8] c"Bocom\00"
@.str.1 = [13 x i8] c"sizeof p:%d\0A\00"
@.str.2 = [15 x i8] c"sizeof str:%d\0A\00"
@.str.3 = [16 x i8] c"sizeof stx1:%d\0A\00"
define i32 @Lia_ExamSizeof() {
%1 = alloca i32*
%2 = alloca [10 x i32]
%3 = alloca i8*
%4 = alloca [2 x %struct.anon]
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 8)
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 40)
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 8)
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 48)
ret i32 0
}

LLVM IR (-O2):
%struct.anon = type { i8, [5 x i32] }
@.str.1 = [13 x i8] c"sizeof p:%d\0A\00"
@.str.2 = [15 x i8] c"sizeof str:%d\0A\00"
@.str.3 = [16 x i8] c"sizeof stx1:%d\0A\00"
define i32 @Lia_ExamSizeof() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 40)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 48)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ preload_seq(int);
void main(void) { preload_seq(173); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0xad,%edi
jmp    1030 <preload_seq@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @preload_seq(i32 173)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @preload_seq(i32 173)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char const *);
void receive_user(void *room_data, void *user_data, const char *message) {
  printf("%s: %s", (char *)user_data, message);
}


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"%s: %s\00"
define void @receive_user(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %s\00"
define void @receive_user(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
__attribute__((section(".after_vectors"))) void M0_NMI_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<M0_NMI_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <M0_NMI_Handler+0x9>
jmp    1109 <M0_NMI_Handler+0x9>

x86 assembly (clang, -O2):
<M0_NMI_Handler>:
jmp    1100 <M0_NMI_Handler>

LLVM IR (-O0):
define void @M0_NMI_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @M0_NMI_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  for (scanf("%d", &n); n > 0; n--)
    printf("홍길동\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    1163 <main+0x43>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <main+0x1f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1168 <main+0x48>
lea    0xebf(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x1,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [10 x i8] c"\ED\99\8D\EA\B8\B8\EB\8F\99\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %0, %6
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%8 = load i32, i32* %1
%9 = add nsw i32 %8, -1
store i32 %9, i32* %1
%10 = icmp sgt i32 %8, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %0
ret i32 0
}
int empty_lex(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @empty_lex() {
ret i32 -1
}