xunge/DecIR huggingface dataset:
void fc148(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    goto a;
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
  a:;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc148(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
br label %18
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
br label %18
18: ; preds = %13, %1
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ _mm_cmplt_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmplt_pd(__m128d A, __m128d B) { return _mm_cmplt_pd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_cmplt_pd>:
jmp    1030 <_mm_cmplt_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmplt_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmplt_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ send_repl(int, char *);
void print_help(int sock) {
  send_repl(sock, "    Some help message.\r\n    Probably nobody needs help "
                  "from telnet.\r\n    See rfc959.\r\n");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <send_repl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
lea    0xee9(%rip),%rsi
jmp    1030 <send_repl@plt>

LLVM IR (-O0):
@.str = [87 x i8] c" Some help message.\0D\0A Probably nobody needs help from telnet.\0D\0A See rfc959.\0D\0A\00"
define void @print_help(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @send_repl(i32 %3, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [87 x i8] c" Some help message.\0D\0A Probably nobody needs help from telnet.\0D\0A See rfc959.\0D\0A\00"
define void @print_help(i32 %0) {
%2 = tail call i32 @send_repl(i32 %0, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str, i64 0, i64 0))
ret void
}
void vec_rhs(t, y, ydot, neq) double t, *y, *ydot;
int neq;
{}


x86 assembly (clang, -O0):
<vec_rhs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vec_rhs(double %0, double* %1, double* %2, i32 %3) {
%5 = alloca double
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
store double %0, double* %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @vec_rhs(double %0, double* nocapture %1, double* nocapture %2, i32 %3) {
ret void
}
/* Variables and functions */
int execv(int /*<<< orphan*/, char **);
int /*<<< orphan*/ path(char *);
extern int execvp(char *file, char **argv) { return execv(path(file), argv); }


x86 assembly (clang, -O0):
<execvp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <path@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <execv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execvp>:
push   %rbx
mov    %rsi,%rbx
call   1030 <path@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <execv@plt>

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

LLVM IR (-O2):
define i32 @execvp(i8* %0, i8** %1) {
%3 = tail call i32 @path(i8* %0)
%4 = tail call i32 @execv(i32 %3, i8** %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
long atoll(char *);
int main() {
  if (atoll("0") != 0L) {
    abort();
  }
  if (atoll("1") != 1L) {
    abort();
  }
  if (atoll("123456") != 123456L) {
    abort();
  }
  if (atoll("-123456") != -123456L) {
    abort();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <atoll@plt>
cmp    $0x0,%rax
je     1141 <main+0x21>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xeba(%rip),%rdi
call   1040 <atoll@plt>
cmp    $0x1,%rax
je     115e <main+0x3e>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xea0(%rip),%rdi
call   1040 <atoll@plt>
cmp    $0x1e240,%rax
je     117d <main+0x5d>
mov    $0x0,%al
call   1030 <abort@plt>
lea    0xe80(%rip),%rdi
call   1040 <atoll@plt>
cmp    $0xfffffffffffe1dc0,%rax
je     119c <main+0x7c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [7 x i8] c"123456\00"
@.str.3 = [8 x i8] c"-123456\00"
define i32 @main() {
%1 = call i64 @atoll(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = call i64 @atoll(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp ne i64 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = call i64 @atoll(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp ne i64 %11, 123456
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %10
%16 = call i64 @atoll(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%17 = icmp ne i64 %16, -123456
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_synthesis();
int /*<<< orphan*/ parameter_generation();
int /*<<< orphan*/ refresh();
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ text_analysis_file(char *);
int /*<<< orphan*/ unknown_com();
void setParsedText(char *rel, char *filename) {
  if (strcmp(rel, "=") == 0) {
    refresh();
    text_analysis_file(filename);
    parameter_generation();
    do_synthesis();
  } else {
    unknown_com();
  }
}


x86 assembly (clang, -O0):
<setParsedText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ad <setParsedText+0x4d>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    -0x10(%rbp),%rdi
call   1050 <text_analysis_file@plt>
mov    $0x0,%al
call   1060 <parameter_generation@plt>
mov    $0x0,%al
call   1080 <do_synthesis@plt>
jmp    11b4 <setParsedText+0x54>
mov    $0x0,%al
call   1030 <unknown_com@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setParsedText>:
push   %rbx
mov    %rsi,%rbx
lea    0xe95(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     117d <setParsedText+0x1d>
xor    %eax,%eax
pop    %rbx
jmp    1030 <unknown_com@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
mov    %rbx,%rdi
call   1050 <text_analysis_file@plt>
xor    %eax,%eax
call   1060 <parameter_generation@plt>
xor    %eax,%eax
pop    %rbx
jmp    1080 <do_synthesis@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
define void @setParsedText(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = call i32 (...) @refresh()
%10 = load i8*, i8** %4
%11 = call i32 @text_analysis_file(i8* %10)
%12 = call i32 (...) @parameter_generation()
%13 = call i32 (...) @do_synthesis()
br label %16
14: ; preds = %2
%15 = call i32 (...) @unknown_com()
br label %16
16: ; preds = %14, %8
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
define void @setParsedText(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 (...) @refresh()
%7 = tail call i32 @text_analysis_file(i8* %1)
%8 = tail call i32 (...) @parameter_generation()
%9 = tail call i32 (...) @do_synthesis()
br label %12
10: ; preds = %2
%11 = tail call i32 (...) @unknown_com()
br label %12
12: ; preds = %10, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RETN(int, int);
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_ED_0x75(void) {
  RETN(4, 7);
  T_WAIT_UNTIL(10);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0x75>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x7,%esi
call   1030 <RETN@plt>
mov    $0xa,%edi
call   1040 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0x75>:
push   %rax
mov    $0x4,%edi
mov    $0x7,%esi
call   1030 <RETN@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_ED_0x75() {
%1 = call i32 @RETN(i32 4, i32 7)
%2 = call i32 @T_WAIT_UNTIL(i32 10)
ret void
}

LLVM IR (-O2):
define void @op_ED_0x75() {
%1 = tail call i32 @RETN(i32 4, i32 7)
%2 = tail call i32 @T_WAIT_UNTIL(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void nullMsg(const char *msg, uint16_t recvtid) {}


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

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

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

LLVM IR (-O2):
define void @nullMsg(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ rozofs_get_service_port_geomgr_diag();
uint16_t rozofs_get_service_port_geocli_storcli_diag(int idx, int s) {
  return rozofs_get_service_port_geomgr_diag() + 1 + (3 * idx) + s;
}


x86 assembly (clang, -O0):
<rozofs_get_service_port_geocli_storcli_diag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rozofs_get_service_port_geomgr_diag@plt>
add    $0x1,%rax
imul   $0x3,-0x4(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rozofs_get_service_port_geocli_storcli_diag>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rozofs_get_service_port_geomgr_diag@plt>
lea    (%rbx,%rbx,2),%ecx
movslq %ecx,%rcx
movslq %ebp,%rdx
add    %rcx,%rdx
add    %rdx,%rax
add    $0x1,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i64 @rozofs_get_service_port_geocli_storcli_diag(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i64 (...) @rozofs_get_service_port_geomgr_diag()
%6 = add nsw i64 %5, 1
%7 = load i32, i32* %3
%8 = mul nsw i32 3, %7
%9 = sext i32 %8 to i64
%10 = add nsw i64 %6, %9
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = add nsw i64 %10, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @rozofs_get_service_port_geocli_storcli_diag(i32 %0, i32 %1) {
%3 = tail call i64 (...) @rozofs_get_service_port_geomgr_diag()
%4 = mul nsw i32 %0, 3
%5 = sext i32 %4 to i64
%6 = sext i32 %1 to i64
%7 = add nsw i64 %5, 1
%8 = add nsw i64 %7, %6
%9 = add i64 %8, %3
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print3(int *tab, int N) {
  int *ptr;
  for (ptr = tab; ptr < tab + N; ptr++)
    printf("%d ", *ptr);
}


x86 assembly (clang, -O0):
<print3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1166 <print3+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    1127 <print3+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print3>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1143 <print3+0x33>
mov    %rdi,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%r15
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x4,%rbx
cmp    %r15,%rbx
jb     1130 <print3+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print3(i32* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %12
6: ; preds = %2, %6
%7 = phi i32* [ %10, %6 ], [ %0, %2 ]
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i32, i32* %7, i64 1
%11 = icmp ult i32* %10, %4
br i1 %11, label %6, label %12
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
unsigned int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void generate_rseq(unsigned char array[]) {
  unsigned int i;
  srand(time(NULL));
  for (i = 0; i < 4; i++)
    ((unsigned int *)array)[i] = rand();
}


x86 assembly (clang, -O0):
<generate_rseq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jae    117e <generate_rseq+0x4e>
mov    $0x0,%al
call   1050 <rand@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1153 <generate_rseq+0x23>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_rseq>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,0x4(%rbx)
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,0x8(%rbx)
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,0xc(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @generate_rseq(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
store i32 0, i32* %3
br label %6
6: ; preds = %16, %1
%7 = load i32, i32* %3
%8 = icmp ult i32 %7, 4
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = call i32 (...) @rand()
%11 = load i8*, i8** %2
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %3
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 %10, i32* %15
br label %16
16: ; preds = %9
%17 = load i32, i32* %3
%18 = add i32 %17, 1
store i32 %18, i32* %3
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @generate_rseq(i8* nocapture writeonly %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 (...) @rand()
store i32 %5, i32* %4
%6 = tail call i32 (...) @rand()
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
%9 = tail call i32 (...) @rand()
%10 = getelementptr inbounds i8, i8* %0, i64 8
%11 = bitcast i8* %10 to i32*
store i32 %9, i32* %11
%12 = tail call i32 (...) @rand()
%13 = getelementptr inbounds i8, i8* %0, i64 12
%14 = bitcast i8* %13 to i32*
store i32 %12, i32* %14
ret void
}
double area_of_rectangles(double *f, int N, double dx) {
  double area = 0;
  return area;
}


x86 assembly (clang, -O0):
<area_of_rectangles>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<area_of_rectangles>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @area_of_rectangles(double* %0, i32 %1, double %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca double
%7 = alloca double
store double* %0, double** %4
store i32 %1, i32* %5
store double %2, double* %6
store double 0.000000e+00, double* %7
%8 = load double, double* %7
ret double %8
}

LLVM IR (-O2):
define double @area_of_rectangles(double* nocapture readnone %0, i32 %1, double %2) {
ret double 0.000000e+00
}
void *memset1(void *s, int c) { return __builtin_memset(s, c, 42); }


x86 assembly (clang, -O0):
<memset1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2a,%edx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset1>:
mov    %rdi,%rax
movd   %esi,%xmm0
punpcklbw %xmm0,%xmm0
pshuflw $0x0,%xmm0,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqu %xmm0,0x1a(%rdi)
movdqu %xmm0,0x10(%rdi)
movdqu %xmm0,(%rdi)
ret

LLVM IR (-O0):
define i8* @memset1(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 = trunc i32 %6 to i8
ret i8* %5
}

LLVM IR (-O2):
define i8* @memset1(i8* returned writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(42) %0, i8 %3, i64 42, i1 false)
ret i8* %0
}
void SIO1about() {}


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

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

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

LLVM IR (-O2):
define void @SIO1about() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_or_panic(int);
void c_bool(bool x) { assert_or_panic(x); }


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

x86 assembly (clang, -O2):
<c_bool>:
jmp    1030 <assert_or_panic@plt>

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

LLVM IR (-O2):
define void @c_bool(i32 %0) {
%2 = tail call i32 @assert_or_panic(i32 %0)
ret void
}
int getParity(unsigned int n) {
  int parity = 0;
  while (n) {
    parity = !parity;
    n = n & (n - 1);
  }
  return parity;
}


x86 assembly (clang, -O0):
<getParity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113c <getParity+0x3c>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <getParity+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getParity>:
xor    %eax,%eax
test   %edi,%edi
je     111c <getParity+0x1c>
cs nopw 0x0(%rax,%rax,1)
xor    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <getParity+0x10>
ret

LLVM IR (-O0):
define i32 @getParity(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = sub i32 %13, 1
%15 = and i32 %12, %14
store i32 %15, i32* %2
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @getParity(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = xor i32 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ get_varid(char const *);
int /*<<< orphan*/ write_instr(int);
int /*<<< orphan*/ write_varid(int /*<<< orphan*/);
void decVar(const char *name) {
  write_instr(0x05);
  write_varid(get_varid(name));
}


x86 assembly (clang, -O0):
<decVar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x5,%edi
call   1050 <write_instr@plt>
mov    -0x8(%rbp),%rdi
call   1040 <get_varid@plt>
mov    %eax,%edi
call   1030 <write_varid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decVar>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5,%edi
call   1050 <write_instr@plt>
mov    %rbx,%rdi
call   1040 <get_varid@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <write_varid@plt>

LLVM IR (-O0):
define void @decVar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @write_instr(i32 5)
%4 = load i8*, i8** %2
%5 = call i32 @get_varid(i8* %4)
%6 = call i32 @write_varid(i32 %5)
ret void
}

LLVM IR (-O2):
define void @decVar(i8* %0) {
%2 = tail call i32 @write_instr(i32 5)
%3 = tail call i32 @get_varid(i8* %0)
%4 = tail call i32 @write_varid(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flyback();
int /*<<< orphan*/ hvflush();
int /*<<< orphan*/ printf(char *, double);
void fillstart(double v) {
  hvflush();
  printf("\\X'BeginObject %g setgray'\n", v);
  flyback();
}


x86 assembly (clang, -O0):
<fillstart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <hvflush@plt>
movsd  -0x8(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <flyback@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillstart>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <hvflush@plt>
lea    0xebc(%rip),%rdi
movsd  (%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <flyback@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"\\X'BeginObject %g setgray'\0A\00"
define void @fillstart(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 (...) @hvflush()
%4 = load double, double* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %4)
%6 = call i32 (...) @flyback()
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"\\X'BeginObject %g setgray'\0A\00"
define void @fillstart(double %0) {
%2 = tail call i32 (...) @hvflush()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), double %0)
%4 = tail call i32 (...) @flyback()
ret void
}
void FPU_IRQHandler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<FPU_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <FPU_IRQHandler+0x9>
jmp    1109 <FPU_IRQHandler+0x9>

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

LLVM IR (-O0):
define void @FPU_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @FPU_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ lcd_putchar(int /*<<< orphan*/);
void lcd_puts(const char *string) {
  while (*string)
    lcd_putchar(*string++);
}


x86 assembly (clang, -O0):
<lcd_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <lcd_puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <lcd_putchar@plt>
jmp    111c <lcd_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <lcd_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <lcd_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lcd_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @lcd_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @lcd_putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int rand();
int randint(int l, int u) { return l + (rand() % (u - l + 1)); }


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randint(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 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = srem i32 %6, %10
%12 = add nsw i32 %5, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @randint(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
double percentile_double(int, double *, double);
double percentile(int n, double *data, double pct) {
  return percentile_double(n, data, pct);
}


x86 assembly (clang, -O0):
<percentile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
call   1030 <percentile_double@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<percentile>:
jmp    1030 <percentile_double@plt>

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

LLVM IR (-O2):
define double @percentile(i32 %0, double* %1, double %2) {
%4 = tail call double @percentile_double(i32 %0, double* %1, double %2)
ret double %4
}
void GPMCTimeParaGranularitySelect(unsigned int baseAddr, unsigned int csNum,
                                   unsigned int scaleftr) {
  (*((volatile unsigned int *)(baseAddr + (0x60 + (csNum * (0x30)))))) &=
      (0x00000010u);
  (*((volatile unsigned int *)(baseAddr + (0x60 + (csNum * (0x30)))))) |=
      ((scaleftr << (0x00000004u)) & (0x00000010u));
}


x86 assembly (clang, -O0):
<GPMCTimeParaGranularitySelect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x60,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0x10,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edx
shl    $0x4,%edx
and    $0x10,%edx
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x60,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCTimeParaGranularitySelect>:
lea    (%rsi,%rsi,2),%eax
shl    $0x4,%eax
add    %edi,%eax
add    $0x60,%eax
andl   $0x10,(%rax)
shl    $0x4,%edx
and    $0x10,%edx
or     %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPMCTimeParaGranularitySelect(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul i32 %8, 48
%10 = add i32 96, %9
%11 = add i32 %7, %10
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, 16
store volatile i32 %15, i32* %13
%16 = load i32, i32* %6
%17 = shl i32 %16, 4
%18 = and i32 %17, 16
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = mul i32 %20, 48
%22 = add i32 96, %21
%23 = add i32 %19, %22
%24 = zext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = load volatile i32, i32* %25
%27 = or i32 %26, %18
store volatile i32 %27, i32* %25
ret void
}

LLVM IR (-O2):
define void @GPMCTimeParaGranularitySelect(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, 48
%5 = add i32 %0, 96
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, 16
store volatile i32 %10, i32* %8
%11 = shl i32 %2, 4
%12 = and i32 %11, 16
%13 = load volatile i32, i32* %8
%14 = or i32 %13, %12
store volatile i32 %14, i32* %8
ret void
}
void class_device_del(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<class_device_del>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<class_device_del>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.class_device_del = [17 x i8] c"class_device_del\00"
define void @class_device_del() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.class_device_del, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.class_device_del = [17 x i8] c"class_device_del\00"
define void @class_device_del() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.class_device_del, i64 0, i64 0))
ret void
}
/* Variables and functions */
int tc_core_usec2tick(int);
unsigned tc_calc_xmittime(unsigned rate, unsigned size) {
  return tc_core_usec2tick(1000000 * ((double)size / rate));
}


x86 assembly (clang, -O0):
<tc_calc_xmittime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2sd %rax,%xmm1
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
divsd  %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <tc_core_usec2tick@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tc_calc_xmittime>:
mov    %esi,%eax
cvtsi2sd %rax,%xmm0
mov    %edi,%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
mulsd  0xed6(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <tc_core_usec2tick@plt>

LLVM IR (-O0):
define i32 @tc_calc_xmittime(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 = uitofp i32 %5 to double
%7 = load i32, i32* %3
%8 = uitofp i32 %7 to double
%9 = fdiv double %6, %8
%10 = fmul double 1.000000e+06, %9
%11 = fptosi double %10 to i32
%12 = call i32 @tc_core_usec2tick(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @tc_calc_xmittime(i32 %0, i32 %1) {
%3 = uitofp i32 %1 to double
%4 = uitofp i32 %0 to double
%5 = fdiv double %3, %4
%6 = fmul double %5, 1.000000e+06
%7 = fptosi double %6 to i32
%8 = tail call i32 @tc_core_usec2tick(i32 %7)
ret i32 %8
}
int do_846() { return 846; }


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

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

LLVM IR (-O0):
define i32 @do_846() {
ret i32 846
}

LLVM IR (-O2):
define i32 @do_846() {
ret i32 846
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
scalar_t__ pipe(int *);
int main(void) {
  int fds[2];
  if (pipe(fds) == 0) {
    close(fds[0]);
    close(fds[1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <pipe@plt>
cmp    $0x0,%rax
jne    1152 <main+0x32>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1040 <pipe@plt>
test   %rax,%rax
jne    113f <main+0x1f>
mov    (%rsp),%edi
call   1030 <close@plt>
mov    0x4(%rsp),%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%4 = call i64 @pipe(i32* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %7
%9 = call i32 @close(i32 %8)
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%11 = load i32, i32* %10
%12 = call i32 @close(i32 %11)
br label %13
13: ; preds = %6, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i64 @pipe(i32* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = load i32, i32* %3
%8 = call i32 @close(i32 %7)
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%10 = load i32, i32* %9
%11 = call i32 @close(i32 %10)
br label %12
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ UartGetc();
int UartPutc(int /*<<< orphan*/);
int SER_GetChar(void) { return UartPutc(UartGetc()); }


x86 assembly (clang, -O0):
<SER_GetChar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <UartGetc@plt>
mov    %eax,%edi
call   1040 <UartPutc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SER_GetChar>:
push   %rax
xor    %eax,%eax
call   1030 <UartGetc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UartPutc@plt>

LLVM IR (-O0):
define i32 @SER_GetChar() {
%1 = call i32 (...) @UartGetc()
%2 = call i32 @UartPutc(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @SER_GetChar() {
%1 = tail call i32 (...) @UartGetc()
%2 = tail call i32 @UartPutc(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SYS_open;
int /*<<< orphan*/ printf(char *, char const *);
int syscall(int /*<<< orphan*/, char const *, int, int);
int real_open(const char *fn, int flags, int mode) {
  if (0)
    printf("real_open(%s)\n", fn);
  return (syscall(SYS_open, (fn), (flags), (mode)));
}


x86 assembly (clang, -O0):
<real_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_open>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@SYS_open = global i32 0
define i32 @real_open(i8* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @SYS_open
%5 = tail call i32 @syscall(i32 %4, i8* %0, i32 %1, i32 %2)
ret i32 %5
}
/* Type definitions */
struct renegotiationOutput {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct renegotiationOutput *);
int freeRenegotiationOutput(struct renegotiationOutput *myRenOut) {
  if (myRenOut != NULL) {
    free(myRenOut);
  }
  return 1;
}


x86 assembly (clang, -O0):
<freeRenegotiationOutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <freeRenegotiationOutput+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeRenegotiationOutput>:
test   %rdi,%rdi
je     111f <freeRenegotiationOutput+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.renegotiationOutput = type { i32 }
define i32 @freeRenegotiationOutput(%struct.renegotiationOutput* %0) {
%2 = alloca %struct.renegotiationOutput*
store %struct.renegotiationOutput* %0, %struct.renegotiationOutput** %2
%3 = load %struct.renegotiationOutput*, %struct.renegotiationOutput** %2
%4 = icmp ne %struct.renegotiationOutput* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.renegotiationOutput*, %struct.renegotiationOutput** %2
%7 = call i32 @free(%struct.renegotiationOutput* %6)
br label %8
8: ; preds = %5, %1
ret i32 1
}

LLVM IR (-O2):
%struct.renegotiationOutput = type { i32 }
define i32 @freeRenegotiationOutput(%struct.renegotiationOutput* %0) {
%2 = icmp eq %struct.renegotiationOutput* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.renegotiationOutput* %0)
br label %5
5: ; preds = %3, %1
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showhelp() {
  printf("\n");
  printf("t toggles sending MIDI Time Code (MTC)\n");
  printf("c toggles sending MIDI CLOCK (initially on)\n");
  printf("m to set tempo (from 1bpm to 300bpm)\n");
  printf("q quits\n");
  printf("\n");
}


x86 assembly (clang, -O0):
<showhelp>:
push   %rbp
mov    %rsp,%rbp
lea    0xf0b(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
call   1030 <printf@plt>
lea    0xf30(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<showhelp>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xee9(%rip),%rdi
call   1040 <puts@plt>
lea    0xf09(%rip),%rdi
call   1040 <puts@plt>
lea    0xf22(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [40 x i8] c"t toggles sending MIDI Time Code (MTC)\0A\00"
@.str.2 = [45 x i8] c"c toggles sending MIDI CLOCK (initially on)\0A\00"
@.str.3 = [38 x i8] c"m to set tempo (from 1bpm to 300bpm)\0A\00"
@.str.4 = [9 x i8] c"q quits\0A\00"
define void @showhelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"t toggles sending MIDI Time Code (MTC)\00"
@str.5 = [44 x i8] c"c toggles sending MIDI CLOCK (initially on)\00"
@str.6 = [37 x i8] c"m to set tempo (from 1bpm to 300bpm)\00"
@str.7 = [8 x i8] c"q quits\00"
define void @showhelp() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.7, i64 0, i64 0))
%6 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
double genf(double, double);
void fdis_rndc(int n, double a, double b, double *array) {
  int i;
  for (i = 0; i < n; i++)
    *(array + i) = genf(a, b);
}


x86 assembly (clang, -O0):
<fdis_rndc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1166 <fdis_rndc+0x56>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <genf@plt>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1130 <fdis_rndc+0x20>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdis_rndc>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
test   %edi,%edi
jle    114f <fdis_rndc+0x3f>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <genf@plt>
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <fdis_rndc+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @fdis_rndc(i32 %0, double %1, double %2, double* nocapture writeonly %3) {
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = tail call double @genf(double %1, double %2)
%11 = getelementptr inbounds double, double* %3, i64 %9
store double %10, double* %11
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %4
ret void
}
/* Variables and functions */
void *get_next_free_block(void *ptr) {
  char *p = ptr;
  void **next_block_info;
  p += (sizeof(size_t)) + (sizeof(void *));
  next_block_info = (void **)p;
  return *next_block_info;
}


x86 assembly (clang, -O0):
<get_next_free_block>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_free_block>:
mov    0x10(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @get_next_free_block(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 16
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i8**
store i8** %9, i8*** %4
%10 = load i8**, i8*** %4
%11 = load i8*, i8** %10
ret i8* %11
}

LLVM IR (-O2):
define i8* @get_next_free_block(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 16
%3 = bitcast i8* %2 to i8**
%4 = load i8*, i8** %3
ret i8* %4
}
int suzerain_gbmatrix_offset(int ld, int kl, int ku, int i, int j) {
  (void)kl;
  return j * ld + (ku + i - j);
}


x86 assembly (clang, -O0):
<suzerain_gbmatrix_offset>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    -0x10(%rbp),%ecx
sub    -0x14(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<suzerain_gbmatrix_offset>:
imul   %r8d,%edi
lea    (%rdx,%rcx,1),%eax
sub    %r8d,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @suzerain_gbmatrix_offset(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %7
%12 = load i32, i32* %10
%13 = load i32, i32* %6
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = add nsw i32 %15, %16
%18 = load i32, i32* %10
%19 = sub nsw i32 %17, %18
%20 = add nsw i32 %14, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @suzerain_gbmatrix_offset(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = mul nsw i32 %4, %0
%7 = add nsw i32 %3, %2
%8 = sub i32 %7, %4
%9 = add nsw i32 %8, %6
ret i32 %9
}