xunge/DecIR huggingface dataset:
FNIEMOP_DEF(iemOp_Grp7_vmcall) {
  IEMOP_BITCH_ABOUT_STUB();
  return IEMOP_RAISE_INVALID_OPCODE();
}


x86 assembly (clang, -O0):
<FNIEMOP_DEF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <IEMOP_BITCH_ABOUT_STUB@plt>
mov    $0x0,%al
call   1040 <IEMOP_RAISE_INVALID_OPCODE@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @FNIEMOP_DEF(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @IEMOP_BITCH_ABOUT_STUB()
%4 = call i32 (...) @IEMOP_RAISE_INVALID_OPCODE()
ret i32 %4
}

LLVM IR (-O2):
define i32 @FNIEMOP_DEF(i32 %0) {
%2 = tail call i32 (...) @IEMOP_BITCH_ABOUT_STUB()
%3 = tail call i32 (...) @IEMOP_RAISE_INVALID_OPCODE()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char const *, char *);
int /*<<< orphan*/ warn(char *);
void format_warn(const char msg[], char arg[]) {
  char warn_msg[2048];
  (void)sprintf(warn_msg, msg, arg);
  warn(warn_msg);
}


x86 assembly (clang, -O0):
<format_warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <sprintf@plt>
lea    -0x810(%rbp),%rdi
call   1030 <warn@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_warn>:
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <warn@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @format_warn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2048 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* %7, i8* %8)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%11 = call i32 @warn(i8* %10)
ret void
}

LLVM IR (-O2):
define void @format_warn(i8* nocapture %0, i8* %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, i8* %1)
%6 = call i32 @warn(i8* %4)
ret void
}
/* Variables and functions */
int abs(unsigned int);
int /*<<< orphan*/ printf(char *, int);
void cursor_down(unsigned int lines) { printf("\e[%uB", abs(lines)); }


x86 assembly (clang, -O0):
<cursor_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cursor_down>:
mov    %edi,%esi
neg    %esi
cmovs  %edi,%esi
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%uB\00"
define void @cursor_down(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
char EOF;
int test_eof(char a) {
  if (a == EOF)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<test_eof>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    0x2ed3(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    112c <test_eof+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1133 <test_eof+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_eof>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
cmp    %dil,(%rcx)
sete   %al
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @test_eof(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = load i8, i8* @EOF
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %5, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @test_eof(i8 signext %0) {
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
int PKITP_SYM_ExportProtectedKey() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PKITP_SYM_ExportProtectedKey() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FastIntRem(int, int, int *);
int quickModulo(int a, int b) {
  int ret;
  FastIntRem(a, b, &ret);
  return ret;
}


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

x86 assembly (clang, -O2):
<quickModulo>:
push   %rax
lea    0x4(%rsp),%rdx
call   1030 <FastIntRem@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @quickModulo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @FastIntRem(i32 %0, i32 %1, i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}
/* Variables and functions */
int f(int);
int g(int a) {
  if (a % 2 == 0) {
    return f(a / 2);
  } else {
    return f(a) / 2;
  }
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1149 <g+0x39>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
jmp    115c <g+0x4c>
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
test   $0x1,%dil
jne    1126 <g+0x16>
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
mov    %eax,%edi
jmp    1030 <f@plt>
push   %rax
call   1030 <f@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = sdiv i32 %0, 2
%6 = tail call i32 @f(i32 %5)
br label %10
7: ; preds = %1
%8 = tail call i32 @f(i32 %0)
%9 = sdiv i32 %8, 2
br label %10
10: ; preds = %7, %4
%11 = phi i32 [ %6, %4 ], [ %9, %7 ]
ret i32 %11
}
int g(double aaa, double bbb) {
  int xa = !__builtin_isunordered(aaa, bbb);
  int xb = !__builtin_isunordered(bbb, bbb);
  return xa & xb;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
and    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setnp  %al
ret

LLVM IR (-O0):
define i32 @g(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fcmp uno double %7, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
store i32 %11, i32* %5
%12 = load double, double* %4
%13 = load double, double* %4
%14 = fcmp uno double %12, %13
%15 = xor i1 %14, true
%16 = zext i1 %15 to i32
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = and i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @g(double %0, double %1) {
%3 = fcmp ord double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t soft_timer_min_to_ticks(int32_t min) { return (min * 60 * 32768); }


x86 assembly (clang, -O0):
<soft_timer_min_to_ticks>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3c,-0x4(%rbp),%eax
shl    $0xf,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soft_timer_min_to_ticks>:
imul   $0x1e0000,%edi,%eax
ret

LLVM IR (-O0):
define i32 @soft_timer_min_to_ticks(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 60
%5 = mul nsw i32 %4, 32768
ret i32 %5
}

LLVM IR (-O2):
define i32 @soft_timer_min_to_ticks(i32 %0) {
%2 = mul i32 %0, 1966080
ret i32 %2
}
char *toupper(char *contig) {
  long int i = 0;
  char c;
  while (contig[i]) {
    c = contig[i];
    contig[i] = toupper(c);
    i++;
  }
  return contig;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116c <toupper+0x5c>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbq -0x11(%rbp),%rdi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <toupper+0x14>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     114b <toupper+0x3b>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbq %al,%r15
mov    %r15,%rdi
call   1030 <toupper@plt>
mov    %r15b,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <toupper+0x20>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @toupper(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i8* [ %12, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i8* @toupper(i8* %9)
store i8 %5, i8* %6
%11 = add nuw nsw i64 %7, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
ret i8* %0
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ SOMAXCONN;
int bind(int const, struct sockaddr const *const, int /*<<< orphan*/ const);
int listen(int const, int /*<<< orphan*/);
int socket_bind_and_listen(int const sfd, const struct sockaddr *const addr,
                           socklen_t const addrlen) {
  int ret = bind(sfd, addr, addrlen);
  if (!ret)
    ret = listen(sfd, SOMAXCONN);
  return ret;
}


x86 assembly (clang, -O0):
<socket_bind_and_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <bind@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1162 <socket_bind_and_listen+0x42>
mov    -0x4(%rbp),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
call   1030 <listen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_bind_and_listen>:
push   %rbx
mov    %edi,%ebx
call   1040 <bind@plt>
test   %eax,%eax
je     112e <socket_bind_and_listen+0xe>
pop    %rbx
ret
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1030 <listen@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@SOMAXCONN = global i32 0
define i32 @socket_bind_and_listen(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load %struct.sockaddr*, %struct.sockaddr** %5
%10 = load i32, i32* %6
%11 = call i32 @bind(i32 %8, %struct.sockaddr* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %3
%15 = load i32, i32* %4
%16 = load i32, i32* @SOMAXCONN
%17 = call i32 @listen(i32 %15, i32 %16)
store i32 %17, i32* %7
br label %18
18: ; preds = %14, %3
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@SOMAXCONN = global i32 0
define i32 @socket_bind_and_listen(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* @SOMAXCONN
%8 = tail call i32 @listen(i32 %0, i32 %7)
br label %9
9: ; preds = %6, %3
%10 = phi i32 [ %4, %3 ], [ %8, %6 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Liangming Chen\n");
  printf("Liangming\nChen\n");
  printf("Liangming ");
  printf("Chen\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Liangming Chen\0A\00"
@.str.1 = [16 x i8] c"Liangming\0AChen\0A\00"
@.str.2 = [11 x i8] c"Liangming \00"
@.str.3 = [6 x i8] c"Chen\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [11 x i8] c"Liangming \00"
@str = [15 x i8] c"Liangming Chen\00"
@str.4 = [15 x i8] c"Liangming\0AChen\00"
@str.5 = [5 x i8] c"Chen\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
int buffer_size(char *sbuff, char *start) { return (sbuff - start); }


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

x86 assembly (clang, -O2):
<buffer_size>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @buffer_size(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 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @buffer_size(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
char *extGetEtherAdd(void) { return (0); }


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

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

LLVM IR (-O0):
define i8* @extGetEtherAdd() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @extGetEtherAdd() {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int sigprocmask(int how, const sigset_t *__restrict set,
                sigset_t *__restrict oset) {
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @sigprocmask(i32 %0, i32* noalias %1, i32* noalias %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @sigprocmask(i32 %0, i32* noalias nocapture readnone %1, i32* noalias nocapture readnone %2) {
ret i32 -1
}
void xenbus_backend_resume(int (*fn)(struct device *, void *)) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @xenbus_backend_resume(i32 (%struct.device*, i8*)* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ pop();
void clear_stack(void) {
  while (pop())
    ;
}


x86 assembly (clang, -O0):
<clear_stack>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <clear_stack+0x9>
mov    $0x0,%al
call   1030 <pop@plt>
cmp    $0x0,%rax
je     112f <clear_stack+0x1f>
jmp    1119 <clear_stack+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_stack>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <pop@plt>
test   %rax,%rax
jne    1120 <clear_stack+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @clear_stack() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @pop()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @clear_stack() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @pop()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stuff();
void bar() { stuff(); }


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

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

LLVM IR (-O0):
define void @bar() {
%1 = call i32 (...) @stuff()
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i32 (...) @stuff()
ret void
}
int FileString_GetExtension(char *str) {
  int dotPos = -1;
  char *strSrc = str;
  while (*strSrc) {
    if (*strSrc == '.')
      dotPos = (int)(strSrc - str);
    *strSrc++;
  }
  return dotPos;
}


x86 assembly (clang, -O0):
<FileString_GetExtension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <FileString_GetExtension+0x53>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1142 <FileString_GetExtension+0x42>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <FileString_GetExtension+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileString_GetExtension>:
mov    $0xffffffff,%eax
xor    %ecx,%ecx
jmp    1116 <FileString_GetExtension+0x16>
nopl   0x0(%rax)
mov    %ecx,%eax
add    $0x1,%rcx
movzbl (%rdi,%rcx,1),%edx
cmp    $0x2e,%dl
je     1110 <FileString_GetExtension+0x10>
test   %dl,%dl
jne    1112 <FileString_GetExtension+0x12>
ret

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

LLVM IR (-O2):
define i32 @FileString_GetExtension(i8* %0) {
%2 = ptrtoint i8* %0 to i64
br label %3
3: ; preds = %11, %1
%4 = phi i32 [ -1, %1 ], [ %12, %11 ]
%5 = phi i8* [ %0, %1 ], [ %13, %11 ]
%6 = load i8, i8* %5
switch i8 %6, label %11 [
i8 0, label %14
i8 46, label %7
]
7: ; preds = %3
%8 = ptrtoint i8* %5 to i64
%9 = sub i64 %8, %2
%10 = trunc i64 %9 to i32
br label %11
11: ; preds = %3, %7
%12 = phi i32 [ %10, %7 ], [ %4, %3 ]
%13 = getelementptr inbounds i8, i8* %5, i64 1
br label %3
14: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int strlen(char *);
int strncmp(char *, char *, int);
int sc(char *cp, char *ccp, int bufsiz) {
  int s = strlen(ccp);
  if (s > bufsiz)
    s = bufsiz;
  return (strncmp(cp, ccp, s));
}


x86 assembly (clang, -O0):
<sc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1151 <sc+0x31>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1030 <strncmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <strlen@plt>
cmp    %ebx,%eax
cmovle %eax,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @sc(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp sgt i32 %4, %2
%6 = select i1 %5, i32 %2, i32 %4
%7 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %6)
ret i32 %7
}
unsigned xrop3_12_0_0(unsigned char s, unsigned char t) {
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~T;
  stk1 = S & stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_12_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_12_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
not    %eax
and    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_12_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %5
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %6
%21 = load i32, i32* %6
%22 = xor i32 %21, -1
store i32 %22, i32* %8
%23 = load i32, i32* %5
%24 = load i32, i32* %8
%25 = and i32 %23, %24
store i32 %25, i32* %7
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @xrop3_12_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -1
%8 = and i32 %4, %7
ret i32 %8
}
void Render_PutBorderNULL(int HorizontalCount, int Line) {}


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

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

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

LLVM IR (-O2):
define void @Render_PutBorderNULL(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER;

/* Variables and functions */
int EVP_CIPHER_iv_length(int /*<<< orphan*/ const *);
int tnt_EVP_CIPHER_iv_length(const EVP_CIPHER *cipher) {
  return EVP_CIPHER_iv_length(cipher);
}


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

x86 assembly (clang, -O2):
<tnt_EVP_CIPHER_iv_length>:
jmp    1030 <EVP_CIPHER_iv_length@plt>

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

LLVM IR (-O2):
define i32 @tnt_EVP_CIPHER_iv_length(i32* %0) {
%2 = tail call i32 @EVP_CIPHER_iv_length(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ message_reader_read_uint32();
float message_reader_read_float() {
  uint32_t d = message_reader_read_uint32();
  return *(float *)(void *)(&d);
}


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

x86 assembly (clang, -O2):
<message_reader_read_float>:
push   %rax
xor    %eax,%eax
call   1030 <message_reader_read_uint32@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @message_reader_read_float() {
%1 = alloca i32
%2 = call i32 (...) @message_reader_read_uint32()
store i32 %2, i32* %1
%3 = bitcast i32* %1 to i8*
%4 = bitcast i8* %3 to float*
%5 = load float, float* %4
ret float %5
}

LLVM IR (-O2):
define float @message_reader_read_float() {
%1 = tail call i32 (...) @message_reader_read_uint32()
%2 = bitcast i32 %1 to float
ret float %2
}
/* Variables and functions */
char *CG_ConfigString(int);
int /*<<< orphan*/ CG_NewClientInfo(int);
void CG_ForceModelChange(void) {
  int i;
  for (i = 0; i < 64; i++) {
    const char *clientInfo;
    clientInfo = CG_ConfigString(((64 + 256) + 256) + i);
    if (!clientInfo[0]) {
      continue;
    }
    CG_NewClientInfo(i);
  }
}


x86 assembly (clang, -O0):
<CG_ForceModelChange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jge    1173 <CG_ForceModelChange+0x53>
mov    -0x4(%rbp),%edi
add    $0x240,%edi
call   1040 <CG_ConfigString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    115d <CG_ForceModelChange+0x3d>
jmp    1165 <CG_ForceModelChange+0x45>
mov    -0x4(%rbp),%edi
call   1030 <CG_NewClientInfo@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <CG_ForceModelChange+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_ForceModelChange>:
push   %rbx
xor    %ebx,%ebx
jmp    1138 <CG_ForceModelChange+0x18>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
cmp    $0x40,%ebx
je     1151 <CG_ForceModelChange+0x31>
lea    0x240(%rbx),%edi
call   1040 <CG_ConfigString@plt>
cmpb   $0x0,(%rax)
je     1130 <CG_ForceModelChange+0x10>
mov    %ebx,%edi
call   1030 <CG_NewClientInfo@plt>
jmp    1130 <CG_ForceModelChange+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @CG_ForceModelChange() {
br label %1
1: ; preds = %0, %9
%2 = phi i32 [ 0, %0 ], [ %10, %9 ]
%3 = add nuw nsw i32 %2, 576
%4 = tail call i8* @CG_ConfigString(i32 %3)
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @CG_NewClientInfo(i32 %2)
br label %9
9: ; preds = %1, %7
%10 = add nuw nsw i32 %2, 1
%11 = icmp eq i32 %10, 64
br i1 %11, label %12, label %1
12: ; preds = %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello RT-Thread\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Hello RT-Thread\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"Hello RT-Thread\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int is_valid(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d\n", is_valid(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <is_valid@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <is_valid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @is_valid(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int test4(int x) { return x / -10 == 2; }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffff6,%ecx
cltd
idiv   %ecx
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
add    $0x1d,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @test4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, -10
%5 = icmp eq i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test4(i32 %0) {
%2 = add i32 %0, 29
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ randr(int /*<<< orphan*/, int);
float rand01(void) {
  float r = (float)randr(0, 99999) / (float)100000;
  assert(r >= 0.f);
  assert(r < 1.f);
  return r;
}


x86 assembly (clang, -O0):
<rand01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x1869f,%esi
call   1030 <randr@plt>
cvtsi2ss %rax,%xmm0
movss  0xec3(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movss  0xe96(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand01>:
push   %rax
xor    %edi,%edi
mov    $0x1869f,%esi
call   1030 <randr@plt>
cvtsi2ss %rax,%xmm1
divss  0xec6(%rip),%xmm1
movss  %xmm1,0x4(%rsp)
xorps  %xmm0,%xmm0
xor    %edi,%edi
ucomiss %xmm0,%xmm1
setae  %dil
call   1040 <assert@plt>
movss  0xeab(%rip),%xmm0
xor    %edi,%edi
ucomiss 0x4(%rsp),%xmm0
seta   %dil
call   1040 <assert@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rand01() {
%1 = alloca float
%2 = call i64 @randr(i32 0, i32 99999)
%3 = sitofp i64 %2 to float
%4 = fdiv float %3, 1.000000e+05
store float %4, float* %1
%5 = load float, float* %1
%6 = fcmp oge float %5, 0.000000e+00
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load float, float* %1
%10 = fcmp olt float %9, 1.000000e+00
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load float, float* %1
ret float %13
}

LLVM IR (-O2):
define float @rand01() {
%1 = tail call i64 @randr(i32 0, i32 99999)
%2 = sitofp i64 %1 to float
%3 = fdiv float %2, 1.000000e+05
%4 = fcmp oge float %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = fcmp olt float %3, 1.000000e+00
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret float %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int p64(int);
uint64_t em64(uint64_t k, uint64_t p) { return p64(k ^ p) ^ k; }


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

x86 assembly (clang, -O2):
<em64>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%esi
mov    %esi,%edi
call   1030 <p64@plt>
xor    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @em64(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 = xor i32 %5, %6
%8 = call i32 @p64(i32 %7)
%9 = load i32, i32* %3
%10 = xor i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @em64(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = tail call i32 @p64(i32 %3)
%5 = xor i32 %4, %0
ret i32 %5
}
/* Type definitions */
struct b_tonegen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setMIDIDrawBar(struct b_tonegen *, int, unsigned char);
void setDrawbar1(void *d, unsigned char v) {
  setMIDIDrawBar((struct b_tonegen *)d, 1, v);
}


x86 assembly (clang, -O0):
<setDrawbar1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
movzbl -0x9(%rbp),%edx
call   1030 <setMIDIDrawBar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDrawbar1>:
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <setMIDIDrawBar@plt>

LLVM IR (-O0):
%struct.b_tonegen = type { i32 }
define void @setDrawbar1(i8* %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
%6 = bitcast i8* %5 to %struct.b_tonegen*
%7 = load i8, i8* %4
%8 = call i32 @setMIDIDrawBar(%struct.b_tonegen* %6, i32 1, i8 zeroext %7)
ret void
}

LLVM IR (-O2):
%struct.b_tonegen = type { i32 }
define void @setDrawbar1(i8* %0, i8 zeroext %1) {
%3 = bitcast i8* %0 to %struct.b_tonegen*
%4 = tail call i32 @setMIDIDrawBar(%struct.b_tonegen* %3, i32 1, i8 zeroext %1)
ret void
}
int segv(int n) { return n * segv(n - 1); }


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

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

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

LLVM IR (-O2):
define i32 @segv(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
__attribute__((always_)) void copy_to_user_page(struct vm_area_struct *vma,
                                                struct page *page,
                                                unsigned long vaddr, void *dst,
                                                const void *src,
                                                unsigned long len) {
  __builtin_memcpy(dst, src, len);
}


x86 assembly (clang, -O0):
<copy_to_user_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_to_user_page>:
mov    %r9,%rdx
mov    %r8,%rsi
mov    %rcx,%rdi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
%struct.vm_area_struct = type opaque
%struct.page = type opaque
define void @copy_to_user_page(%struct.vm_area_struct* %0, %struct.page* %1, i64 %2, i8* %3, i8* %4, i64 %5) {
%7 = alloca %struct.vm_area_struct*
%8 = alloca %struct.page*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i64
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %7
store %struct.page* %1, %struct.page** %8
store i64 %2, i64* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i64 %5, i64* %12
%13 = load i8*, i8** %10
%14 = load i8*, i8** %11
%15 = load i64, i64* %12
ret void
}

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
%struct.page = type opaque
define void @copy_to_user_page(%struct.vm_area_struct* nocapture readnone %0, %struct.page* nocapture readnone %1, i64 %2, i8* nocapture writeonly %3, i8* nocapture %4, i64 %5) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %3, i8* align 1 %4, i64 %5, i1 false)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_WAITING(int /*<<< orphan*/);
int gen_WAITING() { handle_WAITING(0); }


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

x86 assembly (clang, -O2):
<gen_WAITING>:
xor    %edi,%edi
jmp    1030 <handle_WAITING@plt>

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

LLVM IR (-O2):
define i32 @gen_WAITING() {
%1 = tail call i32 @handle_WAITING(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char a[101];
  int i;
  for (i = 0; i < 101; i++) {
    scanf("%c", &a[i]);
    printf("%c", a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x74(%rbp)
cmpl   $0x65,-0x74(%rbp)
jge    117d <main+0x5d>
movslq -0x74(%rbp),%rax
lea    -0x70(%rbp),%rsi
add    %rax,%rsi
lea    0xeab(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x74(%rbp),%rax
lea    0xe9b(%rip),%rdi
movsbl -0x70(%rbp,%rax,1),%esi
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
xor    %ebx,%ebx
lea    0xed0(%rip),%r14
lea    (%rsp,%rbx,1),%rsi
mov    %r14,%rdi
call   1040 <scanf@plt>
movsbl (%rsp,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x65,%rbx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [101 x i8]
%2 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %9, %3 ]
%5 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 %4
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8, i8* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 101
br i1 %10, label %11, label %3
11: ; preds = %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ smm_free(void *);
int csc_cli_getopt_close(void *clibuf) {
  smm_free(clibuf);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @csc_cli_getopt_close(i8* %0) {
%2 = tail call i32 @smm_free(i8* %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ perror(char *);
FILE *open_file(const char *path) {
  FILE *file;
  file = fopen(path, "w");
  if (file == NULL) {
    perror("Could not Open Log File");
    exit(1);
  }
  return file;
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <open_file+0x41>
lea    0xea0(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rax
lea    0xec8(%rip),%rsi
call   1030 <fopen@plt>
test   %rax,%rax
je     1144 <open_file+0x14>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [24 x i8] c"Could not Open Log File\00"
define i32* @open_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [24 x i8] c"Could not Open Log File\00"
define noalias i32* @open_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i32* %2
}