xunge/DecIR huggingface dataset:
/* Variables and functions */
void Reserved_Handler21(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @Reserved_Handler21() {
br label %1
1: ; preds = %0, %1
br label %1
}
double calc_force(double mass, double acceleration) {
  return mass * acceleration;
}


x86 assembly (clang, -O0):
<calc_force>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_force>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calc_force(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @calc_force(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
void rop3_223_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_223_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_223_1_1>:
mov    (%rdi),%al
mov    %eax,%ecx
and    %dl,%cl
or     %sil,%dl
not    %dl
and    %sil,%al
or     %dl,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_223_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_223_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %2
%6 = or i8 %2, %1
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
%10 = or i8 %9, %5
store i8 %10, i8* %0
ret void
}
void i2d_OCSP_SINGLERESP(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_OCSP_SINGLERESP() {
ret void
}
int do_941() { return 941; }


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

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

LLVM IR (-O0):
define i32 @do_941() {
ret i32 941
}

LLVM IR (-O2):
define i32 @do_941() {
ret i32 941
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void available_part_types() {
  printf("Available partition types:\n");
  printf("-HFS+\n");
  printf("-LinuxData\n");
  printf("-Disabled\n");
  printf("\nNew types may be added soon.\n");
}


x86 assembly (clang, -O0):
<available_part_types>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<available_part_types>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Available partition types:\0A\00"
@.str.1 = [7 x i8] c"-HFS+\0A\00"
@.str.2 = [12 x i8] c"-LinuxData\0A\00"
@.str.3 = [11 x i8] c"-Disabled\0A\00"
@.str.4 = [31 x i8] c"\0ANew types may be added soon.\0A\00"
define void @available_part_types() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Available partition types:\00"
@str.5 = [6 x i8] c"-HFS+\00"
@str.6 = [11 x i8] c"-LinuxData\00"
@str.7 = [10 x i8] c"-Disabled\00"
@str.8 = [30 x i8] c"\0ANew types may be added soon.\00"
define void @available_part_types() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ blk_oversized_queue_2(int *);
int __attribute__((no)) get_request_2(int *q, int rw) {
  if (blk_oversized_queue_2(q)) {
    if ((rw == 1) || (rw == 0))
      return -33;
    return 0;
  }
  return -100;
}


x86 assembly (clang, -O0):
<get_request_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <blk_oversized_queue_2@plt>
cmp    $0x0,%rax
je     115e <get_request_2+0x4e>
cmpl   $0x1,-0x14(%rbp)
je     1146 <get_request_2+0x36>
cmpl   $0x0,-0x14(%rbp)
jne    1152 <get_request_2+0x42>
movl   $0xffffffdf,-0x4(%rbp)
jmp    1165 <get_request_2+0x55>
movl   $0x0,-0x4(%rbp)
jmp    1165 <get_request_2+0x55>
movl   $0xffffff9c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_request_2>:
push   %rbx
mov    %esi,%ebx
call   1030 <blk_oversized_queue_2@plt>
xor    %ecx,%ecx
cmp    $0x2,%ebx
mov    $0xffffffdf,%edx
cmovae %ecx,%edx
test   %rax,%rax
mov    $0xffffff9c,%eax
cmovne %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_request_2(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = call i64 @blk_oversized_queue_2(i32* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 1
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12, %9
store i32 -33, i32* %3
br label %18
16: ; preds = %12
store i32 0, i32* %3
br label %18
17: ; preds = %2
store i32 -100, i32* %3
br label %18
18: ; preds = %17, %16, %15
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @get_request_2(i32* %0, i32 %1) {
%3 = tail call i64 @blk_oversized_queue_2(i32* %0)
%4 = icmp eq i64 %3, 0
%5 = icmp ult i32 %1, 2
%6 = select i1 %5, i32 -33, i32 0
%7 = select i1 %4, i32 -100, i32 %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
char *conv32network_endian(uint32_t *buf, size_t n) {
  size_t i;
  for (i = 0; i < n; i++) {
    buf[i] = htonl(buf[i]);
  }
  return (char *)buf;
}


x86 assembly (clang, -O0):
<conv32network_endian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1164 <conv32network_endian+0x54>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <htonl@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <conv32network_endian+0x18>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv32network_endian>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
test   %rsi,%rsi
je     1146 <conv32network_endian+0x36>
mov    %rsi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,4),%edi
call   1030 <htonl@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <conv32network_endian+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @conv32network_endian(i32* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @htonl(i32 %7)
store i32 %8, i32* %6
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = bitcast i32* %0 to i8*
ret i8* %12
}
/* Variables and functions */
void *bm(size_t);
void *b3(size_t n) { return bm(n); }


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

x86 assembly (clang, -O2):
<b3>:
jmp    1030 <bm@plt>

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

LLVM IR (-O2):
define i8* @b3(i64 %0) {
%2 = tail call i8* @bm(i64 %0)
ret i8* %2
}
long long C_Utils_max_longlong(const long long item1, const long long item2) {
  return item1 > item2 ? item1 : item2;
}


x86 assembly (clang, -O0):
<C_Utils_max_longlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <C_Utils_max_longlong+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <C_Utils_max_longlong+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Utils_max_longlong>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @C_Utils_max_longlong(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int cuftpd_create_srv();
int /*<<< orphan*/ cuftpd_do_loop(int);
int /*<<< orphan*/ cuftpd_init();
int /*<<< orphan*/ cuftpd_parse_args(int, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int listenfd;
  cuftpd_parse_args(argc, argv);
  cuftpd_init();
  listenfd = cuftpd_create_srv();
  if (listenfd >= 0)
    cuftpd_do_loop(listenfd);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <cuftpd_parse_args@plt>
mov    $0x0,%al
call   1050 <cuftpd_init@plt>
mov    $0x0,%al
call   1040 <cuftpd_create_srv@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1195 <main+0x45>
mov    -0x14(%rbp),%edi
call   1060 <cuftpd_do_loop@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <cuftpd_parse_args@plt>
xor    %eax,%eax
call   1050 <cuftpd_init@plt>
xor    %eax,%eax
call   1040 <cuftpd_create_srv@plt>
test   %eax,%eax
js     116f <main+0x1f>
mov    %eax,%edi
call   1060 <cuftpd_do_loop@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @cuftpd_parse_args(i32 %7, i8** %8)
%10 = call i32 (...) @cuftpd_init()
%11 = call i32 (...) @cuftpd_create_srv()
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i32, i32* %6
%16 = call i32 @cuftpd_do_loop(i32 %15)
br label %17
17: ; preds = %14, %2
%18 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @cuftpd_parse_args(i32 %0, i8** %1)
%4 = tail call i32 (...) @cuftpd_init()
%5 = tail call i32 (...) @cuftpd_create_srv()
%6 = icmp sgt i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @cuftpd_do_loop(i32 %5)
br label %9
9: ; preds = %7, %2
%10 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_sub_si64(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_sub_si64(__m64 a, __m64 b) { return _mm_sub_si64(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_sub_si64>:
jmp    1030 <_mm_sub_si64@plt>

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

LLVM IR (-O2):
define i32 @test_mm_sub_si64(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sub_si64(i32 %0, i32 %1)
ret i32 %3
}
void pbl_LongToBuf(unsigned char *buf, long l) {
  *buf++ = (unsigned char)((l >> 24));
  *buf++ = (unsigned char)((l >> 16));
  *buf++ = (unsigned char)((l >> 8));
  *buf = (unsigned char)(l);
}


x86 assembly (clang, -O0):
<pbl_LongToBuf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x18,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
sar    $0x10,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
sar    $0x8,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbl_LongToBuf>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @pbl_LongToBuf(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = ashr i64 %5, 24
%7 = trunc i64 %6 to i8
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
store i8 %7, i8* %8
%10 = load i64, i64* %4
%11 = ashr i64 %10, 16
%12 = trunc i64 %11 to i8
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
store i8 %12, i8* %13
%15 = load i64, i64* %4
%16 = ashr i64 %15, 8
%17 = trunc i64 %16 to i8
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
store i8 %17, i8* %18
%20 = load i64, i64* %4
%21 = trunc i64 %20 to i8
%22 = load i8*, i8** %3
store i8 %21, i8* %22
ret void
}

LLVM IR (-O2):
define void @pbl_LongToBuf(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = trunc i64 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %0
%6 = lshr i64 %1, 16
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %5
%9 = lshr i64 %1, 8
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %10, i8* %8
%12 = trunc i64 %1 to i8
store i8 %12, i8* %11
ret void
}
double sin_integ2(const double kr, const double sinkr, const double coskr) {
  return (2.0 - kr * kr) * coskr + 2.0 * kr * sinkr;
}


x86 assembly (clang, -O0):
<sin_integ2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xec0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  0xeaf(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @sin_integ2(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fneg double %7
%10 = call double @llvm.fmuladd.f64(double %9, double %8, double 2.000000e+00)
%11 = load double, double* %6
%12 = load double, double* %4
%13 = fmul double 2.000000e+00, %12
%14 = load double, double* %5
%15 = fmul double %13, %14
%16 = call double @llvm.fmuladd.f64(double %10, double %11, double %15)
ret double %16
}

LLVM IR (-O2):
define double @sin_integ2(double %0, double %1, double %2) {
%4 = fneg double %0
%5 = tail call double @llvm.fmuladd.f64(double %4, double %0, double 2.000000e+00)
%6 = fmul double %0, 2.000000e+00
%7 = fmul double %6, %1
%8 = tail call double @llvm.fmuladd.f64(double %5, double %2, double %7)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int debug() { syscall(98, 0, 0); }


x86 assembly (clang, -O0):
<debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x62,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <syscall@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug>:
mov    $0x62,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @debug() {
%1 = alloca i32
%2 = call i32 @syscall(i32 98, i32 0, i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @debug() {
%1 = tail call i32 @syscall(i32 98, i32 0, i32 0)
ret i32 undef
}
char *path_to_url(char *path) {
  int i;
  i = 0;
  while (path[i] != 0) {
    if (path[i] == '\\') {
      path[i] = '/';
    }
    i++;
  }
  return (path);
}


x86 assembly (clang, -O0):
<path_to_url>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1153 <path_to_url+0x53>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5c,%eax
jne    1145 <path_to_url+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x2f,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <path_to_url+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_to_url>:
mov    %rdi,%rax
mov    %rdi,%rcx
jmp    1117 <path_to_url+0x17>
nopl   0x0(%rax,%rax,1)
movb   $0x2f,(%rcx)
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x5c,%dl
je     1110 <path_to_url+0x10>
test   %dl,%dl
jne    1113 <path_to_url+0x13>
ret

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

LLVM IR (-O2):
define i8* @path_to_url(i8* returned %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i64 [ %8, %7 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 92, label %6
]
6: ; preds = %2
store i8 47, i8* %4
br label %7
7: ; preds = %2, %6
%8 = add nuw i64 %3, 1
br label %2
9: ; preds = %2
ret i8* %0
}
/* Variables and functions */
void ezcu_load(char const *, char const *);
int /*<<< orphan*/ printf(char *, char const *, char const *);
void ezcu_load_fort(const char *filename, const char *options_format) {
  printf("filename '%s' options '%s'\n", filename, options_format);
  return ezcu_load(filename, options_format);
}


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

x86 assembly (clang, -O2):
<ezcu_load_fort>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ezcu_load@plt>

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

LLVM IR (-O2):
@.str = [28 x i8] c"filename '%s' options '%s'\0A\00"
define void @ezcu_load_fort(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
tail call void @ezcu_load(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
bool foo() { return true; }


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

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_groovy_comments() {
  test_parser_verify_parse(test_parser_sourcefile("groovy", " //comment"),
                           "groovy", "", "//comment", 0);
}


x86 assembly (clang, -O0):
<test_groovy_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xeca(%rip),%rdx
lea    0xeba(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_groovy_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xed3(%rip),%rdx
lea    0xec3(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"groovy\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_groovy_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"groovy\00"
@.str.1 = [11 x i8] c" //comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"//comment\00"
define void @test_groovy_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log10(double);
double lua_check_number(int, char *);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void math_log10(void) {
  double d = lua_check_number(1, "log10");
  lua_pushnumber(log10(d));
}


x86 assembly (clang, -O0):
<math_log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    0xebc(%rip),%rsi
call   1030 <lua_check_number@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <log10@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_log10>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
call   1030 <lua_check_number@plt>
call   1050 <log10@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushnumber@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"log10\00"
define void @math_log10() {
%1 = tail call double @lua_check_number(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @log10(double %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
void do_addcnt(char *handle) {}


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

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

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

LLVM IR (-O2):
define void @do_addcnt(i8* nocapture %0) {
ret void
}
void swapChar(char *array, int p1, int p2) {
  char tmp;
  tmp = array[p1];
  array[p1] = array[p2];
  array[p2] = tmp;
}


x86 assembly (clang, -O0):
<swapChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapChar>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%sil
movslq %edx,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %sil,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define void @swapChar(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = load i8*, i8** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
ret void
}

LLVM IR (-O2):
define void @swapChar(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
int math_min(int arg1, int arg2) { return arg1 > arg2 ? arg2 : arg1; }


x86 assembly (clang, -O0):
<math_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <math_min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <math_min+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @math_min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int readmend();
int readmsg(int);
int readstring(char **);
int readmstr(int msg, char **buf) {
  int x;
  x = readmsg(msg);
  if (x == (1))
    x = readstring(buf);
  if (x == (1))
    x = readmend();
  return (x);
}


x86 assembly (clang, -O0):
<readmstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <readmsg@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1160 <readmstr+0x30>
mov    -0x10(%rbp),%rdi
call   1040 <readstring@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1174 <readmstr+0x44>
mov    $0x0,%al
call   1050 <readmend@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readmstr>:
push   %rbx
mov    %rsi,%rbx
call   1030 <readmsg@plt>
cmp    $0x1,%eax
jne    1153 <readmstr+0x23>
mov    %rbx,%rdi
call   1040 <readstring@plt>
cmp    $0x1,%eax
jne    1153 <readmstr+0x23>
xor    %eax,%eax
pop    %rbx
jmp    1050 <readmend@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @readmstr(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = call i32 @readmsg(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8**, i8*** %4
%12 = call i32 @readstring(i8** %11)
store i32 %12, i32* %5
br label %13
13: ; preds = %10, %2
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (...) @readmend()
store i32 %17, i32* %5
br label %18
18: ; preds = %16, %13
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @readmstr(i32 %0, i8** %1) {
%3 = tail call i32 @readmsg(i32 %0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @readstring(i8** %1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (...) @readmend()
br label %10
10: ; preds = %2, %8, %5
%11 = phi i32 [ %9, %8 ], [ %6, %5 ], [ %3, %2 ]
ret i32 %11
}
void PSG_setTone(unsigned char channel, unsigned short value) {
  volatile unsigned char *pb;
  pb = (unsigned char *)0xC00011;
  *pb = 0x80 | ((channel & 3) << 5) | (value & 0xF);
  *pb = (value >> 4) & 0x3F;
}


x86 assembly (clang, -O0):
<PSG_setTone>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    $0xc00011,%eax
mov    %rax,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x3,%eax
shl    $0x5,%eax
or     $0x80,%eax
movzwl -0x4(%rbp),%ecx
and    $0xf,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x4(%rbp),%eax
sar    $0x4,%eax
and    $0x3f,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PSG_setTone>:
shl    $0x5,%dil
mov    %esi,%eax
and    $0xf,%al
or     %dil,%al
or     $0x80,%al
mov    %al,0xc00011
shr    $0x4,%esi
and    $0x3f,%sil
mov    %sil,0xc00011
ret

LLVM IR (-O0):
define void @PSG_setTone(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
%5 = alloca i8*
store i8 %0, i8* %3
store i16 %1, i16* %4
store i8* inttoptr (i64 12582929 to i8*), i8** %5
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = and i32 %7, 3
%9 = shl i32 %8, 5
%10 = or i32 128, %9
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = and i32 %12, 15
%14 = or i32 %10, %13
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %5
store volatile i8 %15, i8* %16
%17 = load i16, i16* %4
%18 = zext i16 %17 to i32
%19 = ashr i32 %18, 4
%20 = and i32 %19, 63
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %5
store volatile i8 %21, i8* %22
ret void
}

LLVM IR (-O2):
define void @PSG_setTone(i8 zeroext %0, i16 zeroext %1) {
%3 = shl i8 %0, 5
%4 = trunc i16 %1 to i8
%5 = and i8 %4, 15
%6 = or i8 %3, %5
%7 = or i8 %6, -128
store volatile i8 %7, i8* inttoptr (i64 12582929 to i8*)
%8 = lshr i16 %1, 4
%9 = trunc i16 %8 to i8
%10 = and i8 %9, 63
store volatile i8 %10, i8* inttoptr (i64 12582929 to i8*)
ret void
}
char *inttoweapon(int x) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @inttoweapon(i32 %0) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N = 0, i = 2;
  scanf(" %d", &N);
  while (i <= N) {
    printf("%d^2 = %d\n", i, i * i);
    i += 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     117d <main+0x5d>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
imul   -0xc(%rbp),%edx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2,0x4(%rsp)
jl     1168 <main+0x48>
mov    $0x2,%ebx
lea    0xeb4(%rip),%r14
mov    %ebx,%edx
imul   %ebx,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x2,%ebx
cmp    0x4(%rsp),%ebx
jle    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
@.str.1 = [11 x i8] c"%d^2 = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 2
br i1 %5, label %13, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ 2, %0 ]
%8 = mul nsw i32 %7, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
%10 = add nuw nsw i32 %7, 2
%11 = load i32, i32* %1
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %6
13: ; preds = %6, %0
ret i32 0
}
unsigned addval_102(unsigned x) { return x + 3224945289U; }


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

x86 assembly (clang, -O2):
<addval_102>:
lea    -0x3fc73d77(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_102(i32 %0) {
%2 = add i32 %0, -1070022007
ret i32 %2
}
/* Variables and functions */
int SIGTERM;
int /*<<< orphan*/ shutdown_routine();
void sigterm_handler(int sig) {
  if (sig == SIGTERM)
    shutdown_routine();
}


x86 assembly (clang, -O0):
<sigterm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1134 <sigterm_handler+0x24>
mov    $0x0,%al
call   1030 <shutdown_routine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigterm_handler>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1122 <sigterm_handler+0x12>
xor    %eax,%eax
jmp    1030 <shutdown_routine@plt>
ret

LLVM IR (-O0):
@SIGTERM = global i32 0
define void @sigterm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGTERM
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @shutdown_routine()
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGTERM = global i32 0
define void @sigterm_handler(i32 %0) {
%2 = load i32, i32* @SIGTERM
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @shutdown_routine()
br label %6
6: ; preds = %4, %1
ret void
}
int iwl_alloc_traffic_mem(struct iwl_priv *priv) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iwl_priv = type opaque
define i32 @iwl_alloc_traffic_mem(%struct.iwl_priv* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(int /*<<< orphan*/ *);
int idhash_fileno(FILE *f) { return fileno(f); }


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

x86 assembly (clang, -O2):
<idhash_fileno>:
jmp    1030 <fileno@plt>

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

LLVM IR (-O2):
define i32 @idhash_fileno(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ lock_demo();
int main() {
  lock_demo();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @lock_demo()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int /*<<< orphan*/ __toupper(int /*<<< orphan*/);
wint_t towupper(wint_t wc) { return (__toupper(wc)); }


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

x86 assembly (clang, -O2):
<towupper>:
jmp    1030 <__toupper@plt>

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

LLVM IR (-O2):
define i32 @towupper(i32 %0) {
%2 = tail call i32 @__toupper(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int a[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf(" %d", a[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" %d\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}