xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char const *);
scalar_t__ strncmp(char *, char const *, int);
int is_keyboard(const char *name) {
  int l = strlen(name);
  if (strncmp("-kbd", name + l - 4, 4) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
add    $0xfffffffffffffffc,%rsi
lea    0xeb2(%rip),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    116e <is_keyboard+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <is_keyboard+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_keyboard>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rsi
add    $0xfffffffffffffffc,%rsi
lea    0xec6(%rip),%rdi
mov    $0x4,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"-kbd\00"
define i32 @is_keyboard(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -4
%6 = tail call i64 @strncmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i32 4)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int EPOLLIN;
int EPOLLOUT;
int ltoe_mask(int mask) {
  int result = 0;
  if (mask & 1)
    result |= EPOLLIN;
  if (mask & 2)
    result |= EPOLLOUT;
  return result;
}


x86 assembly (clang, -O0):
<ltoe_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     112c <ltoe_mask+0x2c>
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     114a <ltoe_mask+0x4a>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltoe_mask>:
mov    %edi,%eax
and    $0x1,%eax
neg    %eax
mov    0x2eda(%rip),%rcx
and    (%rcx),%eax
shl    $0x1e,%edi
sar    $0x1f,%edi
mov    0x2ebb(%rip),%rcx
and    (%rcx),%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
@EPOLLIN = global i32 0
@EPOLLOUT = global i32 0
define i32 @ltoe_mask(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @EPOLLIN
%5 = select i1 %3, i32 0, i32 %4
%6 = and i32 %0, 2
%7 = icmp eq i32 %6, 0
%8 = load i32, i32* @EPOLLOUT
%9 = select i1 %7, i32 0, i32 %8
%10 = or i32 %9, %5
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ console_tx_hex8(unsigned char);
void print_debug_hex8(unsigned char value) { console_tx_hex8(value); }


x86 assembly (clang, -O0):
<print_debug_hex8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <console_tx_hex8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_debug_hex8>:
jmp    1030 <console_tx_hex8@plt>

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

LLVM IR (-O2):
define void @print_debug_hex8(i8 zeroext %0) {
%2 = tail call i32 @console_tx_hex8(i8 zeroext %0)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int __fxstat(int, int, struct stat *);
__attribute__((__weak__, __always___)) int
softboundcets___fxstat(int ver, int file_des, struct stat *stat_struct) {
  return __fxstat(ver, file_des, stat_struct);
}


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

x86 assembly (clang, -O2):
<softboundcets___fxstat>:
jmp    1030 <__fxstat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define weak i32 @softboundcets___fxstat(i32 %0, i32 %1, %struct.stat* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.stat*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.stat* %2, %struct.stat** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load %struct.stat*, %struct.stat** %6
%10 = call i32 @__fxstat(i32 %7, i32 %8, %struct.stat* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define weak i32 @softboundcets___fxstat(i32 %0, i32 %1, %struct.stat* %2) {
%4 = tail call i32 @__fxstat(i32 %0, i32 %1, %struct.stat* %2)
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_quaddobl_start_solutions_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(267, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_quaddobl_start_solutions_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x10b,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_quaddobl_start_solutions_to_container>:
mov    $0x10b,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @copy_quaddobl_start_solutions_to_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 267, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @copy_quaddobl_start_solutions_to_container() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 267, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Absolute(int);
int /*<<< orphan*/ ROL8(int /*<<< orphan*/);
void Op2EM1(void) { ROL8(Absolute(3)); }


x86 assembly (clang, -O0):
<Op2EM1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1040 <Absolute@plt>
mov    %eax,%edi
call   1030 <ROL8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op2EM1>:
push   %rax
mov    $0x3,%edi
call   1040 <Absolute@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ROL8@plt>

LLVM IR (-O0):
define void @Op2EM1() {
%1 = call i32 @Absolute(i32 3)
%2 = call i32 @ROL8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op2EM1() {
%1 = tail call i32 @Absolute(i32 3)
%2 = tail call i32 @ROL8(i32 %1)
ret void
}
int str_length(char *s) {
  int i = 0;
  while (*s != '\0') {
    s++;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<str_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <str_length+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_length>:
cmpb   $0x0,(%rdi)
je     111c <str_length+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <str_length+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @str_length(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %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 @str_length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
void X509_CINF_new(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_CINF_new() {
ret void
}
double f8(double x) { return (x - (-0.0)) + (-0.0); }


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f8>:
xorpd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f8(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, -0.000000e+00
%5 = fadd double %4, -0.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @f8(double %0) {
%2 = fadd double %0, 0.000000e+00
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *func1(void *arg) {
  while (1) {
    printf("in func1\n");
    sleep(1);
  }
}


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

x86 assembly (clang, -O2):
<func1>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <func1+0x10>

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

LLVM IR (-O2):
@str = [9 x i8] c"in func1\00"
define noalias i8* @func1(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 1)
br label %2
}
void foo_1_2_1_2_2_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_2_2_1_1_2() {
ret void
}
/* Type definitions */
struct Camera {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ camera_move_vertical(struct Camera *, int);
void camera_move_down(struct Camera *C) { camera_move_vertical(C, -1); }


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

x86 assembly (clang, -O2):
<camera_move_down>:
mov    $0xffffffff,%esi
jmp    1030 <camera_move_vertical@plt>

LLVM IR (-O0):
%struct.Camera = type { i32 }
define void @camera_move_down(%struct.Camera* %0) {
%2 = alloca %struct.Camera*
store %struct.Camera* %0, %struct.Camera** %2
%3 = load %struct.Camera*, %struct.Camera** %2
%4 = call i32 @camera_move_vertical(%struct.Camera* %3, i32 -1)
ret void
}

LLVM IR (-O2):
%struct.Camera = type { i32 }
define void @camera_move_down(%struct.Camera* %0) {
%2 = tail call i32 @camera_move_vertical(%struct.Camera* %0, i32 -1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t cblByteOrderSwap64HostToLittle(uint64_t swap) { return swap; }


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

x86 assembly (clang, -O2):
<cblByteOrderSwap64HostToLittle>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cblByteOrderSwap64HostToLittle(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ fd_led_set_d0(int /*<<< orphan*/);
int /*<<< orphan*/ fd_led_set_d4(int /*<<< orphan*/);
void error_off(void) {
  fd_led_set_d0(0);
  fd_led_set_d4(0);
}


x86 assembly (clang, -O0):
<error_off>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <fd_led_set_d0@plt>
xor    %edi,%edi
call   1030 <fd_led_set_d4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_off>:
push   %rax
xor    %edi,%edi
call   1040 <fd_led_set_d0@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <fd_led_set_d4@plt>

LLVM IR (-O0):
define void @error_off() {
%1 = call i32 @fd_led_set_d0(i32 0)
%2 = call i32 @fd_led_set_d4(i32 0)
ret void
}

LLVM IR (-O2):
define void @error_off() {
%1 = tail call i32 @fd_led_set_d0(i32 0)
%2 = tail call i32 @fd_led_set_d4(i32 0)
ret void
}
/* Variables and functions */
int taa_h264_info_len(unsigned int);
unsigned taa_h264_quote_uvlc(unsigned v) {
  unsigned code = v + 1;
  unsigned len = 1 + 2 * taa_h264_info_len(code);
  return len;
}


x86 assembly (clang, -O0):
<taa_h264_quote_uvlc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <taa_h264_info_len@plt>
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<taa_h264_quote_uvlc>:
push   %rax
add    $0x1,%edi
call   1030 <taa_h264_info_len@plt>
add    %eax,%eax
add    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @taa_h264_quote_uvlc(i32 %0) {
%2 = add i32 %0, 1
%3 = tail call i32 @taa_h264_info_len(i32 %2)
%4 = shl nsw i32 %3, 1
%5 = or i32 %4, 1
ret i32 %5
}
int fn10(int a, char x[sizeof a]) { return sizeof x; }


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

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

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

LLVM IR (-O2):
define i32 @fn10(i32 %0, i8* nocapture readnone %1) {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ printf(char *);
void println(char *str) {
  printf(str);
  newline();
}


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

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

LLVM IR (-O0):
define void @println(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
define void @println(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 (...) @newline()
ret void
}
long zig_subw_long(long lhs, long rhs, long min, long max) {
  return (long)(((unsigned long)lhs) - ((unsigned long)rhs));
}


x86 assembly (clang, -O0):
<zig_subw_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zig_subw_long>:
mov    %rdi,%rax
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @zig_subw_long(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = sub i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @zig_subw_long(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub i64 %0, %1
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int libc_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<libc_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @libc_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void display_version() {
  printf("eraseall"
         " "
         "0.1.0"
         "\n"
         "\n"
         "Copyright (C) 2000 Arcom Control Systems Ltd\n"
         "\n"
         "eraseall"
         " comes with NO WARRANTY\n"
         "to the extent permitted by law.\n"
         "\n"
         "You may redistribute copies of "
         "eraseall"
         "\n"
         "under the terms of the GNU General Public Licence.\n"
         "See the file `COPYING' for more information.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<display_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<display_version>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [264 x i8] c"eraseall 0.1.0\0A\0ACopyright (C) 2000 Arcom Control Systems Ltd\0A\0Aeraseall comes with NO WARRANTY\0Ato the extent permitted by law.\0A\0AYou may redistribute copies of eraseall\0Aunder the terms of the GNU General Public Licence.\0ASee the file `COPYING' for more information.\0A\00"
define void @display_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([264 x i8], [264 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [263 x i8] c"eraseall 0.1.0\0A\0ACopyright (C) 2000 Arcom Control Systems Ltd\0A\0Aeraseall comes with NO WARRANTY\0Ato the extent permitted by law.\0A\0AYou may redistribute copies of eraseall\0Aunder the terms of the GNU General Public Licence.\0ASee the file `COPYING' for more information.\00"
define void @display_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([263 x i8], [263 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void seq_garbage_collection_multi(struct sequences_multi_s *seq_info,
                                  int nr_alphabets) {}


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

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

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

LLVM IR (-O2):
%struct.sequences_multi_s = type opaque
define void @seq_garbage_collection_multi(%struct.sequences_multi_s* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
float min(double, double);
float blend_color_burn(float A, float B) {
  return (B > 0.0) ? 1.0 - min(1.0, (1.0 - A) / B) : 0.0;
}


x86 assembly (clang, -O0):
<blend_color_burn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1181 <blend_color_burn+0x71>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb7(%rip),%xmm1
subsd  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  %xmm0,%xmm1
movsd  0xe9e(%rip),%xmm0
call   1030 <min@plt>
cvtss2sd %xmm0,%xmm1
movsd  0xe8d(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    118e <blend_color_burn+0x7e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    118e <blend_color_burn+0x7e>
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blend_color_burn>:
movaps %xmm0,%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jbe    1151 <blend_color_burn+0x41>
push   %rax
cvtss2sd %xmm1,%xmm3
cvtss2sd %xmm2,%xmm2
movsd  0xed4(%rip),%xmm0
movapd %xmm0,%xmm1
subsd  %xmm2,%xmm1
divsd  %xmm3,%xmm1
call   1030 <min@plt>
movapd %xmm0,%xmm1
movss  0xebf(%rip),%xmm0
subss  %xmm1,%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
define float @blend_color_burn(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = fpext float %5 to double
%7 = fcmp ogt double %6, 0.000000e+00
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fsub double 1.000000e+00, %10
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = fdiv double %11, %13
%15 = call float @min(double 1.000000e+00, double %14)
%16 = fpext float %15 to double
%17 = fsub double 1.000000e+00, %16
br label %19
18: ; preds = %2
br label %19
19: ; preds = %18, %8
%20 = phi double [ %17, %8 ], [ 0.000000e+00, %18 ]
%21 = fptrunc double %20 to float
ret float %21
}

LLVM IR (-O2):
define float @blend_color_burn(float %0, float %1) {
%3 = fcmp ogt float %1, 0.000000e+00
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = fpext float %1 to double
%6 = fpext float %0 to double
%7 = fsub double 1.000000e+00, %6
%8 = fdiv double %7, %5
%9 = tail call float @min(double 1.000000e+00, double %8)
%10 = fsub float 1.000000e+00, %9
br label %11
11: ; preds = %2, %4
%12 = phi float [ %10, %4 ], [ 0.000000e+00, %2 ]
ret float %12
}
double test_001(double a, double b, double c) {
  double f;
  double d = (a * b) + 5;
  f = a + (d * c);
  double r = b * b;
  double k = r - f;
  return k * k;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed7(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
movapd %xmm0,%xmm3
mulsd  %xmm1,%xmm3
addsd  0xef0(%rip),%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
mulsd  %xmm1,%xmm1
subsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @test_001(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%11 = load double, double* %4
%12 = load double, double* %5
%13 = call double @llvm.fmuladd.f64(double %11, double %12, double 5.000000e+00)
store double %13, double* %8
%14 = load double, double* %4
%15 = load double, double* %8
%16 = load double, double* %6
%17 = call double @llvm.fmuladd.f64(double %15, double %16, double %14)
store double %17, double* %7
%18 = load double, double* %5
%19 = load double, double* %5
%20 = fmul double %18, %19
store double %20, double* %9
%21 = load double, double* %9
%22 = load double, double* %7
%23 = fsub double %21, %22
store double %23, double* %10
%24 = load double, double* %10
%25 = load double, double* %10
%26 = fmul double %24, %25
ret double %26
}

LLVM IR (-O2):
define double @test_001(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %0, double %1, double 5.000000e+00)
%5 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %0)
%6 = fmul double %1, %1
%7 = fsub double %6, %5
%8 = fmul double %7, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ RETI(int, int);
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_ED_0x5d(void) {
  RETI(4, 7);
  T_WAIT_UNTIL(10);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0x5d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x7,%esi
call   1040 <RETI@plt>
mov    $0xa,%edi
call   1030 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0x5d>:
push   %rax
mov    $0x4,%edi
mov    $0x7,%esi
call   1040 <RETI@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_ED_0x5d() {
%1 = call i32 @RETI(i32 4, i32 7)
%2 = call i32 @T_WAIT_UNTIL(i32 10)
ret void
}

LLVM IR (-O2):
define void @op_ED_0x5d() {
%1 = tail call i32 @RETI(i32 4, i32 7)
%2 = tail call i32 @T_WAIT_UNTIL(i32 10)
ret void
}
void tsv_qtimer_read(struct encode_context *ectxt, struct decode_context *dctxt,
                     const char *format) {}


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

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

LLVM IR (-O0):
%struct.encode_context = type opaque
%struct.decode_context = type opaque
define void @tsv_qtimer_read(%struct.encode_context* %0, %struct.decode_context* %1, i8* %2) {
%4 = alloca %struct.encode_context*
%5 = alloca %struct.decode_context*
%6 = alloca i8*
store %struct.encode_context* %0, %struct.encode_context** %4
store %struct.decode_context* %1, %struct.decode_context** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
%struct.encode_context = type opaque
%struct.decode_context = type opaque
define void @tsv_qtimer_read(%struct.encode_context* nocapture %0, %struct.decode_context* nocapture %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
long long atoll(char *);
char *get_next_arg(int /*<<< orphan*/ *, char *);
long long get_next_argll(va_list *t, char *opt) {
  char *tmp = get_next_arg(t, opt);
  return atoll(tmp);
}


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

x86 assembly (clang, -O2):
<get_next_argll>:
push   %rax
call   1040 <get_next_arg@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <atoll@plt>

LLVM IR (-O0):
define i64 @get_next_argll(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i32*, i32** %3
%7 = load i8*, i8** %4
%8 = call i8* @get_next_arg(i32* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i64 @atoll(i8* %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @get_next_argll(i32* %0, i8* %1) {
%3 = tail call i8* @get_next_arg(i32* %0, i8* %1)
%4 = tail call i64 @atoll(i8* %3)
ret i64 %4
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
bool xstreq(const char *str1, const char *str2) {
  size_t n = strlen(str1);
  if (n != strlen(str2))
    return false;
  if (strncmp(str1, str2, n) != 0)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<xstreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     116a <xstreq+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1198 <xstreq+0x78>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1191 <xstreq+0x71>
movl   $0x0,-0x4(%rbp)
jmp    1198 <xstreq+0x78>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstreq>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rbx
jne    115e <xstreq+0x3e>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @xstreq(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @strncmp(i8* %0, i8* %1, i64 %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ %9, %6 ]
ret i32 %11
}
int Isspace(int ch) {
  return (ch == ' ' || ch == '\t' || ch == 10 || ch == 13);
}


x86 assembly (clang, -O0):
<Isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <Isspace+0x3e>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <Isspace+0x3e>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <Isspace+0x3e>
cmpl   $0xd,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Isspace>:
cmp    $0x20,%edi
ja     111d <Isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    111d <Isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xd,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @Isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 13
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void warn(char *s) { fprintf(stderr, "munpack: warning: %s\n", s); }


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

x86 assembly (clang, -O2):
<warn>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"munpack: warning: %s\0A\00"
define void @warn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"munpack: warning: %s\0A\00"
define void @warn(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int my_atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *ch = "12345";
  int after = 0;
  after = my_atoi(ch);
  printf("%d", after);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <my_atoi@plt>
lea    0xed2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"12345\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @my_atoi(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ write(int, char *, int);
void rawMode(int fd, char *jstring) {
  write(fd, jstring, strlen(jstring));
  usleep((25 + strlen(jstring)) * 100);
}


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

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

LLVM IR (-O0):
define void @rawMode(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = add nsw i32 25, %11
%13 = mul nsw i32 %12, 100
%14 = call i32 @usleep(i32 %13)
ret void
}

LLVM IR (-O2):
define void @rawMode(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
%5 = tail call i32 @strlen(i8* %1)
%6 = mul i32 %5, 100
%7 = add i32 %6, 2500
%8 = tail call i32 @usleep(i32 %7)
ret void
}
long long foo(long long a, char *b, char *c) { return a + *b * *c; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
mov    -0x18(%rbp),%rdx
movsbl (%rdx),%edx
imul   %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movsbq (%rsi),%rcx
movsbq (%rdx),%rax
imul   %rcx,%rax
add    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @foo(i64 %0, i8* nocapture %1, i8* nocapture %2) {
%4 = load i8, i8* %1
%5 = sext i8 %4 to i64
%6 = load i8, i8* %2
%7 = sext i8 %6 to i64
%8 = mul nsw i64 %7, %5
%9 = add nsw i64 %8, %0
ret i64 %9
}
/* Variables and functions */
int chdir(char *);
int set_cwd(char *buf) {
  if (chdir(buf) == -1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<set_cwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <chdir@plt>
cmp    $0xffffffff,%eax
jne    113a <set_cwd+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <set_cwd+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cwd>:
push   %rax
call   1030 <chdir@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @set_cwd(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
%3 = icmp eq i32 %2, -1
%4 = zext i1 %3 to i32
ret i32 %4
}
signed char signedchar_ignoring_unsignedchar(signed char x, unsigned char y) {
  return x;
}


x86 assembly (clang, -O0):
<signedchar_ignoring_unsignedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedchar_ignoring_unsignedchar>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @signedchar_ignoring_unsignedchar(i8 signext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @signedchar_ignoring_unsignedchar(i8 returned signext %0, i8 zeroext %1) {
ret i8 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcsspn(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void uninivar_wcsspn(void) {
  wchar_t *ds;
  wchar_t *ss;
  (void)wcsspn(ds, ss);
}


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

x86 assembly (clang, -O2):
<uninivar_wcsspn>:
jmp    1030 <wcsspn@plt>

LLVM IR (-O0):
define void @uninivar_wcsspn() {
%1 = alloca i32*
%2 = alloca i32*
%3 = load i32*, i32** %1
%4 = load i32*, i32** %2
%5 = call i32 @wcsspn(i32* %3, i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninivar_wcsspn() {
%1 = tail call i32 @wcsspn(i32* undef, i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ butler();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("I will summon the butler function.\n");
  butler();
  printf("Yes. Bring me some tea and writeables DVDs.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"I will summon the butler function.\0A\00"
@.str.1 = [45 x i8] c"Yes. Bring me some tea and writeables DVDs.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @butler()
%4 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [35 x i8] c"I will summon the butler function.\00"
@str.2 = [44 x i8] c"Yes. Bring me some tea and writeables DVDs.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @butler()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
unsigned int _shlmb(unsigned int src1, unsigned int src2) {
  return (src2 << 8) | (src1 >> 24);
}


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

x86 assembly (clang, -O2):
<_shlmb>:
mov    %edi,%eax
shrd   $0x18,%esi,%eax
ret

LLVM IR (-O0):
define i32 @_shlmb(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32, i32* %3
%8 = lshr i32 %7, 24
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @_shlmb(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %1, i32 %0, i32 8)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ time(int);
__attribute__((visibility("hidden"))) void func_0xE0() {
  time(2);
  ;
}


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

x86 assembly (clang, -O2):
<func_0xE0>:
mov    $0x2,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define hidden void @func_0xE0() {
%1 = call i32 @time(i32 2)
ret void
}

LLVM IR (-O2):
define hidden void @func_0xE0() {
%1 = tail call i32 @time(i32 2)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned int avail_out;
  int /*<<< orphan*/ *next_out;
};
typedef TYPE_1__ z_stream;
typedef int /*<<< orphan*/ Bytef;

/* Variables and functions */
void streaming_commons_set_avail_out(z_stream *stream, char *buff,
                                     unsigned int avail) {
  stream->next_out = (Bytef *)buff;
  stream->avail_out = avail;
}


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

x86 assembly (clang, -O2):
<streaming_commons_set_avail_out>:
mov    %rsi,0x8(%rdi)
mov    %edx,(%rdi)
ret

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

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32* }
define void @streaming_commons_set_avail_out(%struct.TYPE_3__* nocapture writeonly %0, i8* %1, i32 %2) {
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%5 = bitcast i32** %4 to i8**
store i8* %1, i8** %5
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
store i32 %2, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int **);
void deleteIterator(int **iter) {
  int i;
  for (i = 0; i < 3; i++) {
    iter[i++] = NULL;
  }
  free(iter);
}


x86 assembly (clang, -O0):
<deleteIterator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1155 <deleteIterator+0x45>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <deleteIterator+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteIterator>:
movq   $0x0,(%rdi)
movq   $0x0,0x10(%rdi)
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @deleteIterator(i32** nocapture %0) {
store i32* null, i32** %0
%2 = getelementptr inbounds i32*, i32** %0, i64 2
store i32* null, i32** %2
%3 = tail call i32 @free(i32** %0)
ret void
}