xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ f_data();
int main(int argc, char **argv) {
  f();
  f_data();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @f()
%7 = call i32 (...) @f_data()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @f()
%4 = tail call i32 (...) @f_data()
ret i32 0
}
/* Variables and functions */
char *iconv_from_utf8_to_locale(unsigned char *, char *);
char *degree_sign() {
  unsigned char str[] = {0xc2, 0xb0, 0x00};
  return iconv_from_utf8_to_locale(str, " \0");
}


x86 assembly (clang, -O0):
<degree_sign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xed9(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x3(%rbp),%rdi
lea    0xecc(%rip),%rsi
call   1030 <iconv_from_utf8_to_locale@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<degree_sign>:
push   %rax
movb   $0x0,0x6(%rsp)
movw   $0xb0c2,0x4(%rsp)
lea    0xedf(%rip),%rsi
lea    0x4(%rsp),%rdi
call   1030 <iconv_from_utf8_to_locale@plt>
pop    %rcx
ret

LLVM IR (-O0):
@__const.degree_sign.str = [3 x i8] c"\C2\B0\00"
@.str = [3 x i8] c" \00\00"
define i8* @degree_sign() {
%1 = alloca [3 x i8]
%2 = bitcast [3 x i8]* %1 to i8*
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = call i8* @iconv_from_utf8_to_locale(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@__const.degree_sign.str = [3 x i8] c"\C2\B0\00"
@.str = [3 x i8] c" \00\00"
define i8* @degree_sign() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i8* @iconv_from_utf8_to_locale(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
int strlen(char *);
void encriptar(char *password, int key) {
  for (int cont = 0; cont < strlen(password); cont++)
    password[cont] = password[cont] - key;
}


x86 assembly (clang, -O0):
<encriptar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    116c <encriptar+0x5c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <encriptar+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encriptar>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1147 <encriptar+0x37>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
sub    %r14b,(%rbx,%rbp,1)
add    $0x1,%rbp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbp
jl     1130 <encriptar+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @encriptar(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = trunc i32 %1 to i8
br label %8
7: ; preds = %8, %2
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = sub i8 %11, %6
store i8 %12, i8* %10
%13 = add nuw nsw i64 %9, 1
%14 = tail call i32 @strlen(i8* %0)
%15 = sext i32 %14 to i64
%16 = icmp slt i64 %13, %15
br i1 %16, label %8, label %7
}
/* Variables and functions */
int atoi(char *);
int get_weight(char *str) { return (atoi(&(str[7]))); }


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

x86 assembly (clang, -O2):
<get_weight>:
add    $0x7,%rdi
jmp    1030 <atoi@plt>

LLVM IR (-O0):
define i32 @get_weight(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 7
%5 = call i32 @atoi(i8* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_weight(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 7
%3 = tail call i32 @atoi(i8* %2)
ret i32 %3
}
/* Variables and functions */
int expmod(int, int, int);
int main() {
  if (expmod(432, 18, 765) != 729)
    goto error;
  if (expmod(98765432456, 21345654321, 1234567654325432) != 531932833467048)
    goto error;
  if (expmod(1234567654326545432, 0x84b603a249dbac18, 4611686094970622477) !=
      4208510699096144003)
    goto error;
  return 0;
error:
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1b0,%edi
mov    $0x12,%esi
mov    $0x2fd,%edx
call   1030 <expmod@plt>
cmp    $0x2d9,%eax
je     1143 <main+0x33>
jmp    11ab <main+0x9b>
mov    $0xfee0e688,%edi
mov    $0xf84cd631,%esi
mov    $0x2e7cbcb8,%edx
call   1030 <expmod@plt>
cltq
movabs $0x1e3ca43954aa8,%rcx
cmp    %rcx,%rax
je     1171 <main+0x61>
jmp    11ab <main+0x9b>
mov    $0x97522c18,%edi
mov    $0x49dbac18,%esi
mov    $0xd255120d,%edx
call   1030 <expmod@plt>
cltq
movabs $0x3a67a22ee50e7883,%rcx
a2 67 3a
cmp    %rcx,%rax
je     119f <main+0x8f>
jmp    11ab <main+0x9b>
movl   $0x0,-0x4(%rbp)
jmp    11b2 <main+0xa2>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1b0,%edi
mov    $0x12,%esi
mov    $0x2fd,%edx
call   1030 <expmod@plt>
cmp    $0x2d9,%eax
jne    1140 <main+0x30>
mov    $0xfee0e688,%edi
mov    $0xf84cd631,%esi
mov    $0x2e7cbcb8,%edx
call   1030 <expmod@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @expmod(i32 432, i32 18, i32 765)
%3 = icmp ne i32 %2, 729
br i1 %3, label %4, label %5
4: ; preds = %0
br label %16
5: ; preds = %0
%6 = call i32 @expmod(i32 -18815352, i32 -129182159, i32 779926712)
%7 = sext i32 %6 to i64
%8 = icmp ne i64 %7, 531932833467048
br i1 %8, label %9, label %10
9: ; preds = %5
br label %16
10: ; preds = %5
%11 = call i32 @expmod(i32 -1756222440, i32 1239133208, i32 -766176755)
%12 = sext i32 %11 to i64
%13 = icmp ne i64 %12, 4208510699096144003
br i1 %13, label %14, label %15
14: ; preds = %10
br label %16
15: ; preds = %10
store i32 0, i32* %1
br label %17
16: ; preds = %14, %9, %4
store i32 1, i32* %1
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @expmod(i32 432, i32 18, i32 765)
%2 = icmp eq i32 %1, 729
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @expmod(i32 -18815352, i32 -129182159, i32 779926712)
br label %5
5: ; preds = %0, %3
ret i32 1
}
/* Variables and functions */
scalar_t__ geteuid();
int /*<<< orphan*/ usage(char *);
void mp_noneroot_die(void) {
  if (geteuid() != 0) {
    usage("This plugin must be run as root.");
  }
}


x86 assembly (clang, -O0):
<mp_noneroot_die>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <geteuid@plt>
cmp    $0x0,%rax
je     1141 <mp_noneroot_die+0x21>
lea    0xec4(%rip),%rdi
call   1040 <usage@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_noneroot_die>:
push   %rax
xor    %eax,%eax
call   1030 <geteuid@plt>
test   %rax,%rax
je     113a <mp_noneroot_die+0x1a>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <usage@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"This plugin must be run as root.\00"
define void @mp_noneroot_die() {
%1 = call i64 (...) @geteuid()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @usage(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"This plugin must be run as root.\00"
define void @mp_noneroot_die() {
%1 = tail call i64 (...) @geteuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @usage(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
/* Type definitions */
struct cec_msg {
  int *msg;
};
typedef int __u16;

/* Variables and functions */
void cec_ops_cdc_hec_notify_alive(const struct cec_msg *msg, __u16 *phys_addr) {
  *phys_addr = (msg->msg[2] << 8) | msg->msg[3];
}


x86 assembly (clang, -O0):
<cec_ops_cdc_hec_notify_alive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%ecx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
or     0xc(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cec_ops_cdc_hec_notify_alive>:
mov    (%rdi),%rax
mov    0x8(%rax),%ecx
shl    $0x8,%ecx
or     0xc(%rax),%ecx
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32* }
define void @cec_ops_cdc_hec_notify_alive(%struct.cec_msg* %0, i32* %1) {
%3 = alloca %struct.cec_msg*
%4 = alloca i32*
store %struct.cec_msg* %0, %struct.cec_msg** %3
store i32* %1, i32** %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %3
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = load %struct.cec_msg*, %struct.cec_msg** %3
%12 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %11, i32 0, i32 0
%13 = load i32*, i32** %12
%14 = getelementptr inbounds i32, i32* %13, i64 3
%15 = load i32, i32* %14
%16 = or i32 %10, %15
%17 = load i32*, i32** %4
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
define void @cec_ops_cdc_hec_notify_alive(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = getelementptr inbounds i32, i32* %4, i64 3
%9 = load i32, i32* %8
%10 = or i32 %7, %9
store i32 %10, i32* %1
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t ROL64_40(uint64_t x) {
  __asm__("rolq $40, %0" : "=r"(x) : "0"(x));
  return x;
}


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

x86 assembly (clang, -O2):
<ROL64_40>:
mov    %rdi,%rax
rol    $0x28,%rax
ret

LLVM IR (-O0):
define i8* @ROL64_40(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "rolq $$40, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @ROL64_40(i8* readnone %0) {
%2 = tail call i8* asm "rolq $$40, $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
unsigned int deviceBeaconGetSoftwareRevision() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @deviceBeaconGetSoftwareRevision() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *cmd) {
  fprintf(stderr, "Usage: \t%s <alloc-size-in-bytes> <alignment>\n", cmd);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: \09%s <alloc-size-in-bytes> <alignment>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: \09%s <alloc-size-in-bytes> <alignment>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int main() {
  unsigned long test = 0;
  return 1 + !test;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = add nsw i32 1, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ dcl_rcc();
int /*<<< orphan*/ dcl_rcd();
int /*<<< orphan*/ dcl_rcf();
int /*<<< orphan*/ dcl_rci();
int /*<<< orphan*/ dcl_rcll();
int /*<<< orphan*/ dcl_rcs();
void test_1(void) {
  dcl_rcc();
  dcl_rcs();
  dcl_rci();
  dcl_rcll();
  dcl_rcf();
  dcl_rcd();
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <dcl_rcc@plt>
mov    $0x0,%al
call   1070 <dcl_rcs@plt>
mov    $0x0,%al
call   1060 <dcl_rci@plt>
mov    $0x0,%al
call   1030 <dcl_rcll@plt>
mov    $0x0,%al
call   1040 <dcl_rcf@plt>
mov    $0x0,%al
call   1050 <dcl_rcd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
push   %rax
xor    %eax,%eax
call   1080 <dcl_rcc@plt>
xor    %eax,%eax
call   1070 <dcl_rcs@plt>
xor    %eax,%eax
call   1060 <dcl_rci@plt>
xor    %eax,%eax
call   1030 <dcl_rcll@plt>
xor    %eax,%eax
call   1040 <dcl_rcf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <dcl_rcd@plt>

LLVM IR (-O0):
define void @test_1() {
%1 = call i32 (...) @dcl_rcc()
%2 = call i32 (...) @dcl_rcs()
%3 = call i32 (...) @dcl_rci()
%4 = call i32 (...) @dcl_rcll()
%5 = call i32 (...) @dcl_rcf()
%6 = call i32 (...) @dcl_rcd()
ret void
}

LLVM IR (-O2):
define void @test_1() {
%1 = tail call i32 (...) @dcl_rcc()
%2 = tail call i32 (...) @dcl_rcs()
%3 = tail call i32 (...) @dcl_rci()
%4 = tail call i32 (...) @dcl_rcll()
%5 = tail call i32 (...) @dcl_rcf()
%6 = tail call i32 (...) @dcl_rcd()
ret void
}
const char *strcpyx(char *out, const char *in) {
  while (*in != '*' && *in != 0) {
    *(out++) = *(in++);
  }
  *out = 0;
  return in;
}


x86 assembly (clang, -O0):
<strcpyx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2a,%ecx
mov    %al,-0x11(%rbp)
je     1131 <strcpyx+0x31>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1141 <strcpyx+0x41>
jmp    1168 <strcpyx+0x68>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpyx+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpyx>:
mov    %rsi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1128 <strcpyx+0x28>
cmp    $0x2a,%cl
je     1128 <strcpyx+0x28>
add    $0x1,%rax
mov    %cl,(%rdi)
add    $0x1,%rdi
jmp    1110 <strcpyx+0x10>
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define i8* @strcpyx(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %17, %2
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 42
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %10, %5
%16 = phi i1 [ false, %5 ], [ %14, %10 ]
br i1 %16, label %17, label %23
17: ; preds = %15
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %4
%20 = load i8, i8* %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
store i8 %20, i8* %21
br label %5
23: ; preds = %15
%24 = load i8*, i8** %3
store i8 0, i8* %24
%25 = load i8*, i8** %4
ret i8* %25
}

LLVM IR (-O2):
define i8* @strcpyx(i8* nocapture writeonly %0, i8* %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %9, %7 ]
%5 = phi i8* [ %1, %2 ], [ %8, %7 ]
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 42, label %10
i8 0, label %10
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %6, i8* %4
br label %3
10: ; preds = %3, %3
store i8 0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ lcd_cmd(int);
void lcd_gotoxy1(unsigned char pos) { lcd_cmd(0x80 + pos); }


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

x86 assembly (clang, -O2):
<lcd_gotoxy1>:
sub    $0xffffff80,%edi
jmp    1030 <lcd_cmd@plt>

LLVM IR (-O0):
define void @lcd_gotoxy1(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = add nsw i32 128, %4
%6 = call i32 @lcd_cmd(i32 %5)
ret void
}

LLVM IR (-O2):
define void @lcd_gotoxy1(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = add nuw nsw i32 %2, 128
%4 = tail call i32 @lcd_cmd(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double sin(int);
int main(int argc) { printf("hello: %f\n", sin(argc)); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"hello: %f\0A\00"
define i32 @main(i32 %0) {
%2 = tail call double @sin(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int write(int, char const *, int);
void write_2_file(int fd, const char *buf, int size) {
  int result = -1;
  do {
    result = write(fd, buf, size);
  } while ((result < 0) && (errno == EINTR));
  return;
}


x86 assembly (clang, -O0):
<write_2_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0xffffffff,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jge    1164 <write_2_file+0x54>
mov    0x2e8f(%rip),%rax
mov    (%rax),%rax
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1129 <write_2_file+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_2_file>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <write@plt>
test   %eax,%eax
jns    114a <write_2_file+0x3a>
mov    (%r12),%rax
cmp    %rax,(%r15)
je     1130 <write_2_file+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define void @write_2_file(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 -1, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @write(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define void @write_2_file(i32 %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%6 = icmp slt i32 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret void
}
/* Type definitions */
struct cdrom_device_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ invalidate_toc();
int /*<<< orphan*/ type_0_command(int, int);
int cm206_tray_move(struct cdrom_device_info *cdi, int position) {
  {
    if (position) {
      type_0_command(5, 1);
      invalidate_toc();
    } else {
      type_0_command(0, 1);
    }
    return (0);
  }
}


x86 assembly (clang, -O0):
<cm206_tray_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1154 <cm206_tray_move+0x34>
mov    $0x5,%edi
mov    $0x1,%esi
call   1040 <type_0_command@plt>
mov    $0x0,%al
call   1030 <invalidate_toc@plt>
jmp    1160 <cm206_tray_move+0x40>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <type_0_command@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cm206_tray_move>:
push   %rax
test   %esi,%esi
je     113d <cm206_tray_move+0x1d>
mov    $0x5,%edi
mov    $0x1,%esi
call   1040 <type_0_command@plt>
xor    %eax,%eax
call   1030 <invalidate_toc@plt>
jmp    1149 <cm206_tray_move+0x29>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <type_0_command@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cdrom_device_info = type { i32 }
define i32 @cm206_tray_move(%struct.cdrom_device_info* %0, i32 %1) {
%3 = alloca %struct.cdrom_device_info*
%4 = alloca i32
store %struct.cdrom_device_info* %0, %struct.cdrom_device_info** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = call i32 @type_0_command(i32 5, i32 1)
%9 = call i32 (...) @invalidate_toc()
br label %12
10: ; preds = %2
%11 = call i32 @type_0_command(i32 0, i32 1)
br label %12
12: ; preds = %10, %7
ret i32 0
}

LLVM IR (-O2):
%struct.cdrom_device_info = type { i32 }
define i32 @cm206_tray_move(%struct.cdrom_device_info* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @type_0_command(i32 5, i32 1)
%6 = tail call i32 (...) @invalidate_toc()
br label %9
7: ; preds = %2
%8 = tail call i32 @type_0_command(i32 0, i32 1)
br label %9
9: ; preds = %7, %4
ret i32 0
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, int);
main(void) {
  int c, n = 0;
  while ((c = getchar()) != '\n') {
    n++;
  }
  printf("Cantidad de letras : %d\n", n - 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
je     1157 <main+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xfffffffe,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    $0xa,%eax
jne    1130 <main+0x10>
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"Cantidad de letras : %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 (...) @getchar()
%4 = icmp eq i32 %3, 10
%5 = add nuw nsw i32 %2, 1
br i1 %4, label %6, label %1
6: ; preds = %1
%7 = add nsw i32 %2, -1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
char *getcwd(char *buf, unsigned long long n) {
  printk("Write getcwd()\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Write getcwd()\0A\00"
define i8* @getcwd(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [16 x i8] c"Write getcwd()\0A\00"
define noalias i8* @getcwd(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
double factorial(double p) {
  if (p <= 1.0)
    return p;
  else
    return (p * factorial(p - 1.0));
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     113f <factorial+0x2f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1170 <factorial+0x60>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeaa(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <factorial@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
push   %rax
movapd %xmm0,%xmm1
movsd  0xee3(%rip),%xmm0
ucomisd %xmm1,%xmm0
jae    1142 <factorial+0x32>
movsd  0xedd(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1030 <factorial@plt>
movsd  (%rsp),%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @factorial(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double %4, 1.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %3
store double %7, double* %2
br label %14
8: ; preds = %1
%9 = load double, double* %3
%10 = load double, double* %3
%11 = fsub double %10, 1.000000e+00
%12 = call double @factorial(double %11)
%13 = fmul double %9, %12
store double %13, double* %2
br label %14
14: ; preds = %8, %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @factorial(double %0) {
%2 = fcmp ugt double %0, 1.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1, %5
%4 = phi double [ %8, %5 ], [ %0, %1 ]
ret double %4
5: ; preds = %1
%6 = fadd double %0, -1.000000e+00
%7 = tail call double @factorial(double %6)
%8 = fmul double %7, %0
br label %3
}
void primitSwapTiles(char *from, char *to) {
  char temp;
  temp = *to;
  *to = *from;
  *from = temp;
}


x86 assembly (clang, -O0):
<primitSwapTiles>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitSwapTiles>:
mov    (%rsi),%al
mov    (%rdi),%cl
mov    %cl,(%rsi)
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @primitSwapTiles(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = load i8*, i8** %4
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %3
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @primitSwapTiles(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = load i8, i8* %0
store i8 %4, i8* %1
store i8 %3, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void io_error() {
  fprintf(stderr, "IO_C_ERROR\n");
  exit(1);
}


x86 assembly (clang, -O0):
<io_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<io_error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"IO_C_ERROR\0A\00"
define void @io_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"IO_C_ERROR\0A\00"
define void @io_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
unsigned int proc_pid_cpu(int);
int main() {
  unsigned int total = proc_pid_cpu(1);
  printf("TOTAL CPU = %u.%u %%\n", total / 100, total % 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <proc_pid_cpu@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%esi
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <proc_pid_cpu@plt>
mov    %eax,%ecx
imul   $0x51eb851f,%rcx,%rsi
shr    $0x25,%rsi
imul   $0x64,%esi,%ecx
sub    %ecx,%eax
lea    0xebc(%rip),%rdi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"TOTAL CPU = %u.%u %%\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @proc_pid_cpu(i32 1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = udiv i32 %4, 100
%6 = load i32, i32* %2
%7 = urem i32 %6, 100
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"TOTAL CPU = %u.%u %%\0A\00"
define i32 @main() {
%1 = tail call i32 @proc_pid_cpu(i32 1)
%2 = udiv i32 %1, 100
%3 = urem i32 %1, 100
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret i32 0
}
int TryAssemble_LINE(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @TryAssemble_LINE() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void insertmode(int on) { printf("\x1b[4%c", on ? 'h' : 'l'); }


x86 assembly (clang, -O0):
<insertmode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x6c,%eax
mov    $0x68,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xecb(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insertmode>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
lea    0x68(,%rax,4),%esi
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[4%c\00"
define void @insertmode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 104, i32 108
%7 = trunc i32 %6 to i8
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[4%c\00"
define void @insertmode(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8 108, i8 104
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
int starts_with(const char *string, const char *prefix) {
  return strncmp(string, prefix, strlen(prefix)) == 0;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @starts_with(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @starts_with(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
__attribute__((no, noclone)) int f0(int A, int B) {
  int C = A & ~B;
  int D = A ^ B;
  return C | D;
}


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f0(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = xor i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = or i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @f0(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
int signbitl(x)
long double x;
{
  union {
    long double d;
    short s[6];
    int i[3];
  } u;
  u.d = x;
  if (sizeof(int) == 4) {
    return (u.s[4] < 0);
  } else {
    return (u.s[4] < 0);
  }
}


x86 assembly (clang, -O0):
<signbitl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpt  -0x20(%rbp)
movswl -0x18(%rbp),%eax
cmp    $0x0,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signbitl>:
movzwl 0x10(%rsp),%eax
shr    $0xf,%rax
ret

LLVM IR (-O0):
%union.anon = type { x86_fp80 }
define i32 @signbitl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca %union.anon
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = bitcast %union.anon* %3 to x86_fp80*
store x86_fp80 %4, x86_fp80* %5
%6 = bitcast %union.anon* %3 to [6 x i16]*
%7 = getelementptr inbounds [6 x i16], [6 x i16]* %6, i64 0, i64 4
%8 = load i16, i16* %7
%9 = sext i16 %8 to i32
%10 = icmp slt i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @signbitl(x86_fp80 %0) {
%2 = bitcast x86_fp80 %0 to i80
%3 = lshr i80 %2, 79
%4 = trunc i80 %3 to i32
ret i32 %4
}
int func2(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @func2() {
ret i32 42
}

LLVM IR (-O2):
define i32 @func2() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set(int, int /*<<< orphan*/);
void stop() {
  gpio_set((45), 0);
  gpio_set((23), 0);
}


x86 assembly (clang, -O0):
<stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2d,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x17,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop>:
push   %rax
mov    $0x2d,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x17,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <gpio_set@plt>

LLVM IR (-O0):
define void @stop() {
%1 = call i32 @gpio_set(i32 45, i32 0)
%2 = call i32 @gpio_set(i32 23, i32 0)
ret void
}

LLVM IR (-O2):
define void @stop() {
%1 = tail call i32 @gpio_set(i32 45, i32 0)
%2 = tail call i32 @gpio_set(i32 23, i32 0)
ret void
}
void x86_write_cr4(unsigned long val) {
  __asm__ __volatile__("mov %0, %%cr4" ::"r"(val));
}


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

x86 assembly (clang, -O2):
<x86_write_cr4>:
mov    %rdi,%cr4
ret

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

LLVM IR (-O2):
define void @x86_write_cr4(i64 %0) {
tail call void asm sideeffect "mov $0, %cr4", "r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
int test_imm_63uint8_mem(unsigned char *val) {
  return ((*val) & (-0x63 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_63uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff9d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_63uint8_mem>:
testb  $0x9d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_63uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -99
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_63uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -99
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct mat4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat4_rotation_x(float *, float);
__attribute__((always_)) struct mat4 *psmat4_rotation_x(struct mat4 *result,
                                                        float angle) {
  mat4_rotation_x((float *)result, angle);
  return result;
}


x86 assembly (clang, -O0):
<psmat4_rotation_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
call   1030 <mat4_rotation_x@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psmat4_rotation_x>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat4_rotation_x@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_rotation_x(%struct.mat4* %0, float %1) {
%3 = alloca %struct.mat4*
%4 = alloca float
store %struct.mat4* %0, %struct.mat4** %3
store float %1, float* %4
%5 = load %struct.mat4*, %struct.mat4** %3
%6 = bitcast %struct.mat4* %5 to float*
%7 = load float, float* %4
%8 = call i32 @mat4_rotation_x(float* %6, float %7)
%9 = load %struct.mat4*, %struct.mat4** %3
ret %struct.mat4* %9
}

LLVM IR (-O2):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_rotation_x(%struct.mat4* returned %0, float %1) {
%3 = bitcast %struct.mat4* %0 to float*
%4 = tail call i32 @mat4_rotation_x(float* %3, float %1)
ret %struct.mat4* %0
}
void ScaleRowDown34_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown34_SSSE3() {
ret void
}
void io_init(void) {
  *(volatile unsigned int *)((0xf1c20890)) = 0x111111;
  return;
}


x86 assembly (clang, -O0):
<io_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf1c20890,%eax
movl   $0x111111,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_init>:
mov    $0xf1c20890,%eax
movl   $0x111111,(%rax)
ret

LLVM IR (-O0):
define void @io_init() {
store volatile i32 1118481, i32* inttoptr (i64 4056025232 to i32*)
ret void
}

LLVM IR (-O2):
define void @io_init() {
store volatile i32 1118481, i32* inttoptr (i64 4056025232 to i32*)
ret void
}
void wifi_rsp_hardware_external_interrupt_config(
    const struct wifi_msg_hardware_external_interrupt_config_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_hardware_external_interrupt_config_rsp_t = type opaque
define void @wifi_rsp_hardware_external_interrupt_config(%struct.wifi_msg_hardware_external_interrupt_config_rsp_t* nocapture %0) {
ret void
}
void INT_Excep_USB0_D0FIFO0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_USB0_D0FIFO0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fabs(int /*<<< orphan*/);
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ variance(double const, double const, int const);
double stddev(const double sum, const double sumofsquares, const int n) {
  return (sqrt(fabs(variance(sum, sumofsquares, n))));
}


x86 assembly (clang, -O0):
<stddev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    -0x14(%rbp),%edi
call   1030 <variance@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
mov    %eax,%edi
call   1050 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stddev>:
push   %rax
call   1030 <variance@plt>
mov    %eax,%edi
call   1040 <fabs@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <sqrt@plt>

LLVM IR (-O0):
define double @stddev(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load i32, i32* %6
%10 = call i32 @variance(double %7, double %8, i32 %9)
%11 = call i32 @fabs(i32 %10)
%12 = call double @sqrt(i32 %11)
ret double %12
}

LLVM IR (-O2):
define double @stddev(double %0, double %1, i32 %2) {
%4 = tail call i32 @variance(double %0, double %1, i32 %2)
%5 = tail call i32 @fabs(i32 %4)
%6 = tail call double @sqrt(i32 %5)
ret double %6
}