xunge/DecIR huggingface dataset:
int test(int a, int b, char flags[], int g1, int g2) {
  int ret;
  __asm__ __volatile__("mov %3, %%edx\n\t"
                       "mov %4, %%eax\n\t"
                       "mov %5, %%ecx\n\t"
                       "movb %b1, %%al\n\t"
                       "movb %b2, %%cl\n\t"
                       "subb %%cl, %%al\n\t"
                       "jno 1f\n\t"
                       "movb $1, (%%edx)\n\t"
                       "1:\n\t"
                       "jns 1f\n\t"
                       "movb $1, 1(%%edx)\n\t"
                       "1:\n\t"
                       "jnz 1f\n\t"
                       "movb $1, 2(%%edx)\n\t"
                       "1:\n\t"
                       "jnp 1f\n\t"
                       "movb $1, 3(%%edx)\n\t"
                       "1:\n\t"
                       "jnc 1f\n\t"
                       "movb $1, 4(%%edx)\n\t"
                       "1:\n\t"
                       "movzbl %%al, %%eax\n\t"
                       "mov %%eax, %0\n\t"
                       : "=m"(ret)
                       : "m"(a), "m"(b), "m"(flags), "m"(g1), "m"(g2)
                       : "eax", "ecx", "edx", "memory");
  return ret;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
mov    -0x4(%rbp),%al
mov    -0x8(%rbp),%cl
sub    %cl,%al
jno    1130 <test+0x30>
movb   $0x1,(%edx)
jns    113b <test+0x3b>
movb   $0x1,0x1(%edx)
jne    1146 <test+0x46>
movb   $0x1,0x2(%edx)
jnp    1151 <test+0x51>
movb   $0x1,0x3(%edx)
jae    115c <test+0x5c>
movb   $0x1,0x4(%edx)
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %edi,-0xc(%rsp)
mov    %esi,-0x10(%rsp)
mov    %rdx,-0x8(%rsp)
mov    %ecx,-0x14(%rsp)
mov    %r8d,-0x18(%rsp)
mov    -0x8(%rsp),%edx
mov    -0x14(%rsp),%eax
mov    -0x18(%rsp),%ecx
mov    -0xc(%rsp),%al
mov    -0x10(%rsp),%cl
sub    %cl,%al
jno    1132 <test+0x32>
movb   $0x1,(%edx)
jns    1139 <test+0x39>
movb   $0x1,0x1(%edx)
jne    1140 <test+0x40>
movb   $0x1,0x2(%edx)
jnp    1147 <test+0x47>
movb   $0x1,0x3(%edx)
jae    114e <test+0x4e>
movb   $0x1,0x4(%edx)
movzbl %al,%eax
mov    %eax,-0x1c(%rsp)
mov    -0x1c(%rsp),%eax
ret

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = bitcast i32* %11 to i8*
%13 = load i32, i32* %11
ret i32 %13
}
void rid(fromfd, tofd, to) int fromfd, tofd;
char *to;
{
  int unlink(), close();
  (void)close(fromfd);
  (void)close(tofd);
  (void)unlink(to);
  return;
}


x86 assembly (clang, -O0):
<rid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <close@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <close@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <unlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rid>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
xor    %eax,%eax
call   1040 <close@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1040 <close@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <unlink@plt>

LLVM IR (-O0):
define void @rid(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %7)
%9 = load i32, i32* %5
%10 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %9)
%11 = load i8*, i8** %6
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %11)
ret void
}

LLVM IR (-O2):
define void @rid(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %1)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %2)
ret void
}
/* Variables and functions */
int printf(char const *, char const *, char const *);
int ccp_setflag(const char *flagname) {
  static const char ccp_flagdef[] = "#ifndef %s\n#  define %s\n#endif\n";
  return printf(ccp_flagdef, flagname, flagname);
}


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

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

LLVM IR (-O0):
@ccp_setflag.ccp_flagdef = internal constant [32 x i8] c"#ifndef %s\0A# define %s\0A#endif\0A\00"
define i32 @ccp_setflag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @ccp_setflag.ccp_flagdef, i64 0, i64 0), i8* %3, i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@ccp_setflag.ccp_flagdef = internal constant [32 x i8] c"#ifndef %s\0A# define %s\0A#endif\0A\00"
define i32 @ccp_setflag(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @ccp_setflag.ccp_flagdef, i64 0, i64 0), i8* %0, i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ y;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int x, y;
  x = sizeof(float);
  printf("%d\n%lu\n", x, sizeof(y));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d\0A%lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float);
void showspeed(float xfer, int len) {
  if (xfer > 1024) {
    printf("%'*.2f MB/s", len, xfer / (float)1024);
  } else {
    printf("%'*.2f kB/s", len, xfer);
  }
}


x86 assembly (clang, -O0):
<showspeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed3(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    115b <showspeed+0x4b>
mov    -0x8(%rbp),%esi
movss  -0x4(%rbp),%xmm0
movss  0xeba(%rip),%xmm1
divss  %xmm1,%xmm0
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    116f <showspeed+0x5f>
mov    -0x8(%rbp),%esi
movss  -0x4(%rbp),%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showspeed>:
mov    %edi,%esi
ucomiss 0xee7(%rip),%xmm0
jbe    112f <showspeed+0x1f>
mulss  0xee1(%rip),%xmm0
lea    0xede(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xede(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%'*.2f MB/s\00"
@.str.1 = [12 x i8] c"%'*.2f kB/s\00"
define void @showspeed(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = fcmp ogt float %5, 1.024000e+03
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* %4
%9 = load float, float* %3
%10 = fdiv float %9, 1.024000e+03
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %8, float %10)
br label %16
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load float, float* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %13, float %14)
br label %16
16: ; preds = %12, %7
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%'*.2f MB/s\00"
@.str.1 = [12 x i8] c"%'*.2f kB/s\00"
define void @showspeed(float %0, i32 %1) {
%3 = fcmp ogt float %0, 1.024000e+03
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = fmul float %0, 0x3F50000000000000
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1, float %5)
br label %9
7: ; preds = %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %1, float %0)
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sswap(int const *, float *, int const *, float *,
                         int const *);
void c_sswap(const int N, float *X, const int strideX, float *Y,
             const int strideY) {
  sswap(&N, X, &strideX, Y, &strideY);
}


x86 assembly (clang, -O0):
<c_sswap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x24(%rbp),%r8
call   1030 <sswap@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_sswap>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
call   1030 <sswap@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @c_sswap(i32 %0, float* %1, i32 %2, float* %3, i32 %4) {
%6 = alloca i32
%7 = alloca float*
%8 = alloca i32
%9 = alloca float*
%10 = alloca i32
store i32 %0, i32* %6
store float* %1, float** %7
store i32 %2, i32* %8
store float* %3, float** %9
store i32 %4, i32* %10
%11 = load float*, float** %7
%12 = load float*, float** %9
%13 = call i32 @sswap(i32* %6, float* %11, i32* %8, float* %12, i32* %10)
ret void
}

LLVM IR (-O2):
define void @c_sswap(i32 %0, float* %1, i32 %2, float* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %6
store i32 %2, i32* %7
store i32 %4, i32* %8
%9 = call i32 @sswap(i32* %6, float* %1, i32* %7, float* %3, i32* %8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setscope(int /*<<< orphan*/ *, int);
int my_pthread_attr_setscope(pthread_attr_t *__attr, int scope) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(int *)__attr;
  return pthread_attr_setscope(realattr, scope);
}


x86 assembly (clang, -O0):
<my_pthread_attr_setscope>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <pthread_attr_setscope@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_attr_setscope>:
movslq (%rdi),%rdi
jmp    1030 <pthread_attr_setscope@plt>

LLVM IR (-O0):
define i32 @my_pthread_attr_setscope(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
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i32, i32* %4
%12 = call i32 @pthread_attr_setscope(i32* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_pthread_attr_setscope(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_attr_setscope(i32* %5, i32 %1)
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
int /*<<< orphan*/ printf(char *, int, double);
int solve(int);
int main() {
  clock_t begin = clock();
  int result = solve(1e3);
  clock_t end = clock();
  double time = (double)(end - begin) / CLOCKS_PER_SEC;
  printf("%d [in %f seconds]", result, time);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1040 <clock@plt>
mov    %rax,-0x8(%rbp)
mov    $0x3e8,%edi
call   1030 <solve@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <clock@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2e79(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0xc(%rbp),%esi
movsd  -0x20(%rbp),%xmm0
lea    0xe79(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <clock@plt>
mov    %rax,%rbx
mov    $0x3e8,%edi
call   1030 <solve@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <clock@plt>
sub    %rbx,%rax
cvtsi2sd %rax,%xmm0
mov    0x2e89(%rip),%rax
divsd  (%rax),%xmm0
lea    0xe96(%rip),%rdi
mov    %ebp,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [19 x i8] c"%d [in %f seconds]\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i32
%3 = alloca i64
%4 = alloca double
%5 = call i64 (...) @clock()
store i64 %5, i64* %1
%6 = call i32 @solve(i32 1000)
store i32 %6, i32* %2
%7 = call i64 (...) @clock()
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = load i64, i64* %1
%10 = sub nsw i64 %8, %9
%11 = sitofp i64 %10 to double
%12 = load double, double* @CLOCKS_PER_SEC
%13 = fdiv double %11, %12
store double %13, double* %4
%14 = load i32, i32* %2
%15 = load double, double* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %14, double %15)
ret i32 0
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
@.str = [19 x i8] c"%d [in %f seconds]\00"
define i32 @main() {
%1 = tail call i64 (...) @clock()
%2 = tail call i32 @solve(i32 1000)
%3 = tail call i64 (...) @clock()
%4 = sub nsw i64 %3, %1
%5 = sitofp i64 %4 to double
%6 = load double, double* @CLOCKS_PER_SEC
%7 = fdiv double %5, %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2, double %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *getBraceParam();
char *getBracketParam();
void CmdMinipage(int code) {
  char *v_align, *width;
  switch (code) {
  case 0x4000:
    v_align = getBracketParam();
    width = getBraceParam();
    if (v_align)
      free(v_align);
    free(width);
    break;
  case 0x0000:
    break;
  }
}


x86 assembly (clang, -O0):
<CmdMinipage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
test   %eax,%eax
je     1199 <CmdMinipage+0x69>
jmp    114e <CmdMinipage+0x1e>
mov    -0x1c(%rbp),%eax
sub    $0x4000,%eax
jne    119e <CmdMinipage+0x6e>
jmp    1161 <CmdMinipage+0x31>
mov    $0x0,%al
call   1050 <getBracketParam@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getBraceParam@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     118b <CmdMinipage+0x5b>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    119e <CmdMinipage+0x6e>
jmp    119e <CmdMinipage+0x6e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdMinipage>:
cmp    $0x4000,%edi
jne    116c <CmdMinipage+0x3c>
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getBracketParam@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <getBraceParam@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     115d <CmdMinipage+0x2d>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @CmdMinipage(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i32 %0, i32* %2
%5 = load i32, i32* %2
switch i32 %5, label %18 [
i32 16384, label %6
i32 0, label %17
]
6: ; preds = %1
%7 = call i8* (...) @getBracketParam()
store i8* %7, i8** %3
%8 = call i8* (...) @getBraceParam()
store i8* %8, i8** %4
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
br label %14
14: ; preds = %11, %6
%15 = load i8*, i8** %4
%16 = call i32 @free(i8* %15)
br label %18
17: ; preds = %1
br label %18
18: ; preds = %1, %17, %14
ret void
}

LLVM IR (-O2):
define void @CmdMinipage(i32 %0) {
%2 = icmp eq i32 %0, 16384
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = tail call i8* (...) @getBracketParam()
%5 = tail call i8* (...) @getBraceParam()
%6 = icmp eq i8* %4, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @free(i8* %4)
br label %9
9: ; preds = %7, %3
%10 = tail call i32 @free(i8* %5)
br label %11
11: ; preds = %1, %9
ret void
}
int __syscall2(int call, unsigned long arg0, unsigned long arg1) {
  int rc;
  __asm__ volatile(
      "movl %[call], %%eax	\n"
      "movl %[arg0], %%ebx	\n"
      "movl %[arg1], %%ecx	\n"
      "int  %[xnum]		\n"
      "movl %%eax, %[rc]	\n"
      : [rc] "=g"(rc)
      : [call] "g"(call), [arg0] "g"(arg0), [arg1] "g"(arg1), [xnum] "i"(0x80)
      : "%eax", "%ebx", "%ecx", "memory");
  return rc;
}


x86 assembly (clang, -O0):
<__syscall2>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %edx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x30(%rbp),%ebx
mov    -0x38(%rbp),%ecx
int    $0x80
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @__syscall2(i32 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = load i32, i32* %7
ret i32 %11
}

LLVM IR (-O2):
unsigned short jz_readw(unsigned int address) {
  return *((volatile unsigned short *)address);
}


x86 assembly (clang, -O0):
<jz_readw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    (%rax),%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jz_readw>:
mov    %edi,%eax
movzwl (%rax),%eax
ret

LLVM IR (-O0):
define zeroext i16 @jz_readw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i16*
%6 = load volatile i16, i16* %5
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @jz_readw(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i16*
%4 = load volatile i16, i16* %3
ret i16 %4
}
void RTHandleTableDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTHandleTableDestroy() {
ret void
}
/* Variables and functions */
int ceil(double);
unsigned int SecToNsec(double time) {
  int ns = ceil(time * 100000000);
  return ns;
}


x86 assembly (clang, -O0):
<SecToNsec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SecToNsec>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i32 @SecToNsec(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 1.000000e+08
%6 = call i32 @ceil(double %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @SecToNsec(double %0) {
%2 = fmul double %0, 1.000000e+08
%3 = tail call i32 @ceil(double %2)
ret i32 %3
}
/* Variables and functions */
int get_rn_dbl(int *);
int get_rn_int(int *igenptr) {
  return (int)(get_rn_dbl(igenptr) * 0x80000000U);
}


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

x86 assembly (clang, -O2):
<get_rn_int>:
push   %rax
call   1030 <get_rn_dbl@plt>
shl    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_rn_int(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @get_rn_dbl(i32* %3)
%5 = mul i32 %4, -2147483648
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_rn_int(i32* %0) {
%2 = tail call i32 @get_rn_dbl(i32* %0)
%3 = shl i32 %2, 31
ret i32 %3
}
int f12a(int y) {
  int x = y;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @f12a(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x2b() {
  Assert_real((isprint(43)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              220, ("isprint should be 1 for +"));
}


x86 assembly (clang, -O0):
<t_isprint_0x2b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xdc,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x2b>:
push   %rax
mov    $0x2b,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xdc,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for +\00"
define void @t_isprint_0x2b() {
%1 = call i32 @isprint(i32 43)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 220, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for +\00"
define void @t_isprint_0x2b() {
%1 = tail call i32 @isprint(i32 43)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 220, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
int main(void) {
  { fatal("compile with either -DRTL (make 1RTL) or -DLTL (make 1LTL)"); };
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"compile with either -DRTL (make 1RTL) or -DLTL (make 1LTL)\00"
define i32 @main() {
%1 = call i32 @fatal(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [59 x i8] c"compile with either -DRTL (make 1RTL) or -DLTL (make 1LTL)\00"
define i32 @main() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bcm2835_close();
int /*<<< orphan*/ mark_sync();
int /*<<< orphan*/ put_reply();
int /*<<< orphan*/ set_int_code(int /*<<< orphan*/);
int /*<<< orphan*/ set_ope_code(int);
void bcm_close(void) {
  set_ope_code(0x31);
  set_int_code(bcm2835_close());
  put_reply();
  mark_sync();
}


x86 assembly (clang, -O0):
<bcm_close>:
push   %rbp
mov    %rsp,%rbp
mov    $0x31,%edi
call   1030 <set_ope_code@plt>
mov    $0x0,%al
call   1050 <bcm2835_close@plt>
mov    %eax,%edi
call   1060 <set_int_code@plt>
mov    $0x0,%al
call   1040 <put_reply@plt>
mov    $0x0,%al
call   1070 <mark_sync@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcm_close>:
push   %rax
mov    $0x31,%edi
call   1030 <set_ope_code@plt>
xor    %eax,%eax
call   1050 <bcm2835_close@plt>
mov    %eax,%edi
call   1060 <set_int_code@plt>
xor    %eax,%eax
call   1040 <put_reply@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <mark_sync@plt>

LLVM IR (-O0):
define void @bcm_close() {
%1 = call i32 @set_ope_code(i32 49)
%2 = call i32 (...) @bcm2835_close()
%3 = call i32 @set_int_code(i32 %2)
%4 = call i32 (...) @put_reply()
%5 = call i32 (...) @mark_sync()
ret void
}

LLVM IR (-O2):
define void @bcm_close() {
%1 = tail call i32 @set_ope_code(i32 49)
%2 = tail call i32 (...) @bcm2835_close()
%3 = tail call i32 @set_int_code(i32 %2)
%4 = tail call i32 (...) @put_reply()
%5 = tail call i32 (...) @mark_sync()
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dmeanli(int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dmeanli(N, x, stride);
  printf("mean: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%edx
call   1050 <stdlib_strided_dmeanli@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dmeanli@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [11 x i8] c"mean: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dmeanli(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [11 x i8] c"mean: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dmeanli(i32 4, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ConvertString(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char const *, char const *);
scalar_t__ strlen(char const *);
void ConvertFmtString(const char *fmt, const char *str) {
  char *buffer = (char *)malloc(strlen(fmt) + strlen(str) + 1);
  sprintf(buffer, fmt, str);
  ConvertString(buffer);
}


x86 assembly (clang, -O0):
<ConvertFmtString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1060 <sprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <ConvertString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertFmtString>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <ConvertString@plt>

LLVM IR (-O0):
define void @ConvertFmtString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = call i32 @sprintf(i8* %14, i8* %15, i8* %16)
%18 = load i8*, i8** %5
%19 = call i32 @ConvertString(i8* %18)
ret void
}

LLVM IR (-O2):
define void @ConvertFmtString(i8* nocapture %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %8, i8* dereferenceable(1) %0, i8* %1)
%10 = tail call i32 @ConvertString(i8* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_VERSION_TEXT;
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main() {
  puts(OPENSSL_VERSION_TEXT);
  return 0;
}


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

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

LLVM IR (-O0):
@OPENSSL_VERSION_TEXT = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @OPENSSL_VERSION_TEXT
%3 = call i32 @puts(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@OPENSSL_VERSION_TEXT = global i32 0
define i32 @main() {
%1 = load i32, i32* @OPENSSL_VERSION_TEXT
%2 = tail call i32 @puts(i32 %1)
ret i32 0
}
/* Variables and functions */
float find_array_min(float const *, int, int *);
float array_min(const float *array, int length) {
  int i;
  float min = find_array_min(array, length, &i);
  (void)i;
  return min;
}


x86 assembly (clang, -O0):
<array_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
call   1030 <find_array_min@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_min>:
push   %rax
lea    0x4(%rsp),%rdx
call   1030 <find_array_min@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define float @array_min(float* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call float @find_array_min(float* %0, i32 %1, i32* %3)
ret float %5
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ smb2c_irqDisable();
int /*<<< orphan*/ smb2c_irqEnable();
void m50setParams4120(uint16_t addr, uint8_t val) {
  (void)addr;
  if (val & 1)
    smb2c_irqEnable();
  else
    smb2c_irqDisable();
}


x86 assembly (clang, -O0):
<m50setParams4120>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1149 <m50setParams4120+0x29>
mov    $0x0,%al
call   1030 <smb2c_irqEnable@plt>
jmp    1150 <m50setParams4120+0x30>
mov    $0x0,%al
call   1040 <smb2c_irqDisable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m50setParams4120>:
xor    %eax,%eax
test   $0x1,%sil
jne    112d <m50setParams4120+0xd>
jmp    1040 <smb2c_irqDisable@plt>
jmp    1030 <smb2c_irqEnable@plt>

LLVM IR (-O0):
define void @m50setParams4120(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 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @smb2c_irqEnable()
br label %13
11: ; preds = %2
%12 = call i32 (...) @smb2c_irqDisable()
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
define void @m50setParams4120(i32 %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @smb2c_irqEnable()
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @smb2c_irqDisable()
br label %9
9: ; preds = %7, %5
ret void
}
void SuspendClock(void) { return; }


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

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

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

LLVM IR (-O2):
define void @SuspendClock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _enable_IRQ();
void irqEnable() { _enable_IRQ(); }


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

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

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

LLVM IR (-O2):
define void @irqEnable() {
%1 = tail call i32 (...) @_enable_IRQ()
ret void
}
int main() {
  int i, j = 0;
  int a[20];
L0 : {
  {
    j = j + 2;
    i = j + 2;
  }
  a[i] = 0;
  if (j < 20)
    goto L0;
}
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movl   $0x0,-0x60(%rbp,%rax,4)
cmpl   $0x14,-0xc(%rbp)
jge    113f <main+0x3f>
jmp    1112 <main+0x12>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [20 x i32]
store i32 0, i32* %1
store i32 0, i32* %3
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 2
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 2
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [20 x i32], [20 x i32]* %4, i64 0, i64 %11
store i32 0, i32* %12
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 20
br i1 %14, label %15, label %16
15: ; preds = %5
br label %5
16: ; preds = %5
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int snprintf(char *, int, char *, unsigned short);
int STR_BAND(char *p, int n, unsigned short band) {
  if (band == 0)
    return 0;
  return snprintf(p, n, "band:%d ", band);
}


x86 assembly (clang, -O0):
<STR_BAND>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dx,%ax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %ax,-0x16(%rbp)
movzwl -0x16(%rbp),%eax
cmp    $0x0,%eax
jne    113f <STR_BAND+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1159 <STR_BAND+0x49>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    0xeb3(%rip),%rdx
movzwl -0x16(%rbp),%ecx
call   1030 <snprintf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STR_BAND>:
test   %edx,%edx
je     1123 <STR_BAND+0x13>
movzwl %dx,%ecx
lea    0xee2(%rip),%rdx
jmp    1030 <snprintf@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"band:%d \00"
define i32 @STR_BAND(i8* %0, i32 %1, i16 zeroext %2) {
%4 = icmp eq i16 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i16 zeroext %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ funge_stack_pop(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ funge_stack_push(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ funge_thread_stack();
int32_t funge_stack_duplicate(int32_t funge_char __attribute__((unused))) {
  int32_t val;
  int32_t rc;
  rc = funge_stack_pop(funge_thread_stack(), &val);
  rc = funge_stack_push(funge_thread_stack(), &val);
  rc = funge_stack_push(funge_thread_stack(), &val);
  return 0;
}


x86 assembly (clang, -O0):
<funge_stack_duplicate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <funge_thread_stack@plt>
mov    %eax,%edi
lea    -0x8(%rbp),%rsi
call   1050 <funge_stack_pop@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <funge_thread_stack@plt>
mov    %eax,%edi
lea    -0x8(%rbp),%rsi
call   1030 <funge_stack_push@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <funge_thread_stack@plt>
mov    %eax,%edi
lea    -0x8(%rbp),%rsi
call   1030 <funge_stack_push@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funge_stack_duplicate>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <funge_thread_stack@plt>
lea    0xc(%rsp),%rbx
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <funge_stack_pop@plt>
xor    %eax,%eax
call   1040 <funge_thread_stack@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <funge_stack_push@plt>
xor    %eax,%eax
call   1040 <funge_thread_stack@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <funge_stack_push@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @funge_stack_duplicate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (...) @funge_thread_stack()
%6 = call i32 @funge_stack_pop(i32 %5, i32* %3)
store i32 %6, i32* %4
%7 = call i32 (...) @funge_thread_stack()
%8 = call i32 @funge_stack_push(i32 %7, i32* %3)
store i32 %8, i32* %4
%9 = call i32 (...) @funge_thread_stack()
%10 = call i32 @funge_stack_push(i32 %9, i32* %3)
store i32 %10, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @funge_stack_duplicate(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 (...) @funge_thread_stack()
%5 = call i32 @funge_stack_pop(i32 %4, i32* %2)
%6 = call i32 (...) @funge_thread_stack()
%7 = call i32 @funge_stack_push(i32 %6, i32* %2)
%8 = call i32 (...) @funge_thread_stack()
%9 = call i32 @funge_stack_push(i32 %8, i32* %2)
ret i32 0
}
int fun761() { return 761; }


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

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

LLVM IR (-O0):
define i32 @fun761() {
ret i32 761
}

LLVM IR (-O2):
define i32 @fun761() {
ret i32 761
}
int default_compare(unsigned int a, unsigned int b) { return a < b; }


x86 assembly (clang, -O0):
<default_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_compare>:
xor    %eax,%eax
cmp    %esi,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @default_compare(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 = icmp ult i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @default_compare(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
falListFontsWithInfo() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @falListFontsWithInfo() {
ret i32 0
}
/* Variables and functions */
int count_options(char *);
int p_strlen(char *);
int count_flags(char *optstring) {
  return p_strlen(optstring) - count_options(optstring) * 2;
}


x86 assembly (clang, -O0):
<count_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <p_strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <count_options@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x1,%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_flags>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <p_strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <count_options@plt>
add    %eax,%eax
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @count_flags(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @p_strlen(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @count_options(i8* %5)
%7 = mul nsw i32 %6, 2
%8 = sub nsw i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @count_flags(i8* %0) {
%2 = tail call i32 @p_strlen(i8* %0)
%3 = tail call i32 @count_options(i8* %0)
%4 = mul i32 %3, -2
%5 = add i32 %4, %2
ret i32 %5
}
/* Type definitions */
struct sched_param {
  int dummy;
};
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_getschedparam(int /*<<< orphan*/ *, struct sched_param *);
int my_pthread_attr_getschedparam(pthread_attr_t const *__attr,
                                  struct sched_param *param) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(int *)__attr;
  return pthread_attr_getschedparam(realattr, param);
}


x86 assembly (clang, -O0):
<my_pthread_attr_getschedparam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <pthread_attr_getschedparam@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_attr_getschedparam>:
movslq (%rdi),%rdi
jmp    1030 <pthread_attr_getschedparam@plt>

LLVM IR (-O0):
%struct.sched_param = type { i32 }
define i32 @my_pthread_attr_getschedparam(i32* %0, %struct.sched_param* %1) {
%3 = alloca i32*
%4 = alloca %struct.sched_param*
%5 = alloca i32*
store i32* %0, i32** %3
store %struct.sched_param* %1, %struct.sched_param** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load %struct.sched_param*, %struct.sched_param** %4
%12 = call i32 @pthread_attr_getschedparam(i32* %10, %struct.sched_param* %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
define i32 @my_pthread_attr_getschedparam(i32* nocapture %0, %struct.sched_param* %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @pthread_attr_getschedparam(i32* %5, %struct.sched_param* %1)
ret i32 %6
}