xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
void SetTimeval(struct timeval *tv, long usec) {
  tv->tv_sec = usec / 1000000;
  tv->tv_usec = usec % 1000000;
}


x86 assembly (clang, -O0):
<SetTimeval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    $0xf4240,%ecx
cqto
idiv   %rcx
mov    -0x8(%rbp),%rax
mov    %rdx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetTimeval>:
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rsi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x12,%rdx
add    %rax,%rdx
mov    %rdx,(%rdi)
imul   $0xf4240,%rdx,%rax
sub    %rax,%rsi
mov    %rsi,0x8(%rdi)
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @SetTimeval(%struct.timeval* %0, i64 %1) {
%3 = alloca %struct.timeval*
%4 = alloca i64
store %struct.timeval* %0, %struct.timeval** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = sdiv i64 %5, 1000000
%7 = load %struct.timeval*, %struct.timeval** %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i64 %6, i64* %8
%9 = load i64, i64* %4
%10 = srem i64 %9, 1000000
%11 = load %struct.timeval*, %struct.timeval** %3
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %11, i32 0, i32 1
store i64 %10, i64* %12
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @SetTimeval(%struct.timeval* nocapture writeonly %0, i64 %1) {
%3 = sdiv i64 %1, 1000000
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
store i64 %3, i64* %4
%5 = srem i64 %1, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
store i64 %5, i64* %6
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int read(int, char *, int);
int /*<<< orphan*/ set_recv_timeout(int);
int /*<<< orphan*/ write(int, char *, int);
void *tcp_responder(void *arg) {
  char buf[1024];
  ssize_t recv_len;
  int cxn = *((int *)arg);
  set_recv_timeout(cxn);
  if ((recv_len = read(cxn, buf, 1024)) != -1) {
    write(cxn, buf, recv_len);
  }
  close(cxn);
  return NULL;
}


x86 assembly (clang, -O0):
<tcp_responder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x418(%rbp)
mov    -0x418(%rbp),%edi
call   1030 <set_recv_timeout@plt>
mov    -0x418(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
call   1060 <read@plt>
mov    %eax,-0x414(%rbp)
cmp    $0xffffffff,%eax
je     11a4 <tcp_responder+0x64>
mov    -0x418(%rbp),%edi
lea    -0x410(%rbp),%rsi
mov    -0x414(%rbp),%edx
call   1040 <write@plt>
mov    -0x418(%rbp),%edi
call   1050 <close@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_responder>:
push   %rbx
sub    $0x400,%rsp
mov    (%rdi),%ebx
mov    %ebx,%edi
call   1030 <set_recv_timeout@plt>
mov    %rsp,%rsi
mov    %ebx,%edi
mov    $0x400,%edx
call   1060 <read@plt>
cmp    $0xffffffff,%eax
je     1171 <tcp_responder+0x31>
mov    %rsp,%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1040 <write@plt>
mov    %ebx,%edi
call   1050 <close@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @tcp_responder(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @set_recv_timeout(i32 %9)
%11 = load i32, i32* %5
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%13 = call i32 @read(i32 %11, i8* %12, i32 1024)
store i32 %13, i32* %4
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %20
15: ; preds = %1
%16 = load i32, i32* %5
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%18 = load i32, i32* %4
%19 = call i32 @write(i32 %16, i8* %17, i32 %18)
br label %20
20: ; preds = %15, %1
%21 = load i32, i32* %5
%22 = call i32 @close(i32 %21)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @tcp_responder(i8* nocapture %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @set_recv_timeout(i32 %5)
%7 = call i32 @read(i32 %5, i8* %3, i32 1024)
%8 = icmp eq i32 %7, -1
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @write(i32 %5, i8* %3, i32 %7)
br label %11
11: ; preds = %9, %1
%12 = tail call i32 @close(i32 %5)
ret i8* null
}
/* Variables and functions */
int bp_sw_codon_from_seq(char *);
int bp_sw_codon_number_func(int type, void *data, char *seq) {
  return bp_sw_codon_from_seq(seq - 2);
}


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

x86 assembly (clang, -O2):
<bp_sw_codon_number_func>:
lea    -0x2(%rdx),%rdi
jmp    1030 <bp_sw_codon_from_seq@plt>

LLVM IR (-O0):
define i32 @bp_sw_codon_number_func(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 i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i64 -2
%9 = call i32 @bp_sw_codon_from_seq(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @bp_sw_codon_number_func(i32 %0, i8* nocapture readnone %1, i8* %2) {
%4 = getelementptr inbounds i8, i8* %2, i64 -2
%5 = tail call i32 @bp_sw_codon_from_seq(i8* %4)
ret i32 %5
}
/* Variables and functions */
int f286(int *);
int f287(int *p) { return f286(p); }


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

x86 assembly (clang, -O2):
<f287>:
jmp    1030 <f286@plt>

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

LLVM IR (-O2):
define i32 @f287(i32* %0) {
%2 = tail call i32 @f286(i32* %0)
ret i32 %2
}
void eglGetConfigAttrib(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglGetConfigAttrib() {
ret void
}
int func(int i, int j) {
  while (i != 20)
    i += 2;
  j += func(2, i);
  return (i * 3 + j * 2) * j;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x14,-0x4(%rbp)
je     1136 <func+0x26>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    111e <func+0xe>
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <func@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
imul   $0x3,-0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
imul   -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
mov    %esi,%ebx
mov    $0x2,%edi
mov    $0x14,%esi
call   1030 <func@plt>
add    %ebx,%eax
lea    (%rax,%rax,1),%ecx
add    $0x3c,%ecx
imul   %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @func(i32 %0, i32 %1) {
%3 = tail call i32 @func(i32 2, i32 20)
%4 = add nsw i32 %3, %1
%5 = shl nsw i32 %4, 1
%6 = add nsw i32 %5, 60
%7 = mul nsw i32 %6, %4
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
scalar_t__ lseek(int, scalar_t__, int);
int /*<<< orphan*/ panic(char *);
off_t must_lseek(int fd, off_t offset, int whence) {
  off_t answer;
  answer = lseek(fd, offset, whence);
  if (answer < 0) {
    panic("lseek error");
  }
  return answer;
}


x86 assembly (clang, -O0):
<must_lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <lseek@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    115c <must_lseek+0x3c>
lea    0xea9(%rip),%rdi
call   1040 <panic@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"lseek error\00"
define i64 @must_lseek(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i64, i64* %5
%10 = load i32, i32* %6
%11 = call i64 @lseek(i32 %8, i64 %9, i32 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @panic(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i64, i64* %7
ret i64 %17
}

LLVM IR (-O2):
@.str = [12 x i8] c"lseek error\00"
define i64 @must_lseek(i32 %0, i64 %1, i32 %2) {
%4 = tail call i64 @lseek(i32 %0, i64 %1, i32 %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @panic(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i64 %4
}
/* Variables and functions */
int systemlib();
int unusedFunc() {
  int unused;
  return systemlib();
}


x86 assembly (clang, -O0):
<unusedFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <systemlib@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @unusedFunc() {
%1 = alloca i32
%2 = call i32 (...) @systemlib()
ret i32 %2
}

LLVM IR (-O2):
define i32 @unusedFunc() {
%1 = tail call i32 (...) @systemlib()
ret i32 %1
}
long long int llrint(double x) { return x; }


x86 assembly (clang, -O0):
<llrint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llrint>:
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @llrint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @llrint(double %0) {
%2 = fptosi double %0 to i64
ret i64 %2
}
void *threadFun1(void *arg) {
  while (1) {
    sleep(5);
    printf(" %s\n", arg);
  }
}


x86 assembly (clang, -O0):
<threadFun1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5,%edi
mov    $0x0,%al
call   1040 <sleep@plt>
mov    -0x8(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112c <threadFun1+0xc>

x86 assembly (clang, -O2):
<threadFun1>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
xchg   %ax,%ax
mov    $0x5,%edi
xor    %eax,%eax
call   1040 <sleep@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1130 <threadFun1+0x10>

LLVM IR (-O0):
@.str = [5 x i8] c" %s\0A\00"
define i8* @threadFun1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 5)
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %3
}

LLVM IR (-O2):
@.str = [5 x i8] c" %s\0A\00"
define i8* @threadFun1(i8* %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 5)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %2
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int fsizep(const char *f) {
  struct stat statb;
  if (stat(f, &statb) < 0)
    return (0);
  return (statb.st_size > 0);
}


x86 assembly (clang, -O0):
<fsizep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    113f <fsizep+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    114f <fsizep+0x3f>
cmpq   $0x0,-0x18(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsizep>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
setns  %al
cmpq   $0x0,(%rsp)
setg   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @fsizep(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %14
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i64, i64* %10
%12 = icmp sgt i64 %11, 0
%13 = zext i1 %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @fsizep(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp sgt i64 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = icmp sgt i64 %7, 0
%9 = select i1 %5, i1 %8, i1 false
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int __vsprintf__(int /*<<< orphan*/, int /*<<< orphan*/, char const *, void *);
int vprintf(const char *fmt, void *vl) { return __vsprintf__(0, 0, fmt, vl); }


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

x86 assembly (clang, -O2):
<vprintf>:
mov    %rsi,%rcx
mov    %rdi,%rdx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <__vsprintf__@plt>

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

LLVM IR (-O2):
define i32 @vprintf(i8* %0, i8* %1) {
%3 = tail call i32 @__vsprintf__(i32 0, i32 0, i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ report_error_and_exit(char *);
void *checked_malloc(size_t size) {
  void *ret = malloc(size);
  if (NULL == ret && size != 0) {
    report_error_and_exit("NULL result from malloc on non-zero input");
  }
  return ret;
}


x86 assembly (clang, -O0):
<checked_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    115c <checked_malloc+0x3c>
cmpq   $0x0,-0x8(%rbp)
je     115c <checked_malloc+0x3c>
lea    0xea9(%rip),%rdi
call   1030 <report_error_and_exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <checked_malloc+0x25>
test   %r14,%r14
jne    1145 <checked_malloc+0x25>
lea    0xec0(%rip),%rdi
call   1030 <report_error_and_exit@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [42 x i8] c"NULL result from malloc on non-zero input\00"
define i8* @checked_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* null, %6
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @report_error_and_exit(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [42 x i8] c"NULL result from malloc on non-zero input\00"
define noalias i8* @checked_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @report_error_and_exit(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %2
}
void yp_unbind(dom) const char *dom;
{}


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

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

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

LLVM IR (-O2):
define void @yp_unbind(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xf3() {
  Assert_real((isodigit(243) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              1220, ("isodigit should be 0 for 0xf3"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xf3>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf3,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4c4,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xf3>:
push   %rax
mov    $0xf3,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4c4,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xf3\00"
define void @t_isodigit_0xf3() {
%1 = call i64 @isodigit(i32 243)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1220, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xf3\00"
define void @t_isodigit_0xf3() {
%1 = tail call i64 @isodigit(i32 243)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1220, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int main() {
  int a, a1, a2, a3;
  int *p, *p1, *p2, *p3, *p4, *p5;
  int **pp;
  a = 1;
  a1 = 2;
  a2 = 3, a3 = 4;
  p = &a;
  p1 = p;
  p1 = &a1;
  p2 = &a2;
  p4 = &a3;
  pp = &p1;
  pp = &p2;
  p3 = *pp;
  *pp = p4;
  p5 = (int *)malloc(3 * sizeof(int));
  p5[2] = 5;
  free(p5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x38(%rbp),%rcx
mov    -0x48(%rbp),%rax
mov    %rcx,(%rax)
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movl   $0x5,0x8(%rax)
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
call   1040 <malloc@plt>
movl   $0x5,0x8(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32**
store i32 1, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
store i32 4, i32* %4
store i32* %1, i32** %5
%12 = load i32*, i32** %5
store i32* %12, i32** %6
store i32* %2, i32** %6
store i32* %3, i32** %7
store i32* %4, i32** %9
store i32** %6, i32*** %11
store i32** %7, i32*** %11
%13 = load i32**, i32*** %11
%14 = load i32*, i32** %13
store i32* %14, i32** %8
%15 = load i32*, i32** %9
%16 = load i32**, i32*** %11
store i32* %15, i32** %16
%17 = call i64 @malloc(i32 12)
%18 = inttoptr i64 %17 to i32*
store i32* %18, i32** %10
%19 = load i32*, i32** %10
%20 = getelementptr inbounds i32, i32* %19, i64 2
store i32 5, i32* %20
%21 = load i32*, i32** %10
%22 = call i32 @free(i32* %21)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 12)
%2 = inttoptr i64 %1 to i32*
%3 = getelementptr inbounds i32, i32* %2, i64 2
store i32 5, i32* %3
%4 = tail call i32 @free(i32* %2)
ret i32 0
}
/* Variables and functions */
unsigned long get_host_ip(char *);
int gethostname(char *, int);
unsigned long get_current_ip() {
  char hostname[256];
  int rc;
  rc = gethostname(hostname, 256);
  return rc ? 0 : get_host_ip(hostname);
}


x86 assembly (clang, -O0):
<get_current_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rdi
mov    $0x100,%esi
call   1040 <gethostname@plt>
mov    %eax,-0x104(%rbp)
cmpl   $0x0,-0x104(%rbp)
je     115d <get_current_ip+0x3d>
xor    %eax,%eax
mov    %rax,-0x110(%rbp)
jmp    1170 <get_current_ip+0x50>
lea    -0x100(%rbp),%rdi
call   1030 <get_host_ip@plt>
mov    %rax,-0x110(%rbp)
mov    -0x110(%rbp),%rax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_ip>:
sub    $0x108,%rsp
mov    %rsp,%rdi
mov    $0x100,%esi
call   1040 <gethostname@plt>
test   %eax,%eax
je     1142 <get_current_ip+0x22>
xor    %eax,%eax
add    $0x108,%rsp
ret
mov    %rsp,%rdi
call   1030 <get_host_ip@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i64 @get_current_ip() {
%1 = alloca [256 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @gethostname(i8* %3, i32 256)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
br label %11
8: ; preds = %0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%10 = call i64 @get_host_ip(i8* %9)
br label %11
11: ; preds = %8, %7
%12 = phi i64 [ 0, %7 ], [ %10, %8 ]
ret i64 %12
}

LLVM IR (-O2):
define i64 @get_current_ip() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @gethostname(i8* %2, i32 256)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i64 @get_host_ip(i8* %2)
br label %7
7: ; preds = %0, %5
%8 = phi i64 [ %6, %5 ], [ 0, %0 ]
ret i64 %8
}
/* Variables and functions */
unsigned int hash_ulong(void const *);
unsigned int hash_uchar(const void *key) { return hash_ulong(key); }


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

x86 assembly (clang, -O2):
<hash_uchar>:
jmp    1030 <hash_ulong@plt>

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

LLVM IR (-O2):
define i32 @hash_uchar(i8* %0) {
%2 = tail call i32 @hash_ulong(i8* %0)
ret i32 %2
}
int do_736() { return 736; }


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

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

LLVM IR (-O0):
define i32 @do_736() {
ret i32 736
}

LLVM IR (-O2):
define i32 @do_736() {
ret i32 736
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ *malloc(int);
int /*<<< orphan*/ sem_init(int /*<<< orphan*/ *, int /*<<< orphan*/,
                            int const);
sem_t *create_semaphore(const char *const name, const int value) {
  sem_t *p = malloc(sizeof(*p));
  if (p)
    sem_init(p, 0, value);
  return p;
}


x86 assembly (clang, -O0):
<create_semaphore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1156 <create_semaphore+0x36>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1040 <sem_init@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_semaphore>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1143 <create_semaphore+0x23>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1040 <sem_init@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32* @create_semaphore(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32* @malloc(i32 4)
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @sem_init(i32* %3, i32 0, i32 %1)
br label %7
7: ; preds = %5, %2
ret i32* %3
}
void av_vorbis_parse_frame() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ *stderr;
FILE *file___new_NativeFile_native_stderr___impl() { return stderr; }


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

x86 assembly (clang, -O2):
<file___new_NativeFile_native_stderr___impl>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@stderr = global i32* null
define i32* @file___new_NativeFile_native_stderr___impl() {
%1 = load i32*, i32** @stderr
ret i32* %1
}

LLVM IR (-O2):
@stderr = global i32* null
define i32* @file___new_NativeFile_native_stderr___impl() {
%1 = load i32*, i32** @stderr
ret i32* %1
}
/* Variables and functions */
float tanf(float);
float __ocl_tan_float(float src) { return tanf(src); }


x86 assembly (clang, -O0):
<__ocl_tan_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <tanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_tan_float>:
jmp    1030 <tanf@plt>

LLVM IR (-O0):
define float @__ocl_tan_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @tanf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @__ocl_tan_float(float %0) {
%2 = tail call float @tanf(float %0)
ret float %2
}
int ubi_dbg_is_write_failure(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @ubi_dbg_is_write_failure() {
ret i32 0
}

LLVM IR (-O2):
define i32 @ubi_dbg_is_write_failure() {
ret i32 0
}
int ft_any(char **tab, int (*f)(char *)) {
  int i;
  i = 0;
  while (tab[i])
    if (f(tab[i++]))
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_any>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1160 <ft_any+0x60>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x1c(%rbp),%edx
mov    %edx,%esi
add    $0x1,%esi
mov    %esi,-0x1c(%rbp)
movslq %edx,%rdx
mov    (%rcx,%rdx,8),%rdi
call   *%rax
cmp    $0x0,%eax
je     115b <ft_any+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1167 <ft_any+0x67>
jmp    1117 <ft_any+0x17>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_any>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%rdi
test   %rdi,%rdi
je     112a <ft_any+0x2a>
call   *%r14
add    $0x8,%rbx
test   %eax,%eax
je     1110 <ft_any+0x10>
mov    $0x1,%eax
jmp    112c <ft_any+0x2c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @ft_any(i8** nocapture %0, i32 (i8*)* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i64 [ %9, %8 ], [ 0, %2 ]
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = add nuw i64 %4, 1
%10 = tail call i32 %1(i8* %6)
%11 = icmp eq i32 %10, 0
br i1 %11, label %3, label %12
12: ; preds = %3, %8
%13 = phi i32 [ 1, %8 ], [ 0, %3 ]
ret i32 %13
}
/* Variables and functions */
int f();
int main() {
  int y;
  y = f();
  if (y != 0) {
  ERROR:
    goto ERROR;
  }
  return (y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113d <main+0x2d>
jmp    1138 <main+0x28>
jmp    1138 <main+0x28>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
test   %eax,%eax
je     1122 <main+0x12>
nopl   0x0(%rax)
jmp    1120 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = icmp eq i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0, %3
br label %3
4: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Fork();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  int i;
  for (i = 0; i < 2; i++)
    Fork();
  printf("hello\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1165 <main+0x35>
mov    $0x0,%al
call   1030 <Fork@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <Fork@plt>
xor    %eax,%eax
call   1030 <Fork@plt>
lea    0xeba(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 (...) @Fork()
%2 = tail call i32 (...) @Fork()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
void wakeup_sysfs_remove(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @wakeup_sysfs_remove(%struct.device* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XButtonEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XButtonEvent(void) {
  XButtonEvent *_p = (XButtonEvent *)malloc(sizeof(XButtonEvent));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XButtonEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XButtonEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XButtonEvent>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XButtonEvent+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XButtonEvent() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XButtonEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ generateRandomNumbers(int *, size_t);
int *malloc(size_t);
int /*<<< orphan*/ printf(char *, int);
int search(int, int *, size_t);
int main() {
  size_t ARRAY_SIZE = 50;
  int *array = malloc(ARRAY_SIZE);
  generateRandomNumbers(array, ARRAY_SIZE);
  int foundAt = search(91, array, ARRAY_SIZE);
  printf("Found at %d", foundAt);
  free(array);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x32,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <generateRandomNumbers@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x5b,%edi
call   1060 <search@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe60(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x32,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    $0x32,%esi
mov    %rax,%rdi
call   1040 <generateRandomNumbers@plt>
mov    $0x32,%edx
mov    $0x5b,%edi
mov    %rbx,%rsi
call   1060 <search@plt>
lea    0xe7c(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Found at %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
store i64 50, i64* %2
%5 = load i64, i64* %2
%6 = call i32* @malloc(i64 %5)
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i64, i64* %2
%9 = call i32 @generateRandomNumbers(i32* %7, i64 %8)
%10 = load i32*, i32** %3
%11 = load i64, i64* %2
%12 = call i32 @search(i32 91, i32* %10, i64 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32*, i32** %3
%16 = call i32 @free(i32* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Found at %d\00"
define i32 @main() {
%1 = tail call i32* @malloc(i64 50)
%2 = tail call i32 @generateRandomNumbers(i32* %1, i64 50)
%3 = tail call i32 @search(i32 91, i32* %1, i64 50)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @free(i32* %1)
ret i32 0
}
int test_imm_61int8_mem(signed char *val) {
  return ((*val) & (-0x61 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_61int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffff9f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_61int8_mem>:
testb  $0x9f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_61int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -97
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_61int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -97
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int http_tocrlf_length(char const *);
int http_reason_length(const char *s) { return http_tocrlf_length(s); }


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

x86 assembly (clang, -O2):
<http_reason_length>:
jmp    1030 <http_tocrlf_length@plt>

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

LLVM IR (-O2):
define i32 @http_reason_length(i8* %0) {
%2 = tail call i32 @http_tocrlf_length(i8* %0)
ret i32 %2
}
long long llrint(double x) {
  long long retval;
  __asm__ __volatile__("fistpll %0" : "=m"(retval) : "t"(x) : "st");
  return retval;
}


x86 assembly (clang, -O0):
<llrint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
fldl   -0x18(%rbp)
fistpll -0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llrint>:
movsd  %xmm0,-0x10(%rsp)
fldl   -0x10(%rsp)
fistpll -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @llrint(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @llrint(double %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i64, i64* %2
ret i64 %4
}
int erase(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @erase() {
ret i32 0
}

LLVM IR (-O2):
define i32 @erase() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bubble_sort(int *, int);
int /*<<< orphan*/ confirm_array_is_sorted(int *, int);
int *copy_array(int *, int);
int /*<<< orphan*/ finish();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ start();
void test_bubble_sort(int *original, int size) {
  int *array = copy_array(original, size);
  puts("---------- bubble sort");
  start();
  bubble_sort(array, size);
  finish();
  confirm_array_is_sorted(array, size);
}


x86 assembly (clang, -O0):
<test_bubble_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1060 <copy_array@plt>
mov    %rax,-0x18(%rbp)
lea    0xe7a(%rip),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1050 <start@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1080 <bubble_sort@plt>
mov    $0x0,%al
call   1030 <finish@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <confirm_array_is_sorted@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bubble_sort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
call   1060 <copy_array@plt>
mov    %rax,%r14
lea    0xe8b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <start@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1080 <bubble_sort@plt>
xor    %eax,%eax
call   1030 <finish@plt>
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <confirm_array_is_sorted@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"---------- bubble sort\00"
define void @test_bubble_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32* @copy_array(i32* %6, i32 %7)
store i32* %8, i32** %5
%9 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @start()
%11 = load i32*, i32** %5
%12 = load i32, i32* %4
%13 = call i32 @bubble_sort(i32* %11, i32 %12)
%14 = call i32 (...) @finish()
%15 = load i32*, i32** %5
%16 = load i32, i32* %4
%17 = call i32 @confirm_array_is_sorted(i32* %15, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"---------- bubble sort\00"
define void @test_bubble_sort(i32* %0, i32 %1) {
%3 = tail call i32* @copy_array(i32* %0, i32 %1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @start()
%6 = tail call i32 @bubble_sort(i32* %3, i32 %1)
%7 = tail call i32 (...) @finish()
%8 = tail call i32 @confirm_array_is_sorted(i32* %3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void vector_memdel(void **ap) {
  if (ap != NULL) {
    free(*ap);
    *ap = NULL;
  }
}


x86 assembly (clang, -O0):
<vector_memdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <vector_memdel+0x2e>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_memdel>:
test   %rdi,%rdi
je     1129 <vector_memdel+0x19>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @vector_memdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int a;
  int *p;
  int *q;
  a = 1;
  p = &a;
  q = p;
  *q = 2;
  assert(a == 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
store i32 1, i32* %2
store i32* %2, i32** %3
%5 = load i32*, i32** %3
store i32* %5, i32** %4
%6 = load i32*, i32** %4
store i32 2, i32* %6
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}