xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ putchar(char);
int strlen(char *);
void test_msg_start(char *msg) {
  int msg_length = strlen(msg);
  printf("%s", msg);
  while (msg_length < 74) {
    putchar('.');
    msg_length++;
  }
}


x86 assembly (clang, -O0):
<test_msg_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1050 <printf@plt>
cmpl   $0x4a,-0xc(%rbp)
jge    117a <test_msg_start+0x4a>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <test_msg_start+0x28>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_msg_start>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%ebx
lea    0xebb(%rip),%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
cmp    $0x49,%ebx
jg     116e <test_msg_start+0x3e>
add    $0xffffffb6,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2e,%edi
call   1030 <putchar@plt>
inc    %ebx
jne    1160 <test_msg_start+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @test_msg_start(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %11, %1
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 74
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = call i32 @putchar(i8 signext 46)
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %8
15: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @test_msg_start(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = icmp slt i32 %2, 74
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ %2, %1 ]
%7 = tail call i32 @putchar(i8 signext 46)
%8 = add i32 %6, 1
%9 = icmp eq i32 %8, 74
br i1 %9, label %10, label %5
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _printf_error(char const *message, int ret) {
  fputs("printf"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_printf_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_printf_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"printf: \00"
@stderr = global i32 0
define i32 @_printf_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"printf: \00"
@stderr = global i32 0
define i32 @_printf_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fwrite(int *, int, int, int /*<<< orphan*/ *);
int putw(int x, FILE *f) { return (int)fwrite(&x, sizeof x, 1, f) - 1; }


x86 assembly (clang, -O0):
<putw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putw>:
push   %rax
mov    %rsi,%rcx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @putw(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 = call i64 @fwrite(i32* %3, i32 4, i32 1, i32* %5)
%7 = trunc i64 %6 to i32
%8 = sub nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @putw(i32 %0, i32* nocapture %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i64 @fwrite(i32* %3, i32 4, i32 1, i32* %1)
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, -1
ret i32 %6
}
char *assert_msg_pass() {
  do {
    if (!(0 == 0))
      return "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/marshall/mintest/refs/heads/master/"
             "tests/test_json.c"
             ":"
             "13"
             ": "
             "should_pass";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<assert_msg_pass>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <assert_msg_pass+0x9>
jmp    110e <assert_msg_pass+0xe>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @assert_msg_pass() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @assert_msg_pass() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ FCEU_DispMessage(char *);
void FCEUD_HideMenuToggle(void) { FCEU_DispMessage("Not implemented."); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Not implemented.\00"
define void @FCEUD_HideMenuToggle() {
%1 = call i32 @FCEU_DispMessage(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Not implemented.\00"
define void @FCEUD_HideMenuToggle() {
%1 = tail call i32 @FCEU_DispMessage(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int M_PI;
int bessi0_spd(double);
double cos(double);
int exp(double);
double vmDensity(double theta, double mu, double kappa) {
  return exp(kappa * cos(theta - mu)) / (2 * M_PI * bessi0_spd(kappa));
}


x86 assembly (clang, -O0):
<vmDensity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
mov    %eax,-0x1c(%rbp)
mov    0x2e6d(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
mov    %eax,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <bessi0_spd@plt>
mov    -0x20(%rbp),%ecx
mov    %eax,%edx
mov    -0x1c(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmDensity>:
push   %rbp
push   %rbx
push   %rax
movsd  %xmm2,(%rsp)
subsd  %xmm1,%xmm0
call   1050 <cos@plt>
mulsd  (%rsp),%xmm0
call   1040 <exp@plt>
mov    %eax,%ebx
mov    0x2e94(%rip),%rax
mov    (%rax),%ebp
movsd  (%rsp),%xmm0
call   1030 <bessi0_spd@plt>
mov    %eax,%ecx
imul   %ebp,%ecx
add    %ecx,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @vmDensity(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fsub double %8, %9
%11 = call double @cos(double %10)
%12 = fmul double %7, %11
%13 = call i32 @exp(double %12)
%14 = load i32, i32* @M_PI
%15 = mul nsw i32 2, %14
%16 = load double, double* %6
%17 = call i32 @bessi0_spd(double %16)
%18 = mul nsw i32 %15, %17
%19 = sdiv i32 %13, %18
%20 = sitofp i32 %19 to double
ret double %20
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @vmDensity(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @cos(double %4)
%6 = fmul double %5, %2
%7 = tail call i32 @exp(double %6)
%8 = load i32, i32* @M_PI
%9 = shl nsw i32 %8, 1
%10 = tail call i32 @bessi0_spd(double %2)
%11 = mul nsw i32 %9, %10
%12 = sdiv i32 %7, %11
%13 = sitofp i32 %12 to double
ret double %13
}
unsigned int HSMMCSDIsCardWriteProtected(unsigned int baseAddr) {
  return ((*((volatile unsigned int *)(baseAddr + (0x224)))) & (0x00080000u)) >>
         (0x00000013u);
}


x86 assembly (clang, -O0):
<HSMMCSDIsCardWriteProtected>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x224,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x80000,%eax
shr    $0x13,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HSMMCSDIsCardWriteProtected>:
add    $0x224,%edi
mov    (%rdi),%eax
shr    $0x13,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @HSMMCSDIsCardWriteProtected(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 548
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 524288
%9 = lshr i32 %8, 19
ret i32 %9
}

LLVM IR (-O2):
define i32 @HSMMCSDIsCardWriteProtected(i32 %0) {
%2 = add i32 %0, 548
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = lshr i32 %5, 19
%7 = and i32 %6, 1
ret i32 %7
}
void g_pattern_match_string() {}


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

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

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

LLVM IR (-O2):
define void @g_pattern_match_string() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ findMajority(char *, int, char *);
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char majority;
  char m[100] = "AAACCBBCCCBCC";
  findMajority(m, 13, &majority);
  printf("Мажорант: %c\n", majority);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x64,%edx
call   1040 <memcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0xd,%esi
lea    -0x5(%rbp),%rdx
call   1050 <findMajority@plt>
lea    0xef7(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x78,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x70(%rsp)
lea    0x10(%rsp),%rdi
lea    0xf(%rsp),%rdx
mov    $0xd,%esi
call   1040 <findMajority@plt>
movsbl 0xf(%rsp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
ret

LLVM IR (-O0):
@__const.main.m = [100 x i8] c"AAACCBBCCCBCC\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [22 x i8] c"\D0\9C\D0\B0\D0\B6\D0\BE\D1\80\D0\B0\D0\BD\D1\82: %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [100 x i8]
store i32 0, i32* %1
%4 = bitcast [100 x i8]* %3 to i8*
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = call i32 @findMajority(i8* %5, i32 13, i8* %2)
%7 = load i8, i8* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.m = [100 x i8] c"AAACCBBCCCBCC\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [22 x i8] c"\D0\9C\D0\B0\D0\B6\D0\BE\D1\80\D0\B0\D0\BD\D1\82: %c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @findMajority(i8* %3, i32 13, i8* %1)
%5 = load i8, i8* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext %5)
ret i32 0
}
int t(int a, int b, int c) {
  if (a > 0 || b > 0 || c > 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     112b <t+0x2b>
cmpl   $0x0,-0xc(%rbp)
jg     112b <t+0x2b>
cmpl   $0x0,-0x10(%rbp)
jle    1137 <t+0x37>
movl   $0x0,-0x4(%rbp)
jmp    113e <t+0x3e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
test   %edi,%edi
setle  %al
test   %esi,%esi
setle  %cl
and    %al,%cl
test   %edx,%edx
setle  %al
and    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @t(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
%5 = icmp sgt i32 %1, 0
%6 = or i1 %4, %5
%7 = icmp sgt i32 %2, 0
%8 = or i1 %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}
int str_hash(str, seed)
char *str;
int seed;
{
  int cc;
  while (cc = *str++) {
    seed = (seed << 5) - seed + cc;
  }
  return (seed & 0x7fffffff);
}


x86 assembly (clang, -O0):
<str_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     113d <str_hash+0x3d>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
sub    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110b <str_hash+0xb>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <str_hash+0x2d>
add    $0x1,%rdi
mov    %esi,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
shl    $0x5,%eax
sub    %esi,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%esi
test   %cl,%cl
jne    1110 <str_hash+0x10>
and    $0x7fffffff,%eax
ret
mov    %esi,%eax
and    $0x7fffffff,%eax
ret

LLVM IR (-O0):
define i32 @str_hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %6
6: ; preds = %12, %2
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %3
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
store i32 %10, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %6
%13 = load i32, i32* %4
%14 = shl i32 %13, 5
%15 = load i32, i32* %4
%16 = sub nsw i32 %14, %15
%17 = load i32, i32* %5
%18 = add nsw i32 %16, %17
store i32 %18, i32* %4
br label %6
19: ; preds = %6
%20 = load i32, i32* %4
%21 = and i32 %20, 2147483647
ret i32 %21
}

LLVM IR (-O2):
define i32 @str_hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i32 [ %12, %5 ], [ %1, %2 ]
%9 = sext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = mul i32 %8, 31
%12 = add nsw i32 %11, %9
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ %1, %2 ], [ %12, %5 ]
%17 = and i32 %16, 2147483647
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  long xl, yl, zl;
  if (xl + 2 < 10) {
    int z = 5;
    if (xl == -20) {
      assert(1);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
cmp    $0xa,%rax
jge    1152 <main+0x42>
movl   $0x5,-0x24(%rbp)
cmpq   $0xffffffffffffffec,-0x10(%rbp)
jne    114d <main+0x3d>
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1152 <main+0x42>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ core4_print(char *, char const *);
void U_EMRINTERSECTCLIPRECT_print(const char *contents) {
  core4_print("U_EMRINTERSECTCLIPRECT", contents);
}


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

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"U_EMRINTERSECTCLIPRECT\00"
define void @U_EMRINTERSECTCLIPRECT_print(i8* %0) {
%2 = tail call i32 @core4_print(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char *test_func_00(char *p, int c, int x) {
  do {
    *--p = (char)x;
    *--p = (char)x;
    *--p = (char)x;
  } while (--c);
  return p;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,-0x1(%rax)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jne    110e <test_func_00+0xe>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
add    $0xffffffff,%esi
lea    (%rsi,%rsi,2),%rax
sub    %rax,%rdi
lea    -0x3(%rdi),%rbx
lea    (%rsi,%rsi,2),%rax
add    $0x3,%rax
mov    %rbx,%rdi
mov    %edx,%esi
mov    %rax,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @test_func_00(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
br label %7
7: ; preds = %20, %3
%8 = load i32, i32* %6
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 -1
store i8* %11, i8** %4
store i8 %9, i8* %11
%12 = load i32, i32* %6
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 -1
store i8* %15, i8** %4
store i8 %13, i8* %15
%16 = load i32, i32* %6
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i32 -1
store i8* %19, i8** %4
store i8 %17, i8* %19
br label %20
20: ; preds = %7
%21 = load i32, i32* %5
%22 = add nsw i32 %21, -1
store i32 %22, i32* %5
%23 = icmp ne i32 %22, 0
br i1 %23, label %7, label %24
24: ; preds = %20
%25 = load i8*, i8** %4
ret i8* %25
}

LLVM IR (-O2):
define i8* @test_func_00(i8* writeonly %0, i32 %1, i32 %2) {
%4 = trunc i32 %2 to i8
%5 = add i32 %1, -1
%6 = zext i32 %5 to i64
%7 = mul nuw nsw i64 %6, 3
%8 = sub nuw nsw i64 -3, %7
%9 = getelementptr i8, i8* %0, i64 %8
%10 = add nuw nsw i64 %7, 3
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void print_info(FILE *fp, char *str[]) {
  int i;
  for (i = 0; str[i] != NULL; i++)
    fprintf(fp, str[i]);
}


x86 assembly (clang, -O0):
<print_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     115d <print_info+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <print_info+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_info>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rsi),%rsi
test   %rsi,%rsi
je     1144 <print_info+0x34>
mov    %rdi,%r14
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <fprintf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <print_info+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @print_info(i32* nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8* [ %11, %5 ], [ %3, %2 ]
%8 = tail call i32 @fprintf(i32* %0, i8* %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stdin;
char *readLine(void) {
  char *line = NULL;
  size_t bufsize = 0;
  if (getline(&line, &bufsize, stdin) == -1) {
    perror("mosh: reading line error\n");
    exit(EXIT_FAILURE);
  }
  return line;
}


x86 assembly (clang, -O0):
<readLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <getline@plt>
cmp    $0xffffffff,%eax
jne    1181 <readLine+0x51>
lea    0xe92(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readLine>:
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <getline@plt>
cmp    $0xffffffff,%eax
je     116d <readLine+0x3d>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
ret
lea    0xe8c(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [26 x i8] c"mosh: reading line error\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @readLine() {
%1 = alloca i8*
%2 = alloca i64
store i8* null, i8** %1
store i64 0, i64* %2
%3 = load i32, i32* @stdin
%4 = call i32 @getline(i8** %1, i64* %2, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %0
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [26 x i8] c"mosh: reading line error\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @readLine() {
%1 = alloca i8*
%2 = alloca i64
%3 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%4 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%5 = load i32, i32* @stdin
%6 = call i32 @getline(i8** %1, i64* %2, i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %0
%13 = load i8*, i8** %1
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double R, A;
  scanf("%lf", &R);
  A = 3.14159 * R * R;
  printf("A=%0.4lf\n", A);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  0xeb9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [10 x i8] c"A=%0.4lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = fmul double 3.141590e+00, %5
%7 = load double, double* %2
%8 = fmul double %6, %7
store double %8, double* %3
%9 = load double, double* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [10 x i8] c"A=%0.4lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, 3.141590e+00
%6 = fmul double %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double %6)
ret i32 0
}
void RTAvloU32RemoveBestFit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvloU32RemoveBestFit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_int_p(int *addr, int value, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_int_p(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 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_int_p(i32* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void fmtst2chk(char *fmt) {
  (void)fputs(fmt, stdout);
  (void)printf(":\t`");
  (void)printf(fmt, 4, 4, 0x12);
  (void)printf("'\n");
}


x86 assembly (clang, -O0):
<fmtst2chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%edx
mov    $0x12,%ecx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmtst2chk>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
call   1050 <fputs@plt>
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
mov    $0x12,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe94(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [4 x i8] c":\09`\00"
@.str.1 = [3 x i8] c"'\0A\00"
define void @fmtst2chk(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* %7, i32 4, i32 4, i32 18)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c":\09`\00"
@str = [2 x i8] c"'\00"
define void @fmtst2chk(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i32 4, i32 4, i32 18)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
void MSG_(char *str) {}


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

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

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

LLVM IR (-O2):
define void @MSG_(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ tga_write_byte(int /*<<< orphan*/ *, int);
void tga_write_word(FILE *fp, uint16_t word) {
  tga_write_byte(fp, word & 255);
  tga_write_byte(fp, word >> 8);
}


x86 assembly (clang, -O0):
<tga_write_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0xff,%esi
call   1030 <tga_write_byte@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x8,%esi
call   1030 <tga_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tga_write_word>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%esi
call   1030 <tga_write_byte@plt>
sar    $0x8,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <tga_write_byte@plt>

LLVM IR (-O0):
define void @tga_write_word(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, 255
%8 = call i32 @tga_write_byte(i32* %5, i32 %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = call i32 @tga_write_byte(i32* %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @tga_write_word(i32* %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @tga_write_byte(i32* %0, i32 %3)
%5 = ashr i32 %1, 8
%6 = tail call i32 @tga_write_byte(i32* %0, i32 %5)
ret void
}
/* Variables and functions */
scalar_t__ isalnum(int);
scalar_t__ isspace(int);
int ispunct(int c) { return (isalnum(c) || isspace(c)) ? 1 : 0; }


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <ispunct+0x37>
mov    -0x4(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <ispunct+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalnum(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isspace(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isspace(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ owner;
};
struct TYPE_4__ {
  TYPE_1__ xselectionrequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xselectionrequest_owner(void *_p) {
  return (unsigned long)((XEvent *)_p)->xselectionrequest.owner;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i64 @get_XEvent_xselectionrequest_owner(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_XEvent_xselectionrequest_owner(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void tabulate() {
  int i;
  for (i = 0; i < 2; i++) {
    putchar(' ');
  }
}


x86 assembly (clang, -O0):
<tabulate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    1141 <tabulate+0x31>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <tabulate+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tabulate>:
push   %rax
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @tabulate() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 2
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @putchar(i8 signext 32)
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @tabulate() {
%1 = tail call i32 @putchar(i8 signext 32)
%2 = tail call i32 @putchar(i8 signext 32)
ret void
}
int getKey(int count) {
  int key;
  switch (count) {
  case 0:
    key = 0;
    break;
  case 1:
    key = 3;
    break;
  case 2:
    key = 2;
    break;
  case 3:
    key = 1;
    break;
  }
  return key;
}


x86 assembly (clang, -O0):
<getKey>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     1157 <getKey+0x57>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x8(%rbp)
jmp    1157 <getKey+0x57>
movl   $0x3,-0x8(%rbp)
jmp    1157 <getKey+0x57>
movl   $0x2,-0x8(%rbp)
jmp    1157 <getKey+0x57>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getKey>:
mov    $0x4,%ecx
sub    %edi,%ecx
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x3,%edi
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getKey(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i32 0, i32* %3
br label %9
6: ; preds = %1
store i32 3, i32* %3
br label %9
7: ; preds = %1
store i32 2, i32* %3
br label %9
8: ; preds = %1
store i32 1, i32* %3
br label %9
9: ; preds = %1, %8, %7, %6, %5
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @getKey(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
%4 = sub i32 4, %0
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
/* Variables and functions */
unsigned int RAND_MAX;
unsigned int random();
unsigned int get_urnd(unsigned int max) {
  unsigned int divisor = RAND_MAX / (max + 1);
  long retval;
  do {
    retval = random() / divisor;
  } while (retval >= max);
  return (unsigned int)retval;
}


x86 assembly (clang, -O0):
<get_urnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
cmp    %rcx,%rax
jge    1131 <get_urnd+0x21>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_urnd>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecc(%rip),%rax
mov    (%rax),%eax
lea    0x1(%rbx),%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ebp
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <random@plt>
xor    %edx,%edx
div    %ebp
cmp    %ebx,%eax
jae    1130 <get_urnd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @get_urnd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* @RAND_MAX
%6 = load i32, i32* %2
%7 = add i32 %6, 1
%8 = udiv i32 %5, %7
store i32 %8, i32* %3
br label %9
9: ; preds = %14, %1
%10 = call i32 (...) @random()
%11 = load i32, i32* %3
%12 = udiv i32 %10, %11
%13 = zext i32 %12 to i64
store i64 %13, i64* %4
br label %14
14: ; preds = %9
%15 = load i64, i64* %4
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = icmp sge i64 %15, %17
br i1 %18, label %9, label %19
19: ; preds = %14
%20 = load i64, i64* %4
%21 = trunc i64 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @get_urnd(i32 %0) {
%2 = load i32, i32* @RAND_MAX
%3 = add i32 %0, 1
%4 = udiv i32 %2, %3
br label %5
5: ; preds = %5, %1
%6 = tail call i32 (...) @random()
%7 = udiv i32 %6, %4
%8 = icmp ult i32 %7, %0
br i1 %8, label %9, label %5
9: ; preds = %5
ret i32 %7
}
void setval_237(unsigned *p) { *p = 3351742792U; }


x86 assembly (clang, -O0):
<setval_237>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xc7c78948,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setval_237>:
movl   $0xc7c78948,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_237(i32* nocapture writeonly %0) {
store i32 -943224504, i32* %0
ret void
}
void out_be32(volatile unsigned *addr, int val) { *addr = val; }


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

x86 assembly (clang, -O2):
<out_be32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @out_be32(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
store volatile i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @out_be32(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
ret void
}
/* Variables and functions */
int setenv(char const *, char const *, int);
int idris2_setenv(const char *name, const char *value, int overwrite) {
  return setenv(name, value, overwrite);
}


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

x86 assembly (clang, -O2):
<idris2_setenv>:
jmp    1030 <setenv@plt>

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

LLVM IR (-O2):
define i32 @idris2_setenv(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @setenv(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void SE_utils_log(char *message) { printf("LOG:%s\n", message); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"LOG:%s\0A\00"
define void @SE_utils_log(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void header(void) {
  puts("\tlgool  V 0.2");
  puts("written by l0om - WWW.EXCLUDED.ORG - l0om[47]excluded[d07]org\n");
}


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

x86 assembly (clang, -O2):
<header>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"\09lgool V 0.2\00"
@.str.1 = [63 x i8] c"written by l0om - WWW.EXCLUDED.ORG - l0om[47]excluded[d07]org\0A\00"
define void @header() {
%1 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"\09lgool V 0.2\00"
@.str.1 = [63 x i8] c"written by l0om - WWW.EXCLUDED.ORG - l0om[47]excluded[d07]org\0A\00"
define void @header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void some_function(void) { usleep(1); }


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

x86 assembly (clang, -O2):
<some_function>:
mov    $0x1,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @some_function() {
%1 = call i32 @usleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @some_function() {
%1 = tail call i32 @usleep(i32 1)
ret void
}
float f_min(float a, float b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<f_min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <f_min+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <f_min+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_min>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f_min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @f_min(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
void gdk_region_rect_in() {}


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

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

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

LLVM IR (-O2):
define void @gdk_region_rect_in() {
ret void
}