xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SysCtlClockOutConfig(uint32_t ui32Config, uint32_t ui32Div) {
  ;

  ;
  (*((volatile uint32_t *)(0x400FE148))) =
      ui32Config | ((ui32Div - 1) & 0x000000FF);
}


x86 assembly (clang, -O0):
<SysCtlClockOutConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
and    $0xff,%eax
or     %eax,%ecx
mov    $0x400fe148,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlClockOutConfig>:
add    $0xffffffff,%esi
movzbl %sil,%eax
or     %edi,%eax
mov    %eax,0x400fe148
ret

LLVM IR (-O0):
define void @SysCtlClockOutConfig(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 = sub nsw i32 %6, 1
%8 = and i32 %7, 255
%9 = or i32 %5, %8
store volatile i32 %9, i32* inttoptr (i64 1074782536 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysCtlClockOutConfig(i32 %0, i32 %1) {
%3 = add i32 %1, 255
%4 = and i32 %3, 255
%5 = or i32 %4, %0
store volatile i32 %5, i32* inttoptr (i64 1074782536 to i32*)
ret void
}
int this_is_the_coolest_func() {
  int a = 2;
  int b = 7;
  int c = a + b;
  return c;
}


x86 assembly (clang, -O0):
<this_is_the_coolest_func>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @this_is_the_coolest_func() {
ret i32 9
}
int main() {
  int p1, p2;
  int x1, y1;
  {
    if (p1)
      x1 = 0;
    else
      x1 = 0;
  };
  {
    if (p2)
      y1 = 0;
    else
      y1 = 23456789;
  };
  while (y1 > x1) {
    y1 = y1 >> 1;
  }
  return y1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1121 <main+0x21>
movl   $0x0,-0x10(%rbp)
jmp    1128 <main+0x28>
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     113e <main+0x3e>
movl   $0x0,-0x14(%rbp)
jmp    1145 <main+0x45>
movl   $0x165ec15,-0x14(%rbp)
jmp    114a <main+0x4a>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1164 <main+0x64>
mov    -0x14(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114a <main+0x4a>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 0, i32* %4
br label %10
9: ; preds = %0
store i32 0, i32* %4
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 0, i32* %5
br label %15
14: ; preds = %10
store i32 23456789, i32* %5
br label %15
15: ; preds = %14, %13
br label %16
16: ; preds = %20, %15
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32, i32* %5
%22 = ashr i32 %21, 1
store i32 %22, i32* %5
br label %16
23: ; preds = %16
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
einit() {}


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

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

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

LLVM IR (-O2):
define i32 @einit() {
ret i32 undef
}
/* Variables and functions */
int strlen(char *);
int append(char *s, size_t size, char c) {
  if (strlen(s) + 1 >= size)
    return 1;
  int l = strlen(s);
  s[l] = c;
  s[l + 1] = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
cmp    -0x18(%rbp),%rax
jb     1149 <append+0x39>
movl   $0x1,-0x4(%rbp)
jmp    117b <append+0x6b>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x19(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rcx
mov    $0x1,%eax
cmp    %rbp,%rcx
jae    1147 <append+0x37>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
mov    %r14b,(%rbx,%rax,1)
movb   $0x0,0x1(%rbx,%rax,1)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @append(i8* %0, i64 %1, i8 signext %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = icmp ult i64 %6, %1
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = tail call i32 @strlen(i8* %0)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 %2, i8* %11
%12 = add nsw i32 %9, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 0, i8* %14
br label %15
15: ; preds = %3, %8
%16 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %16
}
/* Variables and functions */
float atan2f(float, float);
float HMM_ATan2F(float Left, float Right) {
  float Result = atan2f(Left, Right);
  return (Result);
}


x86 assembly (clang, -O0):
<HMM_ATan2F>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <atan2f@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HMM_ATan2F>:
jmp    1030 <atan2f@plt>

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

LLVM IR (-O2):
define float @HMM_ATan2F(float %0, float %1) {
%3 = tail call float @atan2f(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ perror(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int tcpsock_create() {
  int fd;
  fd = socket(AF_INET, SOCK_STREAM, 0);
  if (fd == -1) {
    perror("socket");
    return -1;
  }
  return fd;
}


x86 assembly (clang, -O0):
<tcpsock_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1166 <tcpsock_create+0x46>
lea    0xeab(%rip),%rdi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <tcpsock_create+0x4c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpsock_create>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1145 <tcpsock_create+0x25>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb4(%rip),%rdi
call   1030 <perror@plt>
jmp    1141 <tcpsock_create+0x21>

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

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [7 x i8] c"socket\00"
define i32 @tcpsock_create() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %0, %5
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ GetIniKeyString(char *, char *, char *);
int atoi(int /*<<< orphan*/);
int GetIniKeyInt(char *title, char *key, char *filename) {
  return atoi(GetIniKeyString(title, key, filename));
}


x86 assembly (clang, -O0):
<GetIniKeyInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <GetIniKeyString@plt>
mov    %eax,%edi
call   1030 <atoi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetIniKeyInt>:
push   %rax
call   1040 <GetIniKeyString@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <atoi@plt>

LLVM IR (-O0):
define i32 @GetIniKeyInt(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @GetIniKeyString(i8* %7, i8* %8, i8* %9)
%11 = call i32 @atoi(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @GetIniKeyInt(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @GetIniKeyString(i8* %0, i8* %1, i8* %2)
%5 = tail call i32 @atoi(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World\n");
  printf("This is a speed course in C\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
@.str.1 = [29 x i8] c"This is a speed course in C\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 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
@str.2 = [28 x i8] c"This is a speed course in C\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int close(int);
int fclose(int i) { return close(i); }


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

x86 assembly (clang, -O2):
<fclose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @fclose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
double relativeError(double, double);
double errorBase(double A, double errorA, double B, double errorB) {
  return (relativeError(A, errorA) + relativeError(B, errorB));
}


x86 assembly (clang, -O0):
<errorBase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <relativeError@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <relativeError@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorBase>:
sub    $0x18,%rsp
movsd  %xmm3,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
call   1030 <relativeError@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1030 <relativeError@plt>
addsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @errorBase(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = call double @relativeError(double %9, double %10)
%12 = load double, double* %7
%13 = load double, double* %8
%14 = call double @relativeError(double %12, double %13)
%15 = fadd double %11, %14
ret double %15
}

LLVM IR (-O2):
define double @errorBase(double %0, double %1, double %2, double %3) {
%5 = tail call double @relativeError(double %0, double %1)
%6 = tail call double @relativeError(double %2, double %3)
%7 = fadd double %5, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ arith_prog_1();
int main(int argc, char *argv[]) {
  arith_prog_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    $0x0,%al
call   1030 <arith_prog_1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @arith_prog_1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cmd_error() {
  printf("**** Invalid command. Type \"help\" for command list\n");
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"**** Invalid command. Type \22help\22 for command list\0A\00"
define void @cmd_error() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"**** Invalid command. Type \22help\22 for command list\00"
define void @cmd_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int mulInt(int n, int m) {
  printf("m = %d,n = %d \n", m, n);
  return n * m;
}


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

x86 assembly (clang, -O2):
<mulInt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
mov    %ebp,%edx
call   1030 <printf@plt>
imul   %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"m = %d,n = %d \0A\00"
define i32 @mulInt(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = mul nsw i32 %1, %0
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ debug_data(char const *, int);
int /*<<< orphan*/ debug_uint(int);
void debug_int(int64_t n) {
  uint64_t u;
  if (n >= 0) {
    u = n;
  } else {
    const char sign[1] = {'-'};
    debug_data(sign, sizeof sign);
    u = ~n + 1;
  }
  debug_uint(u);
}


x86 assembly (clang, -O0):
<debug_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1140 <debug_int+0x20>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1163 <debug_int+0x43>
mov    0xeba(%rip),%al
mov    %al,-0x9(%rbp)
lea    -0x9(%rbp),%rdi
mov    $0x1,%esi
call   1040 <debug_data@plt>
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <debug_uint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_int>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
test   %edi,%edi
jns    1141 <debug_int+0x21>
movb   $0x2d,0xf(%rsp)
lea    0xf(%rsp),%rdi
mov    $0x1,%esi
call   1040 <debug_data@plt>
neg    %ebx
mov    %ebx,%edi
call   1030 <debug_uint@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.debug_int.sign = [1 x i8] c"-"
define void @debug_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [1 x i8]
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %2
store i32 %8, i32* %3
br label %16
9: ; preds = %1
%10 = bitcast [1 x i8]* %4 to i8*
%11 = getelementptr inbounds [1 x i8], [1 x i8]* %4, i64 0, i64 0
%12 = call i32 @debug_data(i8* %11, i32 1)
%13 = load i32, i32* %2
%14 = xor i32 %13, -1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %16
16: ; preds = %9, %7
%17 = load i32, i32* %3
%18 = call i32 @debug_uint(i32 %17)
ret void
}

LLVM IR (-O2):
define void @debug_int(i32 %0) {
%2 = alloca [1 x i8]
%3 = icmp sgt i32 %0, -1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
store i8 45, i8* %5
%6 = call i32 @debug_data(i8* %5, i32 1)
%7 = sub i32 0, %0
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ %0, %1 ]
%10 = call i32 @debug_uint(i32 %9)
ret void
}
/* Variables and functions */
double fabs(double);
double f3(double x, double y) { return fabs(-x * (x * x - 3.) / (y * y * y)); }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xed0(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movaps 0xe9e(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
mulsd  %xmm0,%xmm0
addsd  0xf08(%rip),%xmm0
mulsd  %xmm2,%xmm0
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
andpd  0xedc(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @f3(double %0, double %1) {
%3 = fneg double %0
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -3.000000e+00)
%5 = fmul double %4, %3
%6 = fmul double %1, %1
%7 = fmul double %6, %1
%8 = fdiv double %5, %7
%9 = tail call double @llvm.fabs.f64(double %8)
ret double %9
}
/* Variables and functions */
int MAP_ANONYMOUS;
int MAP_PRIVATE;
void *mmap_helper(void *, size_t, int *, int, int, int /*<<< orphan*/, int,
                  int);
void *create_priv_anon_mem(void *addr_hint, size_t len, int *access,
                           int page_size, bool touch) {
  int flags;
  flags = (MAP_ANONYMOUS | MAP_PRIVATE);
  return mmap_helper(addr_hint, len, access, flags, -1, 0, page_size, touch);
}


x86 assembly (clang, -O0):
<create_priv_anon_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    0x2e9d(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x1c(%rbp),%r10d
mov    -0x20(%rbp),%eax
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <mmap_helper@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_priv_anon_mem>:
push   %rax
mov    %r8d,%eax
mov    %ecx,%r10d
mov    0x2eca(%rip),%r8
mov    0x2eb3(%rip),%rcx
mov    (%rcx),%ecx
or     (%r8),%ecx
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
push   %rax
push   %r10
call   1030 <mmap_helper@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
@MAP_ANONYMOUS = global i32 0
@MAP_PRIVATE = global i32 0
define i8* @create_priv_anon_mem(i8* %0, i64 %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8* %0, i8** %6
store i64 %1, i64* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* @MAP_ANONYMOUS
%13 = load i32, i32* @MAP_PRIVATE
%14 = or i32 %12, %13
store i32 %14, i32* %11
%15 = load i8*, i8** %6
%16 = load i64, i64* %7
%17 = load i32*, i32** %8
%18 = load i32, i32* %11
%19 = load i32, i32* %9
%20 = load i32, i32* %10
%21 = call i8* @mmap_helper(i8* %15, i64 %16, i32* %17, i32 %18, i32 -1, i32 0, i32 %19, i32 %20)
ret i8* %21
}

LLVM IR (-O2):
@MAP_ANONYMOUS = global i32 0
@MAP_PRIVATE = global i32 0
define i8* @create_priv_anon_mem(i8* %0, i64 %1, i32* %2, i32 %3, i32 %4) {
%6 = load i32, i32* @MAP_ANONYMOUS
%7 = load i32, i32* @MAP_PRIVATE
%8 = or i32 %7, %6
%9 = tail call i8* @mmap_helper(i8* %0, i64 %1, i32* %2, i32 %8, i32 -1, i32 0, i32 %3, i32 %4)
ret i8* %9
}
int test_imm_99uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x99 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_99uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 153
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
size_t max_size(size_t a, size_t b) { return (((a) > (b)) ? (a) : (b)); }


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

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

LLVM IR (-O0):
define i64 @max_size(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 ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max_size(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int vect_mus_audio_close(int);
int mus_audio_close(int id) { return (vect_mus_audio_close(id)); }


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

x86 assembly (clang, -O2):
<mus_audio_close>:
jmp    1030 <vect_mus_audio_close@plt>

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

LLVM IR (-O2):
define i32 @mus_audio_close(i32 %0) {
%2 = tail call i32 @vect_mus_audio_close(i32 %0)
ret i32 %2
}
/* Variables and functions */
unsigned long fib(unsigned long);
int main() {
  unsigned long IMax;
  volatile unsigned long value;
  IMax = 30;
  value = fib(IMax);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x1e,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fib@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1e,%edi
call   1030 <fib@plt>
mov    %rax,(%rsp)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 30, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @fib(i64 %4)
store volatile i64 %5, i64* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i64 @fib(i64 30)
store volatile i64 %3, i64* %1
ret i32 0
}
int test_imm_81int32_mem(int *val) {
  return ((*val) & (0x81 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_81int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 129
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int pinyin_strncmp(unsigned short const *, unsigned short const *, int);
int pinyin_strcmp(const unsigned short *str1, const unsigned short *str2) {
  return pinyin_strncmp(str1, str2, -1);
}


x86 assembly (clang, -O0):
<pinyin_strcmp>:
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    $0xffffffff,%edx
call   1030 <pinyin_strncmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pinyin_strcmp>:
mov    $0xffffffff,%edx
jmp    1030 <pinyin_strncmp@plt>

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

LLVM IR (-O2):
define i32 @pinyin_strcmp(i16* %0, i16* %1) {
%3 = tail call i32 @pinyin_strncmp(i16* %0, i16* %1, i32 -1)
ret i32 %3
}
void CFGMR3InsertStringF(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3InsertStringF() {
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int micomapp_main(int argc, char **argv) {
  int ret;
  while (1) {
    sleep(300);
    printf("[%d] MICOM ALIVE\n", getpid());
  }
  return 0;
}


x86 assembly (clang, -O0):
<micomapp_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x12c,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <micomapp_main+0xf>

x86 assembly (clang, -O2):
<micomapp_main>:
push   %rbx
lea    0xec8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x12c,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
jmp    1140 <micomapp_main+0x10>

LLVM IR (-O0):
@.str = [18 x i8] c"[%d] MICOM ALIVE\0A\00"
define i32 @micomapp_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
br label %6
6: ; preds = %2, %6
%7 = call i32 @sleep(i32 300)
%8 = call i32 (...) @getpid()
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %6
}

LLVM IR (-O2):
@.str = [18 x i8] c"[%d] MICOM ALIVE\0A\00"
define i32 @micomapp_main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @sleep(i32 300)
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %3
}
int check_if(int r, int num) {
  int rem;
  while (num) {
    rem = num % 10;
    if (rem == r) {
      return 1;
    }
    num = num / 10;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_if>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114d <check_if+0x4d>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113a <check_if+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1154 <check_if+0x54>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    110a <check_if+0xa>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_if>:
xor    %eax,%eax
test   %esi,%esi
je     113f <check_if+0x3f>
cs nopw 0x0(%rax,%rax,1)
movslq %esi,%r8
imul   $0x66666667,%r8,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,1),%edx
lea    (%rdx,%rdx,4),%edx
sub    %edx,%r8d
cmp    %edi,%r8d
je     1140 <check_if+0x40>
add    $0x9,%esi
cmp    $0x12,%esi
mov    %ecx,%esi
ja     1110 <check_if+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @check_if(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i32 [ %7, %9 ], [ %1, %2 ]
%6 = srem i32 %5, 10
%7 = sdiv i32 %5, 10
%8 = icmp eq i32 %6, %0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i32 [ 0, %2 ], [ 0, %9 ], [ 1, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ obfuscated_write(int, char *, size_t);
size_t strlen(char *);
void writestr(int fd, char *s) {
  size_t len = strlen(s);
  obfuscated_write(fd, s, len);
}


x86 assembly (clang, -O0):
<writestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <obfuscated_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writestr>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <obfuscated_write@plt>

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

LLVM IR (-O2):
define void @writestr(i32 %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = tail call i32 @obfuscated_write(i32 %0, i8* %1, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned int);
void sort_swp(void *a, void *b, unsigned int el_size, void *hold) {
  memcpy(hold, a, el_size);
  memcpy(a, b, el_size);
  memcpy(b, hold, el_size);
}


x86 assembly (clang, -O0):
<sort_swp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_swp>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rcx,%rdi
mov    %rbx,%rsi
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @sort_swp(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %7
%12 = call i32 @memcpy(i8* %9, i8* %10, i32 %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = call i32 @memcpy(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %6
%18 = load i8*, i8** %8
%19 = load i32, i32* %7
%20 = call i32 @memcpy(i8* %17, i8* %18, i32 %19)
ret void
}

LLVM IR (-O2):
define void @sort_swp(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @memcpy(i8* %3, i8* %0, i32 %2)
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
%7 = tail call i32 @memcpy(i8* %1, i8* %3, i32 %2)
ret void
}
OP(fd, ef) { op_ef(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_ef()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ cputs(char *);
int main() {
  cputs("Hello 6502 world from C!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Hello 6502 world from C!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @cputs(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Hello 6502 world from C!\0A\00"
define i32 @main() {
%1 = tail call i32 @cputs(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void usage() {
  printf("%cUsage: matched_pair [-l left_bracket_character]", 10);
  printf(" [-r right_bracket_character] [-v] [-h]%c", 10);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xf09(%rip),%rdi
mov    $0xa,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"%cUsage: matched_pair [-l left_bracket_character]\00"
@.str.1 = [42 x i8] c" [-r right_bracket_character] [-v] [-h]%c\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 10)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"%cUsage: matched_pair [-l left_bracket_character]\00"
@.str.1 = [42 x i8] c" [-r right_bracket_character] [-v] [-h]%c\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 10)
ret void
}
void XtAppAddActions() {}


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

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

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

LLVM IR (-O2):
define void @XtAppAddActions() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_set1_epi64x(long long);
__m128i test_mm_set1_epi64x(long long A) { return _mm_set1_epi64x(A); }


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

x86 assembly (clang, -O2):
<test_mm_set1_epi64x>:
jmp    1030 <_mm_set1_epi64x@plt>

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

LLVM IR (-O2):
define i32 @test_mm_set1_epi64x(i64 %0) {
%2 = tail call i32 @_mm_set1_epi64x(i64 %0)
ret i32 %2
}
/* Variables and functions */
int leastCommonMultipleFromNtoN(unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, int);
void problem5(unsigned lowerBound, unsigned upperBound) {
  printf("Problem 5: The smallest positive number that is evenly divisible "
         "by all of the numbers from %u to %u is %u.\n",
         lowerBound, upperBound,
         leastCommonMultipleFromNtoN(lowerBound, upperBound));
}


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

x86 assembly (clang, -O2):
<problem5>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <leastCommonMultipleFromNtoN@plt>
lea    0xecd(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [109 x i8] c"Problem 5: The smallest positive number that is evenly divisible by all of the numbers from %u to %u is %u.\0A\00"
define void @problem5(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 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @leastCommonMultipleFromNtoN(i32 %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [109 x i8] c"Problem 5: The smallest positive number that is evenly divisible by all of the numbers from %u to %u is %u.\0A\00"
define void @problem5(i32 %0, i32 %1) {
%3 = tail call i32 @leastCommonMultipleFromNtoN(i32 %0, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %3)
ret void
}
int sys$dellnm(void *tabnam, void *lognam, unsigned char *acmode) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(acmode);
    register long int _a2 asm("rsi") = (long)(lognam);
    register long int _a1 asm("rdi") = (long)(tabnam);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(39), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$dellnm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x27,%rax
int    $0x81
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$dellnm>:
mov    $0x27,%rax
int    $0x81
ret

LLVM IR (-O0):
define i32 @"sys$dellnm"(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load i8*, i8** %4
%17 = ptrtoint i8* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 39, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @"sys$dellnm"(i8* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 39, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}