xunge/DecIR huggingface dataset:
/* Variables and functions */
int _pack2(int /*<<< orphan*/, int /*<<< orphan*/);
unsigned short cosf(unsigned short);
int /*<<< orphan*/ roundf(unsigned short);
unsigned short sinf(unsigned short);
unsigned mkPolar_fun_ushort(unsigned short r, unsigned short t) {
  return _pack2(roundf(r * cosf(t)), roundf(r * sinf(t)));
}


x86 assembly (clang, -O0):
<mkPolar_fun_ushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%ax
movzwl %ax,%edi
call   1050 <cosf@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%eax
movzwl %cx,%ecx
imul   %ecx,%eax
movzwl %ax,%edi
call   1060 <roundf@plt>
mov    %eax,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%ax
movzwl %ax,%edi
call   1030 <sinf@plt>
mov    %ax,%cx
mov    -0xc(%rbp),%eax
movzwl %cx,%ecx
imul   %ecx,%eax
movzwl %ax,%edi
call   1060 <roundf@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <_pack2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkPolar_fun_ushort>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1050 <cosf@plt>
imul   %ebp,%eax
movzwl %ax,%edi
call   1060 <roundf@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <sinf@plt>
imul   %ebp,%eax
movzwl %ax,%edi
call   1060 <roundf@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <_pack2@plt>

LLVM IR (-O0):
define i32 @mkPolar_fun_ushort(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i16, i16* %4
%8 = call zeroext i16 @cosf(i16 zeroext %7)
%9 = zext i16 %8 to i32
%10 = mul nsw i32 %6, %9
%11 = trunc i32 %10 to i16
%12 = call i32 @roundf(i16 zeroext %11)
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = load i16, i16* %4
%16 = call zeroext i16 @sinf(i16 zeroext %15)
%17 = zext i16 %16 to i32
%18 = mul nsw i32 %14, %17
%19 = trunc i32 %18 to i16
%20 = call i32 @roundf(i16 zeroext %19)
%21 = call i32 @_pack2(i32 %12, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @mkPolar_fun_ushort(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call zeroext i16 @cosf(i16 zeroext %1)
%4 = mul i16 %3, %0
%5 = tail call i32 @roundf(i16 zeroext %4)
%6 = tail call zeroext i16 @sinf(i16 zeroext %1)
%7 = mul i16 %6, %0
%8 = tail call i32 @roundf(i16 zeroext %7)
%9 = tail call i32 @_pack2(i32 %5, i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fmt_ul(unsigned long);
int /*<<< orphan*/ w(int /*<<< orphan*/);
void wn(unsigned long u) { w(fmt_ul(u)); }


x86 assembly (clang, -O0):
<wn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fmt_ul@plt>
mov    %eax,%edi
call   1040 <w@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wn>:
push   %rax
call   1030 <fmt_ul@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <w@plt>

LLVM IR (-O0):
define void @wn(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @fmt_ul(i64 %3)
%5 = call i32 @w(i32 %4)
ret void
}

LLVM IR (-O2):
define void @wn(i64 %0) {
%2 = tail call i32 @fmt_ul(i64 %0)
%3 = tail call i32 @w(i32 %2)
ret void
}
/* Variables and functions */
int func_five(int);
int func_four(int x) { return func_five(x + 4); }


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

x86 assembly (clang, -O2):
<func_four>:
add    $0x4,%edi
jmp    1030 <func_five@plt>

LLVM IR (-O0):
define i32 @func_four(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 4
%5 = call i32 @func_five(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @func_four(i32 %0) {
%2 = add nsw i32 %0, 4
%3 = tail call i32 @func_five(i32 %2)
ret i32 %3
}
int next_data_handle(int addr) { return (addr + 1) == 8 ? 0 : (addr + 1); }


x86 assembly (clang, -O0):
<next_data_handle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x8,%eax
jne    1120 <next_data_handle+0x20>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <next_data_handle+0x29>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_data_handle>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0x8,%ecx
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @next_data_handle(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = icmp eq i32 %2, 8
%4 = select i1 %3, i32 0, i32 %2
ret i32 %4
}
void bl_init_ports(void) {}


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

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

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

LLVM IR (-O2):
define void @bl_init_ports() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
int /*<<< orphan*/ reverse_memcpy(void *, void *, int);
void single_float_to_bytes(float source, unsigned char bytes[4],
                           int switch_endian) {
  void *dest_ptr = (void *)bytes;
  void *source_ptr = (void *)&source;
  if (switch_endian) {
    reverse_memcpy(dest_ptr, source_ptr, 4);
  } else {
    memcpy(dest_ptr, source_ptr, 4);
  }
}


x86 assembly (clang, -O0):
<single_float_to_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1165 <single_float_to_bytes+0x45>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0x4,%edx
call   1030 <reverse_memcpy@plt>
jmp    1177 <single_float_to_bytes+0x57>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<single_float_to_bytes>:
push   %rax
movss  %xmm0,0x4(%rsp)
test   %esi,%esi
je     113c <single_float_to_bytes+0x1c>
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <reverse_memcpy@plt>
pop    %rax
ret
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @single_float_to_bytes(float %0, i8* %1, i32 %2) {
%4 = alloca float
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store float %0, float* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %5
store i8* %9, i8** %7
%10 = bitcast float* %4 to i8*
store i8* %10, i8** %8
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = call i32 @reverse_memcpy(i8* %14, i8* %15, i32 4)
br label %21
17: ; preds = %3
%18 = load i8*, i8** %7
%19 = load i8*, i8** %8
%20 = call i32 @memcpy(i8* %18, i8* %19, i32 4)
br label %21
21: ; preds = %17, %13
ret void
}

LLVM IR (-O2):
define void @single_float_to_bytes(float %0, i8* %1, i32 %2) {
%4 = alloca float
store float %0, float* %4
%5 = bitcast float* %4 to i8*
%6 = icmp eq i32 %2, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = call i32 @reverse_memcpy(i8* %1, i8* %5, i32 4)
br label %11
9: ; preds = %3
%10 = call i32 @memcpy(i8* %1, i8* %5, i32 4)
br label %11
11: ; preds = %9, %7
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ datagramSerialOut(int const *, int);
void outputBreak() {
  const uint8_t buffer[] = {0x00, 0x00};
  datagramSerialOut(buffer, sizeof(buffer));
}


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

x86 assembly (clang, -O2):
<outputBreak>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <datagramSerialOut@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @outputBreak() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @datagramSerialOut(i32* %3, i32 8)
ret void
}

LLVM IR (-O2):
define void @outputBreak() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%3 = bitcast i64* %1 to i32*
%4 = call i32 @datagramSerialOut(i32* %3, i32 8)
ret void
}
/* Type definitions */
struct i8x_readbuf {
  int dummy;
};
struct i8x_object {
  int dummy;
};
struct i8x_ctx {
  int dummy;
};

/* Variables and functions */
struct i8x_ctx *i8x_ob_get_ctx(struct i8x_object *);
struct i8x_ctx *__attribute__((always_)) i8x_rb_get_ctx(struct i8x_readbuf *x) {
  return i8x_ob_get_ctx((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_rb_get_ctx>:
jmp    1030 <i8x_ob_get_ctx@plt>

LLVM IR (-O0):
%struct.i8x_ctx = type { i32 }
%struct.i8x_readbuf = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_ctx* @i8x_rb_get_ctx(%struct.i8x_readbuf* %0) {
%2 = alloca %struct.i8x_readbuf*
store %struct.i8x_readbuf* %0, %struct.i8x_readbuf** %2
%3 = load %struct.i8x_readbuf*, %struct.i8x_readbuf** %2
%4 = bitcast %struct.i8x_readbuf* %3 to %struct.i8x_object*
%5 = call %struct.i8x_ctx* @i8x_ob_get_ctx(%struct.i8x_object* %4)
ret %struct.i8x_ctx* %5
}

LLVM IR (-O2):
%struct.i8x_ctx = type { i32 }
%struct.i8x_readbuf = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_ctx* @i8x_rb_get_ctx(%struct.i8x_readbuf* %0) {
%2 = bitcast %struct.i8x_readbuf* %0 to %struct.i8x_object*
%3 = tail call %struct.i8x_ctx* @i8x_ob_get_ctx(%struct.i8x_object* %2)
ret %struct.i8x_ctx* %3
}
/* Variables and functions */
int u8isspacei(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointcc(char const *);
int u8isspacecc(const char *c) { return u8isspacei(u8tointcc(c)); }


x86 assembly (clang, -O0):
<u8isspacecc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointcc@plt>
mov    %eax,%edi
call   1040 <u8isspacei@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isspacecc>:
push   %rax
call   1030 <u8tointcc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8isspacei@plt>

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

LLVM IR (-O2):
define i32 @u8isspacecc(i8* %0) {
%2 = tail call i32 @u8tointcc(i8* %0)
%3 = tail call i32 @u8isspacei(i32 %2)
ret i32 %3
}
/* Variables and functions */
size_t tdb_clampu(size_t min, size_t val, size_t max) {
  if (val <= min)
    return min;
  if (val >= max)
    return max;
  return val;
}


x86 assembly (clang, -O0):
<tdb_clampu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     112b <tdb_clampu+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <tdb_clampu+0x4e>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jb     1146 <tdb_clampu+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <tdb_clampu+0x4e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tdb_clampu>:
mov    %rdx,%rax
cmp    %rdx,%rsi
cmovb  %rsi,%rax
cmp    %rdi,%rsi
cmovbe %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @tdb_clampu(i64 %0, i64 %1, i64 %2) {
%4 = icmp ugt i64 %1, %0
%5 = icmp ult i64 %1, %2
%6 = select i1 %5, i64 %1, i64 %2
%7 = select i1 %4, i64 %6, i64 %0
ret i64 %7
}
/* Variables and functions */
int atoi(char const *);
char *readln(char *, unsigned long);
int readi() {
  char buffer[256UL];
  const char *ret = readln(buffer, 256UL);
  if (ret == 0)
    return 0x80000000;
  return atoi(ret);
}


x86 assembly (clang, -O0):
<readi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1030 <readln@plt>
mov    %rax,-0x118(%rbp)
cmpq   $0x0,-0x118(%rbp)
jne    115d <readi+0x3d>
movl   $0x80000000,-0x4(%rbp)
jmp    116c <readi+0x4c>
mov    -0x118(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readi>:
sub    $0x108,%rsp
mov    %rsp,%rdi
mov    $0x100,%esi
call   1030 <readln@plt>
test   %rax,%rax
je     1149 <readi+0x29>
mov    %rax,%rdi
call   1040 <atoi@plt>
add    $0x108,%rsp
ret
mov    $0x80000000,%eax
add    $0x108,%rsp
ret

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

LLVM IR (-O2):
define i32 @readi() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i8* @readln(i8* %2, i64 256)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @atoi(i8* %3)
br label %7
7: ; preds = %0, %5
%8 = phi i32 [ %6, %5 ], [ -2147483648, %0 ]
ret i32 %8
}
/* Variables and functions */
int checker_read_int(int /*<<< orphan*/, char const *, int, int *);
int checker_read_in_int(const char *name, int eof_error_flag, int *p_val) {
  return checker_read_int(0, name, eof_error_flag, p_val);
}


x86 assembly (clang, -O0):
<checker_read_in_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %edi,%edi
call   1030 <checker_read_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @checker_read_in_int(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @checker_read_int(i32 0, i8* %0, i32 %1, i32* %2)
ret i32 %4
}
int count_1_3(int v) {
  int num = 0;
  while (v) {
    v &= (v - 1);
    num++;
  }
  return num;
}


x86 assembly (clang, -O0):
<count_1_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <count_1_3+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <count_1_3+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_1_3>:
xor    %eax,%eax
test   %edi,%edi
je     111c <count_1_3+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <count_1_3+0x10>
ret

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

LLVM IR (-O2):
define i32 @count_1_3(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ CmdBurnSrecLineIntoRAM(char *);
int /*<<< orphan*/ CmdGetLineNoEcho(char *);
int CmdLd(char *arg) {
  char srec_line[40 * 2 + 2];
  do
    CmdGetLineNoEcho(srec_line);
  while (CmdBurnSrecLineIntoRAM(srec_line));
  return 0;
}


x86 assembly (clang, -O0):
<CmdLd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x60(%rbp),%rdi
call   1040 <CmdGetLineNoEcho@plt>
lea    -0x60(%rbp),%rdi
call   1030 <CmdBurnSrecLineIntoRAM@plt>
cmp    $0x0,%rax
jne    112c <CmdLd+0xc>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdLd>:
push   %rbx
sub    $0x60,%rsp
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <CmdGetLineNoEcho@plt>
mov    %rbx,%rdi
call   1030 <CmdBurnSrecLineIntoRAM@plt>
test   %rax,%rax
jne    1130 <CmdLd+0x10>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @CmdLd(i8* nocapture readnone %0) {
%2 = alloca [82 x i8]
%3 = getelementptr inbounds [82 x i8], [82 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %4, %1
%5 = call i32 @CmdGetLineNoEcho(i8* %3)
%6 = call i64 @CmdBurnSrecLineIntoRAM(i8* %3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4
ret i32 0
}
void putch(unsigned char c) {}


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @putch(i8 zeroext %0) {
ret void
}
int _kb_signal_alarm_resume(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_kb_signal_alarm_resume() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ call6g(unsigned char, unsigned short, unsigned int,
                          unsigned long);
void call6f(double d, unsigned char uc, unsigned short us, unsigned int ui,
            unsigned long ul) {
  d = d;
  call6g(uc, us, ui, ul);
}


x86 assembly (clang, -O0):
<call6f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %dil,%sil
movsd  %xmm0,-0x8(%rbp)
mov    %sil,-0x9(%rbp)
mov    %ax,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0x9(%rbp),%sil
mov    -0xc(%rbp),%ax
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
movzbl %sil,%edi
movzwl %ax,%esi
call   1030 <call6g@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call6f>:
jmp    1030 <call6g@plt>

LLVM IR (-O0):
define void @call6f(double %0, i8 zeroext %1, i16 zeroext %2, i32 %3, i64 %4) {
%6 = alloca double
%7 = alloca i8
%8 = alloca i16
%9 = alloca i32
%10 = alloca i64
store double %0, double* %6
store i8 %1, i8* %7
store i16 %2, i16* %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%11 = load double, double* %6
store double %11, double* %6
%12 = load i8, i8* %7
%13 = load i16, i16* %8
%14 = load i32, i32* %9
%15 = load i64, i64* %10
%16 = call i32 @call6g(i8 zeroext %12, i16 zeroext %13, i32 %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @call6f(double %0, i8 zeroext %1, i16 zeroext %2, i32 %3, i64 %4) {
%6 = tail call i32 @call6g(i8 zeroext %1, i16 zeroext %2, i32 %3, i64 %4)
ret void
}
/* Variables and functions */
scalar_t__ evalfuns();
long evalval();
scalar_t__ test(char *);
long evalumin() {
  if (test("+"))
    return ((long)evalfuns());
  else if (test("-"))
    return ((long)-evalfuns());
  else
    return (evalval());
}


x86 assembly (clang, -O0):
<evalumin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <test@plt>
cmp    $0x0,%rax
je     115e <evalumin+0x2e>
mov    $0x0,%al
call   1040 <evalfuns@plt>
mov    %rax,-0x8(%rbp)
jmp    1197 <evalumin+0x67>
lea    0xe9d(%rip),%rdi
call   1050 <test@plt>
cmp    $0x0,%rax
je     118c <evalumin+0x5c>
mov    $0x0,%al
call   1040 <evalfuns@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1197 <evalumin+0x67>
mov    $0x0,%al
call   1030 <evalval@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evalumin>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <test@plt>
test   %rax,%rax
je     114a <evalumin+0x1a>
xor    %eax,%eax
pop    %rcx
jmp    1040 <evalfuns@plt>
lea    0xeb1(%rip),%rdi
call   1050 <test@plt>
test   %rax,%rax
je     1167 <evalumin+0x37>
xor    %eax,%eax
call   1040 <evalfuns@plt>
neg    %rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <evalval@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"+\00"
@.str.1 = [2 x i8] c"-\00"
define i64 @evalumin() {
%1 = alloca i64
%2 = call i64 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i64 (...) @evalfuns()
store i64 %5, i64* %1
br label %14
6: ; preds = %0
%7 = call i64 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = call i64 (...) @evalfuns()
%11 = sub nsw i64 0, %10
store i64 %11, i64* %1
br label %14
12: ; preds = %6
%13 = call i64 (...) @evalval()
store i64 %13, i64* %1
br label %14
14: ; preds = %12, %9, %4
%15 = load i64, i64* %1
ret i64 %15
}

LLVM IR (-O2):
@.str = [2 x i8] c"+\00"
@.str.1 = [2 x i8] c"-\00"
define i64 @evalumin() {
%1 = tail call i64 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i64 (...) @evalfuns()
br label %13
5: ; preds = %0
%6 = tail call i64 @test(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = tail call i64 (...) @evalfuns()
%10 = sub nsw i64 0, %9
br label %13
11: ; preds = %5
%12 = tail call i64 (...) @evalval()
br label %13
13: ; preds = %11, %8, %3
%14 = phi i64 [ %4, %3 ], [ %10, %8 ], [ %12, %11 ]
ret i64 %14
}
/* Type definitions */
struct t_gui_lines {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct t_gui_lines *);
void gui_lines_free(struct t_gui_lines *lines) {
  if (!lines)
    return;
  free(lines);
}


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

x86 assembly (clang, -O2):
<gui_lines_free>:
test   %rdi,%rdi
je     111a <gui_lines_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.t_gui_lines = type { i32 }
define void @gui_lines_free(%struct.t_gui_lines* %0) {
%2 = icmp eq %struct.t_gui_lines* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.t_gui_lines* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int salir() {
  endwin();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @salir() {
%1 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @salir() {
%1 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_append_array(void *m, char type, const void *ptr, size_t size) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_append_array>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
mov    0x2ec1(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_append_array>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_append_array(i8* %0, i8 signext %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8 %1, i8* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_append_array(i8* nocapture readnone %0, i8 signext %1, i8* nocapture readnone %2, i64 %3) {
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}
int min_bit(int origin_larg) {
  int bit = 1;
  while (origin_larg >>= 1)
    bit++;
  return bit;
}


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

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

LLVM IR (-O0):
define i32 @min_bit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = ashr 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 nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @min_bit(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 = ashr 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
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void end_graphmode(FILE *fd) { fprintf(fd, "\033*rB"); }


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

x86 assembly (clang, -O2):
<end_graphmode>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B*rB\00"
define void @end_graphmode(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B*rB\00"
define void @end_graphmode(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %0)
ret void
}
int f(int b, int c) {
  int a = (b >> 16) * (c >> 16);
  if (!a)
    return 10;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x10,%eax
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1132 <f+0x32>
movl   $0xa,-0x4(%rbp)
jmp    1138 <f+0x38>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sar    $0x10,%edi
sar    $0x10,%esi
imul   %edi,%esi
test   %esi,%esi
mov    $0xa,%eax
cmovne %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = ashr i32 %0, 16
%4 = ashr i32 %1, 16
%5 = mul nsw i32 %4, %3
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 10, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("This test is testing mips32r2 instructions in fpu64 mode.\n");
  ;
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"This test is testing mips32r2 instructions in fpu64 mode.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [58 x i8] c"This test is testing mips32r2 instructions in fpu64 mode.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ op_write2(int, int /*<<< orphan*/);
void op_enc_jr_nz_n(int8_t val) { op_write2(0x20, val); }


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

x86 assembly (clang, -O2):
<op_enc_jr_nz_n>:
mov    %edi,%esi
mov    $0x20,%edi
jmp    1030 <op_write2@plt>

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

LLVM IR (-O2):
define void @op_enc_jr_nz_n(i32 %0) {
%2 = tail call i32 @op_write2(i32 32, i32 %0)
ret void
}
/* Variables and functions */
char *__attribute__((used)) strncpy(char *dest, const char *src, size_t n) {
  while (n--) {
    char c = *src++;
    *dest++ = c;
    if (!c) {
      break;
    }
  }
  return dest;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1165 <strncpy+0x65>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
cmpb   $0x0,-0x19(%rbp)
jne    1160 <strncpy+0x60>
jmp    1165 <strncpy+0x65>
jmp    1110 <strncpy+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %rcx,%rdx
je     1126 <strncpy+0x26>
movzbl (%rsi,%rcx,1),%edi
mov    %dil,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dil,%dil
jne    1110 <strncpy+0x10>
add    %rcx,%rax
ret

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i8* (i8*, i8*, i64)* @strncpy to i8*)], section "llvm.metadata"
define i8* @strncpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
br label %8
8: ; preds = %22, %3
%9 = load i64, i64* %6
%10 = add i64 %9, -1
store i64 %10, i64* %6
%11 = icmp ne i64 %9, 0
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %5
%15 = load i8, i8* %13
store i8 %15, i8* %7
%16 = load i8, i8* %7
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %4
store i8 %16, i8* %17
%19 = load i8, i8* %7
%20 = icmp ne i8 %19, 0
br i1 %20, label %22, label %21
21: ; preds = %12
br label %23
22: ; preds = %12
br label %8
23: ; preds = %21, %8
%24 = load i8*, i8** %4
ret i8* %24
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i8* (i8*, i8*, i64)* @strncpy to i8*)], section "llvm.metadata"
define i8* @strncpy(i8* writeonly %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %1, %3 ], [ %11, %9 ]
%6 = phi i64 [ %2, %3 ], [ %10, %9 ]
%7 = phi i8* [ %0, %3 ], [ %13, %9 ]
%8 = icmp eq i64 %6, 0
br i1 %8, label %15, label %9
9: ; preds = %4
%10 = add i64 %6, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %12, i8* %7
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %4
15: ; preds = %9, %4
%16 = phi i8* [ %13, %9 ], [ %7, %4 ]
ret i8* %16
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *memdup(void const *, size_t);
int /*<<< orphan*/ reverse(char *, size_t);
size_t write_FP(int /*<<< orphan*/ *, char *, size_t);
size_t write_FP_BE(FILE *fp, const void *data, size_t size) {
  char *dup = memdup(data, size);
  reverse(dup, size);
  size_t count = write_FP(fp, dup, size);
  free(dup);
  return count;
}


x86 assembly (clang, -O0):
<write_FP_BE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <memdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <write_FP@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_FP_BE>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1060 <memdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1050 <write_FP@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <free@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @write_FP_BE(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @memdup(i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i64, i64* %6
%14 = call i32 @reverse(i8* %12, i64 %13)
%15 = load i32*, i32** %4
%16 = load i8*, i8** %7
%17 = load i64, i64* %6
%18 = call i64 @write_FP(i32* %15, i8* %16, i64 %17)
store i64 %18, i64* %8
%19 = load i8*, i8** %7
%20 = call i32 @free(i8* %19)
%21 = load i64, i64* %8
ret i64 %21
}

LLVM IR (-O2):
define i64 @write_FP_BE(i32* %0, i8* %1, i64 %2) {
%4 = tail call i8* @memdup(i8* %1, i64 %2)
%5 = tail call i32 @reverse(i8* %4, i64 %2)
%6 = tail call i64 @write_FP(i32* %0, i8* %4, i64 %2)
%7 = tail call i32 @free(i8* %4)
ret i64 %6
}
/* Type definitions */
struct map_sp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _pbcM_sp_insert_hash(struct map_sp *, char const *,
                                        int /*<<< orphan*/, void *);
int /*<<< orphan*/ calc_hash(char const *);
void _pbcM_sp_insert(struct map_sp *map, const char *key, void *value) {
  _pbcM_sp_insert_hash(map, key, calc_hash(key), value);
}


x86 assembly (clang, -O0):
<_pbcM_sp_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <calc_hash@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
call   1030 <_pbcM_sp_insert_hash@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pbcM_sp_insert>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <calc_hash@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <_pbcM_sp_insert_hash@plt>

LLVM IR (-O0):
%struct.map_sp = type { i32 }
define void @_pbcM_sp_insert(%struct.map_sp* %0, i8* %1, i8* %2) {
%4 = alloca %struct.map_sp*
%5 = alloca i8*
%6 = alloca i8*
store %struct.map_sp* %0, %struct.map_sp** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.map_sp*, %struct.map_sp** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @calc_hash(i8* %9)
%11 = load i8*, i8** %6
%12 = call i32 @_pbcM_sp_insert_hash(%struct.map_sp* %7, i8* %8, i32 %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.map_sp = type { i32 }
define void @_pbcM_sp_insert(%struct.map_sp* %0, i8* %1, i8* %2) {
%4 = tail call i32 @calc_hash(i8* %1)
%5 = tail call i32 @_pbcM_sp_insert_hash(%struct.map_sp* %0, i8* %1, i32 %4, i8* %2)
ret void
}
/* Variables and functions */
int MAC_VERIF(unsigned char const *, unsigned char const *, unsigned long long,
              unsigned char const *, unsigned long long);
int crypto_mac_verif(const unsigned char *c, unsigned long long clen,
                     const unsigned char *m, unsigned long long mlen,
                     const unsigned char *nsec, const unsigned char *npub,
                     const unsigned char *k) {
  int ret;
  ret = MAC_VERIF(k, m, mlen, c, clen);
  if (ret != 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<crypto_mac_verif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
call   1030 <MAC_VERIF@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     1166 <crypto_mac_verif+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <crypto_mac_verif+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_mac_verif>:
push   %rax
mov    %rsi,%r8
mov    %rdi,%rax
mov    0x10(%rsp),%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %rax,%rcx
call   1030 <MAC_VERIF@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @crypto_mac_verif(i8* %0, i64 %1, i8* %2, i64 %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i8* %6) {
%8 = tail call i32 @MAC_VERIF(i8* %6, i8* %2, i64 %3, i8* %0, i64 %1)
%9 = icmp ne i32 %8, 0
%10 = sext i1 %9 to i32
ret i32 %10
}
struct Node {
} main() {
}


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

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
void motion_result4(int *data) {
  int i = 0;
  int j = 2 / data[2];
  do {
    data[i] = j + i - 1;
    i++;
  } while (i < data[2]);
}


x86 assembly (clang, -O0):
<motion_result4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x2,%eax
cltd
idivl  0x8(%rcx)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edx
add    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%eax
jl     111f <motion_result4+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<motion_result4>:
xor    %ecx,%ecx
mov    $0x2,%eax
xor    %edx,%edx
idivl  0x8(%rdi)
add    $0xffffffff,%eax
nop
lea    (%rax,%rcx,1),%edx
mov    %edx,(%rdi,%rcx,4)
add    $0x1,%rcx
movslq 0x8(%rdi),%rdx
cmp    %rdx,%rcx
jl     1110 <motion_result4+0x10>
ret

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

LLVM IR (-O2):
define void @motion_result4(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = sdiv i32 2, %3
%5 = add nsw i32 %4, -1
br label %6
6: ; preds = %6, %1
%7 = phi i64 [ %11, %6 ], [ 0, %1 ]
%8 = trunc i64 %7 to i32
%9 = add i32 %5, %8
%10 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %9, i32* %10
%11 = add nuw nsw i64 %7, 1
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = icmp slt i64 %11, %13
br i1 %14, label %6, label %15
15: ; preds = %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ o5__resetvars();
int /*<<< orphan*/ write_char(int);
void o5_reset(void) {
  o5__resetvars();
  write_char(0xff);
}


x86 assembly (clang, -O0):
<o5_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <o5__resetvars@plt>
mov    $0xff,%edi
call   1030 <write_char@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<o5_reset>:
push   %rax
xor    %eax,%eax
call   1040 <o5__resetvars@plt>
mov    $0xff,%edi
pop    %rax
jmp    1030 <write_char@plt>

LLVM IR (-O0):
define void @o5_reset() {
%1 = call i32 (...) @o5__resetvars()
%2 = call i32 @write_char(i32 255)
ret void
}

LLVM IR (-O2):
define void @o5_reset() {
%1 = tail call i32 (...) @o5__resetvars()
%2 = tail call i32 @write_char(i32 255)
ret void
}