xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strchr(char *, char);
char *get_filename_ext(char *filename) {
  char *dot = strchr(filename, '.');
  if (!dot || dot == filename)
    return "";
  return dot + 1;
}


x86 assembly (clang, -O0):
<get_filename_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <get_filename_ext+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1157 <get_filename_ext+0x47>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <get_filename_ext+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filename_ext>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rcx
cmp    %rbx,%rax
lea    0xed4(%rip),%rdx
cmove  %rdx,%rcx
test   %rax,%rax
cmove  %rdx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @get_filename_ext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9, %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
14: ; preds = %9
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %2
br label %17
17: ; preds = %14, %13
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @get_filename_ext(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = icmp eq i8* %2, %0
%5 = or i1 %3, %4
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %6
ret i8* %7
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGCHLD;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)(int));
int wait(int /*<<< orphan*/ *);
void handle(int s) {
  signal(SIGCHLD, handle);
  pid_t pid = wait(NULL);
  printf("clinet : %d closed.....\n", pid);
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    0x2e8d(%rip),%rsi
call   1040 <signal@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <wait@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rsi
call   1040 <signal@plt>
xor    %edi,%edi
call   1050 <wait@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@SIGCHLD = global i32 0
@.str = [25 x i8] c"clinet : %d closed.....\0A\00"
define void @handle(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @SIGCHLD
%5 = call i32 @signal(i32 %4, void (i32)* @handle)
%6 = call i32 @wait(i32* null)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@SIGCHLD = global i32 0
@.str = [25 x i8] c"clinet : %d closed.....\0A\00"
define void @handle(i32 %0) {
%2 = load i32, i32* @SIGCHLD
%3 = tail call i32 @signal(i32 %2, void (i32)* @handle)
%4 = tail call i32 @wait(i32* null)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int u32log2(int /*<<< orphan*/);
unsigned u64log2(uint64_t v) {
  register uint64_t tt;
  return (tt = v >> 32) ? (32 + u32log2((uint32_t)tt)) : u32log2((uint32_t)v);
}


x86 assembly (clang, -O0):
<u64log2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1144 <u64log2+0x34>
mov    -0x8(%rbp),%edi
call   1030 <u32log2@plt>
add    $0x20,%eax
mov    %eax,-0xc(%rbp)
jmp    114f <u64log2+0x3f>
mov    -0x4(%rbp),%edi
call   1030 <u32log2@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u64log2>:
jmp    1030 <u32log2@plt>

LLVM IR (-O0):
define i32 @u64log2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 32
store i32 %5, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @u32log2(i32 %8)
%10 = add nsw i32 32, %9
br label %14
11: ; preds = %1
%12 = load i32, i32* %2
%13 = call i32 @u32log2(i32 %12)
br label %14
14: ; preds = %11, %7
%15 = phi i32 [ %10, %7 ], [ %13, %11 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @u64log2(i32 %0) {
%2 = tail call i32 @u32log2(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ uioPrintChar(char const);
void uioPrintN(int length, const char *string) {
  for (int i = 0; i < length; i++)
    uioPrintChar(string[i]);
}


x86 assembly (clang, -O0):
<uioPrintN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <uioPrintN+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <uioPrintChar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <uioPrintN+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uioPrintN>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1143 <uioPrintN+0x33>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <uioPrintChar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <uioPrintN+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @uioPrintN(i32 %0, i8* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @uioPrintChar(i8 signext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ receive_process(int);
void *receive_client(void *other) {
  receive_process(*(int *)other);
  close(*(int *)other);
  pthread_exit(NULL);
  return NULL;
}


x86 assembly (clang, -O0):
<receive_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <receive_process@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <pthread_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receive_client>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1040 <receive_process@plt>
mov    (%rbx),%edi
call   1030 <close@plt>
xor    %edi,%edi
call   1050 <pthread_exit@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @receive_client(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @receive_process(i32 %5)
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = call i32 @close(i32 %9)
%11 = call i32 @pthread_exit(i32* null)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @receive_client(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @receive_process(i32 %3)
%5 = load i32, i32* %2
%6 = tail call i32 @close(i32 %5)
%7 = tail call i32 @pthread_exit(i32* null)
ret i8* null
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ same_screen;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
int get_XEnterWindowEvent_same_screen(void *_p) {
  return (int)((XEnterWindowEvent *)_p)->same_screen;
}


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

x86 assembly (clang, -O2):
<get_XEnterWindowEvent_same_screen>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XEnterWindowEvent_same_screen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XEnterWindowEvent_same_screen(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
unsigned int fls(unsigned int x) {
  unsigned int count = 0;
  while (x >>= 1) {
    count++;
  }
  return count + 1;
}


x86 assembly (clang, -O0):
<fls>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <fls+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <fls+0xe>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fls>:
mov    $0x1,%eax
cmp    $0x2,%edi
jb     112c <fls+0x2c>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1120 <fls+0x20>
ret

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

LLVM IR (-O2):
define i32 @fls(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
void RTjpeg_quant_init(void) {}


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

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

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

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ crcByte(int /*<<< orphan*/, unsigned char);
uint16_t crccal(unsigned char *buf, int len) {
  uint16_t res = 0;
  int i;
  for (i = 0; i < len; ++i) {
    res = crcByte(res, buf[i]);
  }
  return res;
}


x86 assembly (clang, -O0):
<crccal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <crccal+0x4e>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
call   1030 <crcByte@plt>
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <crccal+0x1d>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crccal>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <crccal+0x37>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%r14,%rbx,1),%esi
mov    %eax,%edi
call   1030 <crcByte@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <crccal+0x20>
jmp    1149 <crccal+0x39>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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

/* Variables and functions */
uint32_t bam_swap_endian_4(uint32_t v) {
  v = ((v & 0x0000FFFFU) << 16) | (v >> 16);
  return ((v & 0x00FF00FFU) << 8) | ((v & 0xFF00FF00U) >> 8);
}


x86 assembly (clang, -O0):
<bam_swap_endian_4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff00,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bam_swap_endian_4>:
mov    %edi,%eax
shl    $0x10,%eax
sar    $0x10,%edi
or     %edi,%eax
bswap  %eax
ror    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @bam_swap_endian_4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = shl i32 %4, 16
%6 = load i32, i32* %2
%7 = ashr i32 %6, 16
%8 = or i32 %5, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 16711935
%11 = shl i32 %10, 8
%12 = load i32, i32* %2
%13 = and i32 %12, -16711936
%14 = lshr i32 %13, 8
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @bam_swap_endian_4(i32 %0) {
%2 = shl i32 %0, 16
%3 = ashr i32 %0, 16
%4 = or i32 %2, %3
%5 = shl i32 %4, 8
%6 = and i32 %5, -16711936
%7 = lshr i32 %4, 8
%8 = and i32 %7, 16711935
%9 = or i32 %6, %8
ret i32 %9
}
/* Variables and functions */
char *strchr(char *, char);
void skip_comment(char *str) {
  char *comment_start = strchr(str, '#');
  if (comment_start) {
    *comment_start = '\0';
  }
}


x86 assembly (clang, -O0):
<skip_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <skip_comment+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_comment>:
push   %rax
mov    $0x23,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <skip_comment+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @skip_comment(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 35)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int write(int, char *, int);
int write_to(int sock, char *buffer, int buf_len) {
  int bytes_written;
  bytes_written = write(sock, buffer, buf_len);
  if (bytes_written < 0)
    error("error writing to socket");
  return bytes_written;
}


x86 assembly (clang, -O0):
<write_to>:
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 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    115a <write_to+0x3a>
lea    0xeab(%rip),%rdi
call   1040 <error@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_to>:
push   %rbx
call   1030 <write@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <write_to+0x18>
lea    0xecd(%rip),%rdi
call   1040 <error@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"error writing to socket\00"
define i32 @write_to(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *smalloc(unsigned int);
int strlen(char const *);
char *vcopy(const char *str) {
  char *new;
  unsigned len;
  if (*str == '\0')
    return "";
  len = strlen(str) + 1;
  new = smalloc(len);
  memcpy(new, str, (int)len);
  return new;
}


x86 assembly (clang, -O0):
<vcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    115c <vcopy+0x2c>
lea    0xead(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    118f <vcopy+0x5f>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1050 <smalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vcopy>:
push   %rbp
push   %r14
push   %rbx
cmpb   $0x0,(%rdi)
je     115d <vcopy+0x2d>
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <smalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
jmp    1164 <vcopy+0x34>
lea    0xe9c(%rip),%r14
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @vcopy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %22
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i32 @strlen(i8* %12)
%14 = add nsw i32 %13, 1
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = call i8* @smalloc(i32 %15)
store i8* %16, i8** %4
%17 = load i8*, i8** %4
%18 = load i8*, i8** %3
%19 = load i32, i32* %5
%20 = call i32 @memcpy(i8* %17, i8* %18, i32 %19)
%21 = load i8*, i8** %4
store i8* %21, i8** %2
br label %22
22: ; preds = %11, %10
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @vcopy(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = add nsw i32 %5, 1
%7 = tail call i8* @smalloc(i32 %6)
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i32 %6)
br label %9
9: ; preds = %1, %4
%10 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ triggers_bug(int *);
void bar(int *p) {
  if (!!p) {
    return;
  }
  if (p == 0) {
    triggers_bug(p);
  }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112c <bar+0x1c>
jmp    1140 <bar+0x30>
cmpq   $0x0,-0x8(%rbp)
jne    1140 <bar+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <triggers_bug@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   %rdi,%rdi
je     1116 <bar+0x6>
ret
xor    %edi,%edi
jmp    1030 <triggers_bug@plt>

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

LLVM IR (-O2):
define void @bar(i32* readnone %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @triggers_bug(i32* null)
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uintmax_t;

/* Variables and functions */
int /*<<< orphan*/ strtoull(char const *, char **, int);
uintmax_t strtoumax(const char *s, char **endp, int base) {
  return strtoull(s, endp, base);
}


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

x86 assembly (clang, -O2):
<strtoumax>:
jmp    1030 <strtoull@plt>

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

LLVM IR (-O2):
define i32 @strtoumax(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i32 @strtoull(i8* %0, i8** %1, i32 %2)
ret i32 %4
}
int switchcopy(int i) { return 1 - i; }


x86 assembly (clang, -O0):
<switchcopy>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<switchcopy>:
mov    $0x1,%eax
sub    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @switchcopy(i32 %0) {
%2 = sub nsw i32 1, %0
ret i32 %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t ByteSwap16(uint16_t value) { return (value >> 8) | (value << 8); }


x86 assembly (clang, -O0):
<ByteSwap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ByteSwap16>:
mov    %edi,%eax
sar    $0x8,%eax
shl    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @ByteSwap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ByteSwap16(i32 %0) {
%2 = ashr i32 %0, 8
%3 = shl i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int anetWriteWidthType(int, char *, int, int, int);
int catAnetBlockWriteTime(int fd, char *buf, int count, int waitMs) {
  return anetWriteWidthType(fd, buf, count, 2, waitMs);
}


x86 assembly (clang, -O0):
<catAnetBlockWriteTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%r8d
mov    $0x2,%ecx
call   1030 <anetWriteWidthType@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catAnetBlockWriteTime>:
mov    %ecx,%r8d
mov    $0x2,%ecx
jmp    1030 <anetWriteWidthType@plt>

LLVM IR (-O0):
define i32 @catAnetBlockWriteTime(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @anetWriteWidthType(i32 %9, i8* %10, i32 %11, i32 2, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @catAnetBlockWriteTime(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @anetWriteWidthType(i32 %0, i8* %1, i32 %2, i32 2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ func();
int /*<<< orphan*/ func2();
int /*<<< orphan*/ func3();
int /*<<< orphan*/ func4();
int main(int argc, const char *argv[]) {
  func();
  func2();
  func3();
  func4();
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <func@plt>
xor    %eax,%eax
call   1050 <func2@plt>
xor    %eax,%eax
call   1030 <func3@plt>
xor    %eax,%eax
call   1040 <func4@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()
%6 = call i32 (...) @func2()
%7 = call i32 (...) @func3()
%8 = call i32 (...) @func4()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func()
%4 = tail call i32 (...) @func2()
%5 = tail call i32 (...) @func3()
%6 = tail call i32 (...) @func4()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x65() {
  Assert_real((isgraph(101)),
              "/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_isgraph.c",
              510, ("isgraph should be 1 for e"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x65>:
push   %rbp
mov    %rsp,%rbp
mov    $0x65,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1fe,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x65>:
push   %rax
mov    $0x65,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1fe,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for e\00"
define void @t_isgraph_0x65() {
%1 = call i32 @isgraph(i32 101)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 510, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for e\00"
define void @t_isgraph_0x65() {
%1 = tail call i32 @isgraph(i32 101)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 510, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct xdg_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_set_user_data(struct wl_proxy *, void *);
void xdg_surface_set_user_data(struct xdg_surface *xdg_surface,
                               void *user_data) {
  wl_proxy_set_user_data((struct wl_proxy *)xdg_surface, user_data);
}


x86 assembly (clang, -O0):
<xdg_surface_set_user_data>:
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 <wl_proxy_set_user_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdg_surface_set_user_data>:
jmp    1030 <wl_proxy_set_user_data@plt>

LLVM IR (-O0):
%struct.xdg_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_surface_set_user_data(%struct.xdg_surface* %0, i8* %1) {
%3 = alloca %struct.xdg_surface*
%4 = alloca i8*
store %struct.xdg_surface* %0, %struct.xdg_surface** %3
store i8* %1, i8** %4
%5 = load %struct.xdg_surface*, %struct.xdg_surface** %3
%6 = bitcast %struct.xdg_surface* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %6, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.xdg_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_surface_set_user_data(%struct.xdg_surface* %0, i8* %1) {
%3 = bitcast %struct.xdg_surface* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %3, i8* %1)
ret void
}
int f1(void) {
  int f;
  2 * f;
}


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

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

LLVM IR (-O0):
define i32 @f1() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @f1() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ enomem();
void *realloc(void *, size_t);
void *erealloc(void *ptr, size_t size) {
  if ((ptr = realloc(ptr, size)) == NULL)
    enomem();
  return (ptr);
}


x86 assembly (clang, -O0):
<erealloc>:
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   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    1152 <erealloc+0x32>
mov    $0x0,%al
call   1030 <enomem@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <erealloc+0x15>
xor    %eax,%eax
call   1030 <enomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @erealloc(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 (...) @enomem()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf_realnums(int /*<<< orphan*/, char *, double *, int,
                                    char *);
int /*<<< orphan*/ stdout;
void printf_realnums(char *message1, double *doubles, int size,
                     char *message2) {
  fprintf_realnums(stdout, message1, doubles, size, message2);
}


x86 assembly (clang, -O0):
<printf_realnums>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <fprintf_realnums@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_realnums>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf_realnums@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @printf_realnums(i8* %0, double* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* @stdout
%10 = load i8*, i8** %5
%11 = load double*, double** %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = call i32 @fprintf_realnums(i32 %9, i8* %10, double* %11, i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @printf_realnums(i8* %0, double* %1, i32 %2, i8* %3) {
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf_realnums(i32 %5, i8* %0, double* %1, i32 %2, i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char);
void fprint_xrl_Rn(FILE *stream, unsigned char n) {
  fprintf(stream, "XRL   A, R%X                     ", n);
}


x86 assembly (clang, -O0):
<fprint_xrl_Rn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_xrl_Rn>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"XRL A, R%X \00"
define void @fprint_xrl_Rn(i32* %0, i8 zeroext %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 @fprintf(i32* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"XRL A, R%X \00"
define void @fprint_xrl_Rn(i32* nocapture %0, i8 zeroext %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
void termdef() {}


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

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

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

LLVM IR (-O2):
define void @termdef() {
ret void
}
double S(int x) {
  double r = 0;
  for (float i = 1; i <= x; i++) {
    r += (float)1 / i;
  }
  return r;
}


x86 assembly (clang, -O0):
<S>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  0xee9(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm1
cvtsi2ssl -0x4(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1161 <S+0x61>
movss  0xec9(%rip),%xmm0
divss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  0xeae(%rip),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    111c <S+0x1c>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<S>:
test   %edi,%edi
jle    1139 <S+0x39>
cvtsi2ss %edi,%xmm1
xorpd  %xmm0,%xmm0
movss  0xeec(%rip),%xmm2
movaps %xmm2,%xmm3
nopw   0x0(%rax,%rax,1)
movaps %xmm2,%xmm4
divss  %xmm3,%xmm4
cvtss2sd %xmm4,%xmm4
addsd  %xmm4,%xmm0
addss  %xmm2,%xmm3
ucomiss %xmm3,%xmm1
jae    1120 <S+0x20>
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @S(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca float
store i32 %0, i32* %2
store double 0.000000e+00, double* %3
store float 1.000000e+00, float* %4
br label %5
5: ; preds = %16, %1
%6 = load float, float* %4
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to float
%9 = fcmp ole float %6, %8
br i1 %9, label %10, label %19
10: ; preds = %5
%11 = load float, float* %4
%12 = fdiv float 1.000000e+00, %11
%13 = fpext float %12 to double
%14 = load double, double* %3
%15 = fadd double %14, %13
store double %15, double* %3
br label %16
16: ; preds = %10
%17 = load float, float* %4
%18 = fadd float %17, 1.000000e+00
store float %18, float* %4
br label %5
19: ; preds = %5
%20 = load double, double* %3
ret double %20
}

LLVM IR (-O2):
define double @S(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = icmp slt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi double [ 0.000000e+00, %1 ], [ %11, %6 ]
ret double %5
6: ; preds = %1, %6
%7 = phi float [ %12, %6 ], [ 1.000000e+00, %1 ]
%8 = phi double [ %11, %6 ], [ 0.000000e+00, %1 ]
%9 = fdiv float 1.000000e+00, %7
%10 = fpext float %9 to double
%11 = fadd double %8, %10
%12 = fadd float %7, 1.000000e+00
%13 = fcmp ugt float %12, %2
br i1 %13, label %4, label %6
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ *gregs;
};
struct TYPE_4__ {
  TYPE_1__ uc_mcontext;
};
typedef TYPE_2__ ucontext_t;

/* Variables and functions */
void *ucontext_stack_pointer(void *uap) {
  ucontext_t *ucontext = (ucontext_t *)uap;
  return (void *)ucontext->uc_mcontext.gregs[15];
}


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

x86 assembly (clang, -O2):
<ucontext_stack_pointer>:
mov    (%rdi),%rax
mov    0x78(%rax),%rax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64* }
define i8* @ucontext_stack_pointer(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.TYPE_4__*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.TYPE_4__*
store %struct.TYPE_4__* %5, %struct.TYPE_4__** %3
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %3
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 0
%9 = load i64*, i64** %8
%10 = getelementptr inbounds i64, i64* %9, i64 15
%11 = load i64, i64* %10
%12 = inttoptr i64 %11 to i8*
ret i8* %12
}

LLVM IR (-O2):
define i8* @ucontext_stack_pointer(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64**
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 15
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
int foo(int x, int y, int z) { return x + y + z + y; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
add    %edx,%edi
lea    (%rdi,%rsi,2),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 1
%5 = add i32 %2, %0
%6 = add i32 %5, %4
ret i32 %6
}
void NV21ToARGBRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @NV21ToARGBRow_Any_AVX2() {
ret void
}
int main(void) {
  int i;
  i = 1 + 2;
  i = 2 - 1;
  i = 3 * 6;
  i = 10 / 5;
  i = 10 % 5;
  i = i % 0;
  i = i % 0;
  i = 1 << 3;
  i = 8 >> 2;
  i = 12 & 4;
  i = 8 | 4;
  i = 12 ^ 4;
  i = -(3);
  i = ~12;
  i = 1 < 3;
  i = 2 > 3;
  i = 2 >= 3;
  i = 2 <= 3;
  i = 1 == 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x12,-0x8(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0xc,-0x8(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0xfffffffd,-0x8(%rbp)
movl   $0xfffffff3,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 1, i32* %2
store i32 18, i32* %2
store i32 2, i32* %2
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 0
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = srem i32 %5, 0
store i32 %6, i32* %2
store i32 8, i32* %2
store i32 2, i32* %2
store i32 4, i32* %2
store i32 12, i32* %2
store i32 8, i32* %2
store i32 -3, i32* %2
store i32 -13, i32* %2
store i32 1, i32* %2
store i32 0, i32* %2
store i32 0, i32* %2
store i32 1, i32* %2
store i32 0, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GL_COLOR_BUFFER_BIT;
int /*<<< orphan*/ glClear(int /*<<< orphan*/);
int /*<<< orphan*/ glColor3f(double, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glutWireTeapot(int);
void display() {
  glClear(GL_COLOR_BUFFER_BIT);
  glColor3f(1.0, 0, 0);
  glutWireTeapot(3);
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
movsd  0xea6(%rip),%xmm0
xor    %esi,%esi
mov    %esi,%edi
call   1040 <glColor3f@plt>
mov    $0x3,%edi
call   1060 <glutWireTeapot@plt>
mov    $0x0,%al
call   1050 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1030 <glClear@plt>
movsd  0xea9(%rip),%xmm0
xor    %edi,%edi
xor    %esi,%esi
call   1040 <glColor3f@plt>
mov    $0x3,%edi
call   1060 <glutWireTeapot@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = call i32 @glClear(i32 %1)
%3 = call i32 @glColor3f(double 1.000000e+00, i32 0, i32 0)
%4 = call i32 @glutWireTeapot(i32 3)
%5 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = tail call i32 @glClear(i32 %1)
%3 = tail call i32 @glColor3f(double 1.000000e+00, i32 0, i32 0)
%4 = tail call i32 @glutWireTeapot(i32 3)
%5 = tail call i32 (...) @glFlush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mdea_error(char **, char *);
int mdea_null_node_get_boolean(void *p, int *boolean, char **error) {
  mdea_error(error, "Expected boolean, got null");
  return -1;
}


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

x86 assembly (clang, -O2):
<mdea_null_node_get_boolean>:
push   %rax
mov    %rdx,%rdi
lea    0xee5(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Expected boolean, got null\00"
define i32 @mdea_null_node_get_boolean(i8* %0, i32* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8**
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = call i32 @mdea_error(i8** %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [27 x i8] c"Expected boolean, got null\00"
define i32 @mdea_null_node_get_boolean(i8* nocapture readnone %0, i32* nocapture readnone %1, i8** %2) {
%4 = tail call i32 @mdea_error(i8** %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
double M_PI;
double radian(double degree) { return degree * M_PI / 180.0; }


x86 assembly (clang, -O0):
<radian>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xedf(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radian>:
mov    0x2ee1(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @radian(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fmul double %3, %4
%6 = fdiv double %5, 1.800000e+02
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @radian(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = fdiv double %3, 1.800000e+02
ret double %4
}