xunge/DecIR huggingface dataset:
void kinetisbase_mass_erase() {}


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

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

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

LLVM IR (-O2):
define void @kinetisbase_mass_erase() {
ret void
}
I0AX1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if (22 <= (((int *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<I0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x14(%rbp),%rdx
mov    $0x16,%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx,%rdx,4),%eax
jg     113b <I0AX1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <I0AX1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I0AX1>:
movslq %ecx,%rcx
xor    %eax,%eax
cmpl   $0x16,0xa98ac7(,%rcx,4)
16
setge  %al
ret

LLVM IR (-O0):
define i32 @I0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %11
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %15
%17 = load i32, i32* %16
%18 = icmp sle i32 22, %17
br i1 %18, label %19, label %20
19: ; preds = %6
store i32 1, i32* %7
br label %21
20: ; preds = %6
store i32 0, i32* %7
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
define i32 @I0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = icmp sgt i32 %9, 21
%11 = zext i1 %10 to i32
ret i32 %11
}
int test_imm_D4uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xD4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D4uint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 212
%7 = icmp ne i64 %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_D4uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 13893632
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reverse(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char str1[20];
  int size;
  printf("Enter a string to reverse: ");
  scanf("%s", str1);
  size = strlen(str1);
  reverse(str1, 0);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1030 <reverse@plt>
lea    0xe96(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xea4(%rip),%rdi
call   1060 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <reverse@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter a string to reverse: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %3
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = call i32 @reverse(i8* %9, i32 0)
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter a string to reverse: \00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 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), i8* %2)
%5 = call i32 @strlen(i8* %2)
%6 = call i32 @reverse(i8* %2, i32 0)
%7 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ invalid_phase(char *);
void phase_5(char *input) { invalid_phase("5a"); }


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

x86 assembly (clang, -O2):
<phase_5>:
lea    0xee9(%rip),%rdi
jmp    1030 <invalid_phase@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"5a\00"
define void @phase_5(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @invalid_phase(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"5a\00"
define void @phase_5(i8* nocapture readnone %0) {
%2 = tail call i32 @invalid_phase(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strspn(char *, char *);
int cgiFirstNonspaceChar(char *s) {
  int len = strspn(s, " \n\r\t");
  return s[len];
}


x86 assembly (clang, -O0):
<cgiFirstNonspaceChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strspn@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiFirstNonspaceChar>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strspn@plt>
cltq
movsbl (%rbx,%rax,1),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c" \0A\0D\09\00"
define i32 @cgiFirstNonspaceChar(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strspn(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@.str = [5 x i8] c" \0A\0D\09\00"
define i32 @cgiFirstNonspaceChar(i8* nocapture %0) {
%2 = tail call i32 @strspn(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
void bcopy(void) {}


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

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

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

LLVM IR (-O2):
define void @bcopy() {
ret void
}
/* Variables and functions */
int WaitForAckNak(int);
int WaitForInitialAck(void) { return WaitForAckNak(10000) == 0x06; }


x86 assembly (clang, -O0):
<WaitForInitialAck>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2710,%edi
call   1030 <WaitForAckNak@plt>
cmp    $0x6,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WaitForInitialAck>:
push   %rax
mov    $0x2710,%edi
call   1030 <WaitForAckNak@plt>
xor    %ecx,%ecx
cmp    $0x6,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @WaitForInitialAck() {
%1 = call i32 @WaitForAckNak(i32 10000)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @WaitForInitialAck() {
%1 = tail call i32 @WaitForAckNak(i32 10000)
%2 = icmp eq i32 %1, 6
%3 = zext i1 %2 to i32
ret i32 %3
}
void rop3_44_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D | S;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


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

x86 assembly (clang, -O2):
<rop3_44_1_0>:
or     %edx,%esi
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_44_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %5, %4
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_head_licence();
int /*<<< orphan*/ printf(char *);
void print_head() {
  print_head_licence();
  printf("****                      LFMM Version 1.1                     "
         "			*****\n"
         "****   E. Frichot, S. Schoville, G. Bouchard, O. Francois       "
         "		*****\n"
         "****         	        Please cite our paper !                 "
         "	     	*****\n"
         "****   Information at "
         "http://membres-timc.imag.fr/Olivier.Francois/lfmm/	*****\n\n");
}


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

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

LLVM IR (-O0):
@.str = [300 x i8] c"**** LFMM Version 1.1 \09\09\09*****\0A**** E. Frichot, S. Schoville, G. Bouchard, O. Francois \09\09*****\0A**** \09 Please cite our paper ! \09 \09*****\0A**** Information at http://membres-timc.imag.fr/Olivier.Francois/lfmm/\09*****\0A\0A\00"
define void @print_head() {
%1 = call i32 (...) @print_head_licence()
%2 = call i32 @printf(i8* getelementptr inbounds ([300 x i8], [300 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [299 x i8] c"**** LFMM Version 1.1 \09\09\09*****\0A**** E. Frichot, S. Schoville, G. Bouchard, O. Francois \09\09*****\0A**** \09 Please cite our paper ! \09 \09*****\0A**** Information at http://membres-timc.imag.fr/Olivier.Francois/lfmm/\09*****\0A\00"
define void @print_head() {
%1 = tail call i32 (...) @print_head_licence()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([299 x i8], [299 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/, int);
void test_unary_minus(int i) { __emit_expression_range(0, -i); }


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

x86 assembly (clang, -O2):
<test_unary_minus>:
mov    %edi,%esi
neg    %esi
xor    %edi,%edi
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_unary_minus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = call i32 @__emit_expression_range(i32 0, i32 %4)
ret void
}

LLVM IR (-O2):
define void @test_unary_minus(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = tail call i32 @__emit_expression_range(i32 0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
int bool_value(char *value) {
  if (!strcasecmp(value, "yes") || !strcasecmp(value, "true"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<bool_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
je     114e <bool_value+0x3e>
mov    -0x10(%rbp),%rdi
lea    0xec4(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    115a <bool_value+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <bool_value+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bool_value>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     113e <bool_value+0x2e>
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"yes\00"
@.str.1 = [5 x i8] c"true\00"
define i32 @bool_value(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcasecmp(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @strcasecmp(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %7, %1
store i32 1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [4 x i8] c"yes\00"
@.str.1 = [5 x i8] c"true\00"
define i32 @bool_value(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ removeSpaces(char *);
int main() {
  char str[] = "g  eeks     for ge  eeks  ";
  removeSpaces(str);
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec1(%rip),%ax
mov    %ax,-0x8(%rbp)
mov    0xeb9(%rip),%al
mov    %al,-0x6(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <removeSpaces@plt>
lea    -0x20(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xedf(%rip),%xmm0
movups %xmm0,0xb(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <removeSpaces@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [27 x i8] c"g eeks for ge eeks \00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [27 x i8]
store i32 0, i32* %1
%3 = bitcast [27 x i8]* %2 to i8*
%4 = getelementptr inbounds [27 x i8], [27 x i8]* %2, i64 0, i64 0
%5 = call i32 @removeSpaces(i8* %4)
%6 = getelementptr inbounds [27 x i8], [27 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [27 x i8] c"g eeks for ge eeks \00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [27 x i8]
%2 = getelementptr inbounds [27 x i8], [27 x i8]* %1, i64 0, i64 0
%3 = call i32 @removeSpaces(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ PASS(char *);
int main() {
  PASS("insert-libraries-weak-symbols");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"insert-libraries-weak-symbols\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @PASS(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [30 x i8] c"insert-libraries-weak-symbols\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @PASS(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printc(int /*<<< orphan*/ *, int);
void printo(FILE *fp, int n) {
  printc(fp, '0' + ((n >> 6) & 03));
  printc(fp, '0' + ((n >> 3) & 07));
  printc(fp, '0' + (n & 07));
}


x86 assembly (clang, -O0):
<printo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x6,%esi
and    $0x3,%esi
add    $0x30,%esi
call   1030 <printc@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x3,%esi
and    $0x7,%esi
add    $0x30,%esi
call   1030 <printc@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0x7,%esi
add    $0x30,%esi
call   1030 <printc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printo>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
shr    $0x6,%esi
and    $0x3,%esi
or     $0x30,%esi
call   1030 <printc@plt>
mov    %ebx,%esi
shr    $0x3,%esi
and    $0x7,%esi
or     $0x30,%esi
mov    %r14,%rdi
call   1030 <printc@plt>
and    $0x7,%ebx
or     $0x30,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printc@plt>

LLVM IR (-O0):
define void @printo(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 = ashr i32 %6, 6
%8 = and i32 %7, 3
%9 = add nsw i32 48, %8
%10 = call i32 @printc(i32* %5, i32 %9)
%11 = load i32*, i32** %3
%12 = load i32, i32* %4
%13 = ashr i32 %12, 3
%14 = and i32 %13, 7
%15 = add nsw i32 48, %14
%16 = call i32 @printc(i32* %11, i32 %15)
%17 = load i32*, i32** %3
%18 = load i32, i32* %4
%19 = and i32 %18, 7
%20 = add nsw i32 48, %19
%21 = call i32 @printc(i32* %17, i32 %20)
ret void
}

LLVM IR (-O2):
define void @printo(i32* %0, i32 %1) {
%3 = lshr i32 %1, 6
%4 = and i32 %3, 3
%5 = or i32 %4, 48
%6 = tail call i32 @printc(i32* %0, i32 %5)
%7 = lshr i32 %1, 3
%8 = and i32 %7, 7
%9 = or i32 %8, 48
%10 = tail call i32 @printc(i32* %0, i32 %9)
%11 = and i32 %1, 7
%12 = or i32 %11, 48
%13 = tail call i32 @printc(i32* %0, i32 %12)
ret void
}
/* Variables and functions */
float sin(float);
float func(float x) { return (x * x) * (x * x - 2.0) * sin(x); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xebf(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xedc(%rip),%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
call   1030 <sin@plt>
cvtss2sd %xmm0,%xmm0
mulsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @func(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = load float, float* %2
%8 = load float, float* %2
%9 = fmul float %7, %8
%10 = fpext float %9 to double
%11 = fsub double %10, 2.000000e+00
%12 = fmul double %6, %11
%13 = load float, float* %2
%14 = call float @sin(float %13)
%15 = fpext float %14 to double
%16 = fmul double %12, %15
%17 = fptrunc double %16 to float
ret float %17
}

LLVM IR (-O2):
define float @func(float %0) {
%2 = fmul float %0, %0
%3 = fpext float %2 to double
%4 = fadd double %3, -2.000000e+00
%5 = fmul double %4, %3
%6 = tail call float @sin(float %0)
%7 = fpext float %6 to double
%8 = fmul double %5, %7
%9 = fptrunc double %8 to float
ret float %9
}
double calcBoxVol(float Length) { return Length * Length * Length; }


x86 assembly (clang, -O0):
<calcBoxVol>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcBoxVol>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calcBoxVol(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = load float, float* %2
%7 = fmul float %5, %6
%8 = fpext float %7 to double
ret double %8
}

LLVM IR (-O2):
define double @calcBoxVol(float %0) {
%2 = fmul float %0, %0
%3 = fmul float %2, %0
%4 = fpext float %3 to double
ret double %4
}
/* Variables and functions */
int abs(double);
int dequals(double a, double b) {
  int thresh = 1e-9;
  return (abs(a - b) < thresh);
}


x86 assembly (clang, -O0):
<dequals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <abs@plt>
cmp    -0x14(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dequals>:
push   %rax
subsd  %xmm1,%xmm0
call   1030 <abs@plt>
shr    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dequals(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
store double %1, double* %4
store i32 0, i32* %5
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fsub double %6, %7
%9 = call i32 @abs(double %8)
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @dequals(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call i32 @abs(double %3)
%5 = lshr i32 %4, 31
ret i32 %5
}
char *strip(cp)
char *cp;
{
  register char *dp = cp;
  while (*dp++ &= 0177)
    continue;
  return (cp);
}


x86 assembly (clang, -O0):
<strip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
movsbl (%rcx),%eax
and    $0x7f,%eax
mov    %al,(%rcx)
cmp    $0x0,%al
je     1134 <strip+0x34>
jmp    1110 <strip+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
andb   $0x7f,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strip+0x10>
ret

LLVM IR (-O0):
define i8* @strip(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %13, %1
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %3
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = and i32 %9, 127
%11 = trunc i32 %10 to i8
store i8 %11, i8* %6
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @strip(i8* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = and i8 %5, 127
store i8 %6, i8* %3
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ pop();
int /*<<< orphan*/ print();
int /*<<< orphan*/ push(int);
int main() {
  push(7);
  push(6);
  push(5);
  push(4);
  print();
  pop();
  print();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1050 <push@plt>
mov    $0x6,%edi
call   1050 <push@plt>
mov    $0x5,%edi
call   1050 <push@plt>
mov    $0x4,%edi
call   1050 <push@plt>
xor    %eax,%eax
call   1030 <print@plt>
xor    %eax,%eax
call   1040 <pop@plt>
xor    %eax,%eax
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @push(i32 7)
%3 = call i32 @push(i32 6)
%4 = call i32 @push(i32 5)
%5 = call i32 @push(i32 4)
%6 = call i32 (...) @print()
%7 = call i32 (...) @pop()
%8 = call i32 (...) @print()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @push(i32 7)
%2 = tail call i32 @push(i32 6)
%3 = tail call i32 @push(i32 5)
%4 = tail call i32 @push(i32 4)
%5 = tail call i32 (...) @print()
%6 = tail call i32 (...) @pop()
%7 = tail call i32 (...) @print()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello and welcome\n");
  getch();
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"hello and welcome\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"hello and welcome\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getch()
ret i32 0
}
/* Variables and functions */
float ANTweenTimingFunctionQuartOut(float, int /*<<< orphan*/, int, float);
float ANTweenProgressTimingFunctionQuartOut(float time, float duration) {
  return ANTweenTimingFunctionQuartOut(time, 0, 1, duration);
}


x86 assembly (clang, -O0):
<ANTweenProgressTimingFunctionQuartOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <ANTweenTimingFunctionQuartOut@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenProgressTimingFunctionQuartOut>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <ANTweenTimingFunctionQuartOut@plt>

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

LLVM IR (-O2):
define float @ANTweenProgressTimingFunctionQuartOut(float %0, float %1) {
%3 = tail call float @ANTweenTimingFunctionQuartOut(float %0, i32 0, i32 1, float %1)
ret float %3
}
int test_imm_05uint8_mem(unsigned char *val) {
  return ((*val) & (0x05 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_05uint8_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, 5
%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_05uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 5
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ terminal_putchar(char const);
int /*<<< orphan*/ terminal_setcolor(int /*<<< orphan*/);
void printf(uint8_t color, const char *str) {
  terminal_setcolor(color);
  size_t len = strlen(str);
  for (size_t i = 0; i < len; i++)
    terminal_putchar(str[i]);
}


x86 assembly (clang, -O0):
<printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <terminal_setcolor@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    118c <printf+0x5c>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <terminal_putchar@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    115c <printf+0x2c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
call   1050 <terminal_setcolor@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
test   %rax,%rax
je     1163 <printf+0x33>
mov    %rax,%r15
xor    %ebx,%ebx
nop
movsbl (%r14,%rbx,1),%edi
call   1040 <terminal_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1150 <printf+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @printf(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @terminal_setcolor(i32 %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %7, %2
ret void
7: ; preds = %2, %7
%8 = phi i64 [ %12, %7 ], [ 0, %2 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @terminal_putchar(i8 signext %10)
%12 = add nuw i64 %8, 1
%13 = icmp eq i64 %12, %4
br i1 %13, label %6, label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *pslr_hexdump(int /*<<< orphan*/ *, int /*<<< orphan*/);
void hexdump(uint8_t *buf, uint32_t bufLen) {
  char *dmp = pslr_hexdump(buf, bufLen);
  printf("%s", dmp);
  free(dmp);
}


x86 assembly (clang, -O0):
<hexdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <pslr_hexdump@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdump>:
push   %rbx
call   1050 <pslr_hexdump@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @hexdump(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i8* @pslr_hexdump(i32* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @hexdump(i32* %0, i32 %1) {
%3 = tail call i8* @pslr_hexdump(i32* %0, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %3)
ret void
}
int hibr_should_record_wav() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hibr_should_record_wav() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_report(char *, int *);
void colamd_report(int stats[20]) { print_report("colamd", stats); }


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

x86 assembly (clang, -O2):
<colamd_report>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <print_report@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"colamd\00"
define void @colamd_report(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @print_report(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"colamd\00"
define void @colamd_report(i32* %0) {
%2 = tail call i32 @print_report(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
void func(const char *a) {
  char buffer[10];
  strcpy(buffer, a);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
sub    $0x18,%rsp
mov    %rdi,%rsi
lea    0xe(%rsp),%rdi
call   1030 <strcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @func(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
define void @func(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_flttoflt_d_flt(double *, float);
double xil_fpo_flttoflt_d_flt(float a) {
  double res_d;
  xip_fpo_flttoflt_d_flt(&res_d, a);
  return res_d;
}


x86 assembly (clang, -O0):
<xil_fpo_flttoflt_d_flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
call   1030 <xip_fpo_flttoflt_d_flt@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_flttoflt_d_flt>:
push   %rax
mov    %rsp,%rdi
call   1030 <xip_fpo_flttoflt_d_flt@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @xil_fpo_flttoflt_d_flt(float %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @xip_fpo_flttoflt_d_flt(double* %2, float %0)
%5 = load double, double* %2
ret double %5
}
/* Variables and functions */
int numr(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", numr(50));
  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    $0x32,%edi
call   1030 <numr@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\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 = call i32 @numr(i32 50)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @numr(i32 50)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
_Bool Long__LT_(long x, long y) { return x < y; }


x86 assembly (clang, -O0):
<Long__LT_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Long__LT_>:
cmp    %rsi,%rdi
setl   %al
ret

LLVM IR (-O0):
define zeroext i1 @Long__LT_(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @Long__LT_(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
ret i1 %3
}
/* Variables and functions */
int /*<<< orphan*/ GSL_PUT_JXXX(char *, char *, int, int);
void GSL_PUT_JZERO(char *name, int line_number) {
  GSL_PUT_JXXX(name, "jzero.i", 29, line_number);
}


x86 assembly (clang, -O0):
<GSL_PUT_JZERO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
lea    0xed3(%rip),%rsi
mov    $0x1d,%edx
call   1030 <GSL_PUT_JXXX@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GSL_PUT_JZERO>:
mov    %esi,%ecx
lea    0xee7(%rip),%rsi
mov    $0x1d,%edx
jmp    1030 <GSL_PUT_JXXX@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"jzero.i\00"
define void @GSL_PUT_JZERO(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @GSL_PUT_JXXX(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 29, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"jzero.i\00"
define void @GSL_PUT_JZERO(i8* %0, i32 %1) {
%3 = tail call i32 @GSL_PUT_JXXX(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 29, i32 %1)
ret void
}
void proc33() {}


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

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

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

LLVM IR (-O2):
define void @proc33() {
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int c;
  int n = 0;
  while ((c = getchar()) != '\n') {
    n++;
  }
  printf("El número de caracteres es %d\n", n);
}


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
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%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 = [32 x i8] c"El n\C3\BAmero de caracteres es %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 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [32 x i8] c"El n\C3\BAmero de caracteres es %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 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
char *getenv(char const *);
int /*<<< orphan*/ stderr;
const char *getenv_or_die(const char *key) {
  const char *val;
  val = getenv(key);
  if (!val) {
    fprintf(stderr,
            "You must set the environment variable "
            "%s for this program.\n",
            key);
    exit(EXIT_FAILURE);
  }
  return val;
}


x86 assembly (clang, -O0):
<getenv_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117b <getenv_or_die+0x4b>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv_or_die>:
push   %rbx
mov    %rdi,%rbx
call   1030 <getenv@plt>
test   %rax,%rax
je     1140 <getenv_or_die+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"You must set the environment variable %s for this program.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @getenv_or_die(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getenv(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"You must set the environment variable %s for this program.\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @getenv_or_die(i8* %0) {
%2 = tail call i8* @getenv(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
int egsy_gcm_mult_lenc_msb_csr_debug_set(
    unsigned int dev_id, union egsy_gcm_mult_lenc_msb_csr_debug_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.egsy_gcm_mult_lenc_msb_csr_debug_u = type opaque
define i32 @egsy_gcm_mult_lenc_msb_csr_debug_set(i32 %0, %union.egsy_gcm_mult_lenc_msb_csr_debug_u* %1) {
%3 = alloca i32
%4 = alloca %union.egsy_gcm_mult_lenc_msb_csr_debug_u*
store i32 %0, i32* %3
store %union.egsy_gcm_mult_lenc_msb_csr_debug_u* %1, %union.egsy_gcm_mult_lenc_msb_csr_debug_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.egsy_gcm_mult_lenc_msb_csr_debug_u = type opaque
define i32 @egsy_gcm_mult_lenc_msb_csr_debug_set(i32 %0, %union.egsy_gcm_mult_lenc_msb_csr_debug_u* nocapture readnone %1) {
ret i32 1
}