xunge/DecIR huggingface dataset:
/* Variables and functions */
int strcmp(char const *, char const *);
extern int CompareStrings(const char *s1, const char *s2) {
  if (s1 && s2)
    return strcmp(s1, s2);
  else
    return -1;
}


x86 assembly (clang, -O0):
<CompareStrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114b <CompareStrings+0x3b>
cmpq   $0x0,-0x18(%rbp)
je     114b <CompareStrings+0x3b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <CompareStrings+0x42>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CompareStrings>:
test   %rdi,%rdi
je     111f <CompareStrings+0xf>
test   %rsi,%rsi
je     111f <CompareStrings+0xf>
jmp    1030 <strcmp@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @CompareStrings(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: lab1 [no options...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
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 = [29 x i8] c"usage: lab1 [no options...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"usage: lab1 [no options...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(void *, void *, int);
void __cstring_cpy(void *a, void *b) { strncpy(a, b, 128); }


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

x86 assembly (clang, -O2):
<__cstring_cpy>:
mov    $0x80,%edx
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
define void @__cstring_cpy(i8* %0, i8* %1) {
%3 = tail call i32 @strncpy(i8* %0, i8* %1, i32 128)
ret void
}
int iAlignUp(int a, int b) { return (a % b != 0) ? (a - a % b + b) : a; }


x86 assembly (clang, -O0):
<iAlignUp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
je     1137 <iAlignUp+0x37>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x10(%rbp),%eax
sub    %edx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    113d <iAlignUp+0x3d>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iAlignUp>:
mov    %edi,%eax
cltd
idiv   %esi
lea    (%rsi,%rdi,1),%eax
sub    %edx,%eax
test   %edx,%edx
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @iAlignUp(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 = srem i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = sub nsw i32 %10, %13
%15 = load i32, i32* %4
%16 = add nsw i32 %14, %15
br label %19
17: ; preds = %2
%18 = load i32, i32* %3
br label %19
19: ; preds = %17, %9
%20 = phi i32 [ %16, %9 ], [ %18, %17 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @iAlignUp(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = add i32 %1, %0
%6 = sub i32 %5, %3
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
int ft_isdigit(int c) {
  if (c >= '0' && c <= '9')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <ft_isdigit+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <ft_isdigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isdigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ft_isdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void __attribute__((weak)) user_init(void) {}


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

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

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

LLVM IR (-O2):
define weak void @user_init() {
ret void
}
/* Variables and functions */
int determine_output_during_continuation();
int /*<<< orphan*/ printf(char *);
int tune_continuation_parameters();
int tune_parameters_and_output(void) {
  int fail;
  printf("\n");
  fail = tune_continuation_parameters();
  printf("\n");
  fail = determine_output_during_continuation();
  printf("\nSee the output file for results ...\n\n");
  return fail;
}


x86 assembly (clang, -O0):
<tune_parameters_and_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <tune_continuation_parameters@plt>
mov    %eax,-0x4(%rbp)
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <determine_output_during_continuation@plt>
mov    %eax,-0x4(%rbp)
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tune_parameters_and_output>:
push   %rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <tune_continuation_parameters@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <determine_output_during_continuation@plt>
mov    %eax,%ebx
lea    0xe94(%rip),%rdi
call   1050 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [39 x i8] c"\0ASee the output file for results ...\0A\0A\00"
define i32 @tune_parameters_and_output() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @tune_continuation_parameters()
store i32 %3, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @determine_output_during_continuation()
store i32 %5, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@str = [38 x i8] c"\0ASee the output file for results ...\0A\00"
define i32 @tune_parameters_and_output() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 (...) @tune_continuation_parameters()
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 (...) @determine_output_during_continuation()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ syscall0(int);
void cls() { syscall0(13); }


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

x86 assembly (clang, -O2):
<cls>:
mov    $0xd,%edi
jmp    1030 <syscall0@plt>

LLVM IR (-O0):
define void @cls() {
%1 = call i32 @syscall0(i32 13)
ret void
}

LLVM IR (-O2):
define void @cls() {
%1 = tail call i32 @syscall0(i32 13)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
size_t strxfrm_l(char *restrict dest, const char *restrict src, size_t n,
                 locale_t loc) {
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @strxfrm_l(i8* noalias %0, i8* noalias %1, i64 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
ret i64 0
}

LLVM IR (-O2):
define i64 @strxfrm_l(i8* noalias nocapture readnone %0, i8* noalias nocapture readnone %1, i64 %2, i32 %3) {
ret i64 0
}
char GetEncoding14() { return 0x16; }


x86 assembly (clang, -O0):
<GetEncoding14>:
push   %rbp
mov    %rsp,%rbp
mov    $0x16,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetEncoding14>:
mov    $0x16,%al
ret

LLVM IR (-O0):
define signext i8 @GetEncoding14() {
ret i8 22
}

LLVM IR (-O2):
define signext i8 @GetEncoding14() {
ret i8 22
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int uint16_t;

/* Variables and functions */
void USBHostPwrDisable(uint32_t ui32Base) {
  ;
  (*((volatile uint16_t *)(ui32Base + 0x00000400))) &= ~0x00000004;
}


x86 assembly (clang, -O0):
<USBHostPwrDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x400(%rax),%ecx
and    $0xfffffffb,%ecx
mov    %ecx,0x400(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostPwrDisable>:
andl   $0xfffffffb,0x400(%rdi)
ret

LLVM IR (-O0):
define void @USBHostPwrDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1024
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -5
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @USBHostPwrDisable(i64 %0) {
%2 = add nsw i64 %0, 1024
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = and i32 %4, -5
store volatile i32 %5, i32* %3
ret void
}
int main(int argc, const char *argv[]) {
  unsigned char a;
  unsigned b;
  a = b;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%eax
mov    %al,-0x11(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
unsigned long long readtsc(void) {
  unsigned int lo, hi;
  asm volatile("rdtsc" : "=a"(lo), "=d"(hi));
  return (unsigned long long)hi << 32 | lo;
}


x86 assembly (clang, -O0):
<readtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x20,%rax
mov    -0x4(%rbp),%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readtsc>:
rdtsc
shl    $0x20,%rdx
mov    %eax,%eax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @readtsc() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = shl i64 %7, 32
%9 = load i32, i32* %1
%10 = zext i32 %9 to i64
%11 = or i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @readtsc() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %3 to i64
%5 = shl nuw i64 %4, 32
%6 = zext i32 %2 to i64
%7 = or i64 %5, %6
ret i64 %7
}
unsigned xrop3_42_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk2 = ~stk2;
  stk1 = D & stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_42_1_1(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 = and i8 %1, %0
%8 = xor i8 %7, -1
%9 = zext i8 %8 to i32
%10 = or i32 %6, %4
%11 = xor i32 %10, -1
%12 = and i32 %11, %9
%13 = or i8 %1, %0
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ log_close();
void cleanup() { log_close(); }


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

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

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

LLVM IR (-O2):
define void @cleanup() {
%1 = tail call i32 (...) @log_close()
ret void
}
XEmptyRegion() {}


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

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

LLVM IR (-O0):
define i32 @XEmptyRegion() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XEmptyRegion() {
ret i32 undef
}
void msm_reserve_last_regs(void) { return; }


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

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

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

LLVM IR (-O2):
define void @msm_reserve_last_regs() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void rings() {
  system("stty raw -echo ");
  printf("Press any key to continue . . . ");
  getchar();
  system("stty -raw echo ");
  printf("\n");
}


x86 assembly (clang, -O0):
<rings>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <system@plt>
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
lea    0xed7(%rip),%rdi
call   1030 <system@plt>
lea    0xedb(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rings>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <system@plt>
lea    0xebc(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
lea    0xeca(%rip),%rdi
call   1040 <system@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"stty raw -echo \00"
@.str.1 = [33 x i8] c"Press any key to continue . . . \00"
@.str.2 = [16 x i8] c"stty -raw echo \00"
@.str.3 = [2 x i8] c"\0A\00"
define void @rings() {
%1 = call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @getchar()
%4 = call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"stty raw -echo \00"
@.str.1 = [33 x i8] c"Press any key to continue . . . \00"
@.str.2 = [16 x i8] c"stty -raw echo \00"
define void @rings() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 @system(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void checkArgc(int argc) {
  if (argc != 3) {
    printf("Usage: tcpm source_file target_file\n");
    printf("       tcpm source_file ... target_directory\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkArgc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
je     115b <checkArgc+0x3b>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkArgc>:
cmp    $0x3,%edi
jne    1126 <checkArgc+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Usage: tcpm source_file target_file\0A\00"
@.str.1 = [46 x i8] c" tcpm source_file ... target_directory\0A\00"
@EXIT_FAILURE = global i32 0
define void @checkArgc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 3
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [36 x i8] c"Usage: tcpm source_file target_file\00"
@str.2 = [45 x i8] c" tcpm source_file ... target_directory\00"
define void @checkArgc(i32 %0) {
%2 = icmp eq i32 %0, 3
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.2, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int gcd(unsigned long long, unsigned long long);
unsigned long long eulerTotient(unsigned long long n) {
  unsigned long long result = 0, k = 0;
  for (k = 0; k < n; k++) {
    if (gcd(k, n) == 1)
      result++;
  }
  return result;
}


x86 assembly (clang, -O0):
<eulerTotient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    117a <eulerTotient+0x6a>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <gcd@plt>
cmp    $0x1,%eax
jne    1164 <eulerTotient+0x54>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1169 <eulerTotient+0x59>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <eulerTotient+0x24>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eulerTotient>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1151 <eulerTotient+0x41>
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <gcd@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %rcx,%r15
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <eulerTotient+0x20>
jmp    1154 <eulerTotient+0x44>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @eulerTotient(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %10, %3 ], [ 0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = tail call i32 @gcd(i64 %4, i64 %0)
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i64
%9 = add i64 %5, %8
%10 = add nuw i64 %4, 1
%11 = icmp eq i64 %10, %0
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i64 [ 0, %1 ], [ %9, %3 ]
ret i64 %13
}
void SPUplaySample(unsigned char ch) {}


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

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

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

LLVM IR (-O2):
define void @SPUplaySample(i8 zeroext %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BUG();
extern void flush_tlb_kernel_page(unsigned long addr) { BUG(); }


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

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

LLVM IR (-O0):
define void @flush_tlb_kernel_page(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @BUG()
ret void
}

LLVM IR (-O2):
define void @flush_tlb_kernel_page(i64 %0) {
%2 = tail call i32 (...) @BUG()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
main() {
  float s;
  void changeval(float *);
  s = 8;
  changeval(&s);
  printf("%f\n", s);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x41000000,0x4(%rsp)
41
lea    0x4(%rsp),%rdi
call   1040 <changeval@plt>
movss  0x4(%rsp),%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 8.000000e+00, float* %1
%3 = load float, float* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
size_t type_size(int type) {
  const size_t type_size_map[] = {1, 1, 2, 2, 4, 4, 8, 8, 4, 8};
  assert(type < 10);
  return type_size_map[type];
}


x86 assembly (clang, -O0):
<type_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeca(%rip),%rsi
mov    $0x50,%edx
call   1040 <memcpy@plt>
cmpl   $0xa,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movslq -0x4(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_size>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0xa,%ebx
setl   %dil
call   1030 <assert@plt>
movslq %ebx,%rax
lea    0xed5(%rip),%rcx
mov    (%rcx,%rax,8),%rax
pop    %rbx
ret

LLVM IR (-O0):
@__const.type_size.type_size_map = [10 x i64] [i64 1, i64 1, i64 2, i64 2, i64 4, i64 4, i64 8, i64 8, i64 4, i64 8]
define i64 @type_size(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i64]
store i32 %0, i32* %2
%4 = bitcast [10 x i64]* %3 to i8*
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [10 x i64], [10 x i64]* %3, i64 0, i64 %10
%12 = load i64, i64* %11
ret i64 %12
}

LLVM IR (-O2):
@__const.type_size.type_size_map = [10 x i64] [i64 1, i64 1, i64 2, i64 2, i64 4, i64 4, i64 8, i64 8, i64 4, i64 8]
define i64 @type_size(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [10 x i64], [10 x i64]* @__const.type_size.type_size_map, i64 0, i64 %5
%7 = load i64, i64* %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int get_value_from_user(void) {
  int val = -1;
  printf("Input a Value[0-1000] : ");
  scanf("%d", &val);
  return val;
}


x86 assembly (clang, -O0):
<get_value_from_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_value_from_user>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Input a Value[0-1000] : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_value_from_user() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [25 x i8] c"Input a Value[0-1000] : \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @get_value_from_user() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -1, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ si475x_command(int, unsigned char *, int, unsigned char *);
unsigned char getIntStatus(void) {
  unsigned char cmd[1] = {0};
  unsigned char rsp[1] = {0};
  cmd[0] = 0x15;
  si475x_command(1, cmd, 1, rsp);
  return rsp[0];
}


x86 assembly (clang, -O0):
<getIntStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
lea    -0x2(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
movb   $0x15,-0x1(%rbp)
lea    -0x1(%rbp),%rsi
lea    -0x2(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <si475x_command@plt>
movzbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getIntStatus>:
push   %rax
movb   $0x0,0x6(%rsp)
movb   $0x15,0x7(%rsp)
lea    0x7(%rsp),%rsi
lea    0x6(%rsp),%rcx
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <si475x_command@plt>
mov    0x6(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @getIntStatus() {
%1 = alloca [1 x i8]
%2 = alloca [1 x i8]
%3 = bitcast [1 x i8]* %1 to i8*
%4 = bitcast [1 x i8]* %2 to i8*
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 21, i8* %5
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%8 = call i32 @si475x_command(i32 1, i8* %6, i32 1, i8* %7)
%9 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%10 = load i8, i8* %9
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @getIntStatus() {
%1 = alloca [1 x i8]
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
store i8 0, i8* %4
store i8 21, i8* %3
%5 = call i32 @si475x_command(i32 1, i8* %3, i32 1, i8* %4)
%6 = load i8, i8* %4
ret i8 %6
}
void dis_assemble_17(as17, x, y, z) unsigned int as17;
unsigned int *x, *y, *z;
{
  *z = (as17 & 0x10000) >> 16;
  *x = (as17 & 0x0f800) >> 11;
  *y = (((as17 & 0x00400) >> 10) | ((as17 & 0x3ff) << 1)) & 0x7ff;
}


x86 assembly (clang, -O0):
<dis_assemble_17>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x10000,%ecx
shr    $0x10,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0xf800,%ecx
shr    $0xb,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0x400,%ecx
shr    $0xa,%ecx
mov    -0x4(%rbp),%eax
and    $0x3ff,%eax
shl    $0x1,%eax
or     %eax,%ecx
and    $0x7ff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dis_assemble_17>:
mov    %edi,%eax
shr    $0x10,%eax
and    $0x1,%eax
mov    %eax,(%rcx)
mov    %edi,%eax
shr    $0xb,%eax
and    $0x1f,%eax
mov    %eax,(%rsi)
mov    %edi,%eax
shr    $0xa,%eax
and    $0x1,%eax
and    $0x3ff,%edi
lea    (%rax,%rdi,2),%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @dis_assemble_17(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = and i32 %9, 65536
%11 = lshr i32 %10, 16
%12 = load i32*, i32** %8
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = and i32 %13, 63488
%15 = lshr i32 %14, 11
%16 = load i32*, i32** %6
store i32 %15, i32* %16
%17 = load i32, i32* %5
%18 = and i32 %17, 1024
%19 = lshr i32 %18, 10
%20 = load i32, i32* %5
%21 = and i32 %20, 1023
%22 = shl i32 %21, 1
%23 = or i32 %19, %22
%24 = and i32 %23, 2047
%25 = load i32*, i32** %7
store i32 %24, i32* %25
ret void
}

LLVM IR (-O2):
define void @dis_assemble_17(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = lshr i32 %0, 16
%6 = and i32 %5, 1
store i32 %6, i32* %3
%7 = lshr i32 %0, 11
%8 = and i32 %7, 31
store i32 %8, i32* %1
%9 = lshr i32 %0, 10
%10 = and i32 %9, 1
%11 = shl i32 %0, 1
%12 = and i32 %11, 2046
%13 = or i32 %10, %12
store i32 %13, i32* %2
ret void
}
void exp2ext_unit_exp() {}


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

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

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

LLVM IR (-O2):
define void @exp2ext_unit_exp() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ stdscr;
int valid_args(int y, int x, int len) {
  int maxy, maxx;
  getmaxyx(stdscr, maxy, maxx);
  if (y < 0 || y >= maxy || len < 3 || len > maxx || x < 0 || x > maxx - len) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<valid_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <getmaxyx@plt>
cmpl   $0x0,-0x8(%rbp)
jl     117c <valid_args+0x6c>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    117c <valid_args+0x6c>
cmpl   $0x3,-0x10(%rbp)
jl     117c <valid_args+0x6c>
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     117c <valid_args+0x6c>
cmpl   $0x0,-0xc(%rbp)
jl     117c <valid_args+0x6c>
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jle    1188 <valid_args+0x78>
movl   $0x0,-0x4(%rbp)
jmp    118f <valid_args+0x7f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_args>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <getmaxyx@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdscr = global i32 0
define i32 @valid_args(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%10 = load i32, i32* @stdscr
%11 = load i32, i32* %8
%12 = load i32, i32* %9
%13 = call i32 @getmaxyx(i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %5
%15 = icmp slt i32 %14, 0
br i1 %15, label %36, label %16
16: ; preds = %3
%17 = load i32, i32* %5
%18 = load i32, i32* %8
%19 = icmp sge i32 %17, %18
br i1 %19, label %36, label %20
20: ; preds = %16
%21 = load i32, i32* %7
%22 = icmp slt i32 %21, 3
br i1 %22, label %36, label %23
23: ; preds = %20
%24 = load i32, i32* %7
%25 = load i32, i32* %9
%26 = icmp sgt i32 %24, %25
br i1 %26, label %36, label %27
27: ; preds = %23
%28 = load i32, i32* %6
%29 = icmp slt i32 %28, 0
br i1 %29, label %36, label %30
30: ; preds = %27
%31 = load i32, i32* %6
%32 = load i32, i32* %9
%33 = load i32, i32* %7
%34 = sub nsw i32 %32, %33
%35 = icmp sgt i32 %31, %34
br i1 %35, label %36, label %37
36: ; preds = %30, %27, %23, %20, %16, %3
store i32 0, i32* %4
br label %38
37: ; preds = %30
store i32 1, i32* %4
br label %38
38: ; preds = %37, %36
%39 = load i32, i32* %4
ret i32 %39
}

LLVM IR (-O2):
@stdscr = global i32 0
define i32 @valid_args(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @stdscr
%5 = tail call i32 @getmaxyx(i32 %4, i32 undef, i32 undef)
ret i32 0
}
int bar(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<bar>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @bar(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void foo(int a, int b) { printf("> %d %d\n", a, b); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"> %d %d\0A\00"
define void @foo(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_socket();
int /*<<< orphan*/ printf(char *);
void test_dlsym_mucker_init(void) {
  printf("test_dlsym_mucker init\n");
  print_socket();
  return;
}


x86 assembly (clang, -O0):
<test_dlsym_mucker_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <print_socket@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"test_dlsym_mucker init\0A\00"
define void @test_dlsym_mucker_init() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @print_socket()
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"test_dlsym_mucker init\00"
define void @test_dlsym_mucker_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @print_socket()
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ failure(char *, char *);
scalar_t__ list_search(struct list *, char *);
void test_not_search_data(struct list *list, char *data) {
  if (list_search(list, data))
    failure("list should not have had '%s'", data);
}


x86 assembly (clang, -O0):
<test_not_search_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <list_search@plt>
cmp    $0x0,%rax
je     1157 <test_not_search_data+0x37>
mov    -0x10(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <failure@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_not_search_data>:
push   %rbx
mov    %rsi,%rbx
call   1040 <list_search@plt>
test   %rax,%rax
je     113e <test_not_search_data+0x1e>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <failure@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.list = type { i32 }
@.str = [30 x i8] c"list should not have had '%s'\00"
define void @test_not_search_data(%struct.list* %0, i8* %1) {
%3 = alloca %struct.list*
%4 = alloca i8*
store %struct.list* %0, %struct.list** %3
store i8* %1, i8** %4
%5 = load %struct.list*, %struct.list** %3
%6 = load i8*, i8** %4
%7 = call i64 @list_search(%struct.list* %5, i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @failure(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
@.str = [30 x i8] c"list should not have had '%s'\00"
define void @test_not_search_data(%struct.list* %0, i8* %1) {
%3 = tail call i64 @list_search(%struct.list* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @failure(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sendTrame(float *, float *, float *);
int main() {
  float test = 114.5;
  float test2 = 28.9;
  float test3 = 12.1;
  float *ptTest = &test;
  float *ptTest2 = &test2;
  float *ptTest3 = &test3;
  printf("float to string + AT command :\n\n");
  sendTrame(ptTest, ptTest2, ptTest3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xed1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xec0(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeaf(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1040 <sendTrame@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x42e50000,0x14(%rsp)
42
movl   $0x41e73333,0x10(%rsp)
41
movl   $0x4141999a,0xc(%rsp)
41
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <sendTrame@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"float to string + AT command :\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float*
%6 = alloca float*
%7 = alloca float*
store i32 0, i32* %1
store float 1.145000e+02, float* %2
store float 0x403CE66660000000, float* %3
store float 0x4028333340000000, float* %4
store float* %2, float** %5
store float* %3, float** %6
store float* %4, float** %7
%8 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%9 = load float*, float** %5
%10 = load float*, float** %6
%11 = load float*, float** %7
%12 = call i32 @sendTrame(float* %9, float* %10, float* %11)
ret i32 0
}

LLVM IR (-O2):
@str = [32 x i8] c"float to string + AT command :\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
store float 1.145000e+02, float* %1
%5 = bitcast float* %2 to i8*
store float 0x403CE66660000000, float* %2
%6 = bitcast float* %3 to i8*
store float 0x4028333340000000, float* %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%8 = call i32 @sendTrame(float* %1, float* %2, float* %3)
ret i32 0
}
int test_imm_5Auint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x5A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Auint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x5a,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Auint64_lowword_reg>:
test   $0x5a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Auint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 90
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int nlr_conf_parse(char *);
int /*<<< orphan*/ nlr_get_options(int, char **);
int main(int argc, char **argv) {
  nlr_get_options(argc, argv);
  if (nlr_conf_parse("nlr.conf") == -1) {
    return 1;
  }
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <nlr_get_options@plt>
lea    0xeb7(%rip),%rdi
call   1030 <nlr_conf_parse@plt>
cmp    $0xffffffff,%eax
jne    1163 <main+0x43>
movl   $0x1,-0x4(%rbp)
jmp    116a <main+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <nlr_get_options@plt>
lea    0xed3(%rip),%rdi
call   1030 <nlr_conf_parse@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"nlr.conf\00"
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @nlr_get_options(i32 %6, i8** %7)
%9 = call i32 @nlr_conf_parse(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [9 x i8] c"nlr.conf\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @nlr_get_options(i32 %0, i8** %1)
%4 = tail call i32 @nlr_conf_parse(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}