xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long green_max;
};
typedef TYPE_1__ XStandardColormap;

/* Variables and functions */
void set_XStandardColormap_green_max(void *_p, unsigned long _v) {
  ((XStandardColormap *)_p)->green_max = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XStandardColormap_green_max>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XStandardColormap_green_max(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XStandardColormap_green_max(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void die(char *msg) {
  perror(msg);
  exit(42);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x2a,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <perror@plt>
mov    $0x2a,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 42)
unreachable
}

LLVM IR (-O2):
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 42)
unreachable
}
void BotShutdownDeathmatchAI(void) {}


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

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

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

LLVM IR (-O2):
define void @BotShutdownDeathmatchAI() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
extern void yyerror(char *msg) {
  extern int yylineno;
  printf("Error in line %d: %s\n", yylineno, msg);
}


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

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%esi
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Error in line %d: %s\0A\00"
@yylineno = external global i32
define void @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @yylineno
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Error in line %d: %s\0A\00"
@yylineno = external global i32
define void @yyerror(i8* %0) {
%2 = load i32, i32* @yylineno
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %0)
ret void
}
int test_imm_05uint16_mem(unsigned short *val) {
  return ((*val) & (0x05 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_05uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 5
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int getOpamp() {}


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

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

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

LLVM IR (-O2):
define i32 @getOpamp() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ i2c_smbus_write_byte(int, unsigned char);
int i2cSetAddress(int i2cAdapter, unsigned char address) {
  if (i2c_smbus_write_byte(i2cAdapter, address) < 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<i2cSetAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%edi
movzbl -0x9(%rbp),%esi
call   1030 <i2c_smbus_write_byte@plt>
cmp    $0x0,%rax
jge    1143 <i2cSetAddress+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    114a <i2cSetAddress+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2cSetAddress>:
push   %rax
call   1030 <i2c_smbus_write_byte@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @i2cSetAddress(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%6 = load i32, i32* %4
%7 = load i8, i8* %5
%8 = call i64 @i2c_smbus_write_byte(i32 %6, i8 zeroext %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @i2cSetAddress(i32 %0, i8 zeroext %1) {
%3 = tail call i64 @i2c_smbus_write_byte(i32 %0, i8 zeroext %1)
%4 = ashr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
int GCD(int x, int y) {
  int g;
  g = x;
  while (x % g != 0 || y % g != 0) {
    g--;
  }
  return (g);
}


x86 assembly (clang, -O0):
<GCD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0xd(%rbp)
jne    1135 <GCD+0x35>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1145 <GCD+0x45>
jmp    1153 <GCD+0x53>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1110 <GCD+0x10>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GCD>:
mov    %edi,%ecx
jmp    1113 <GCD+0x13>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0xffffffff,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
jne    1110 <GCD+0x10>
mov    %esi,%eax
cltd
idiv   %ecx
test   %edx,%edx
jne    1110 <GCD+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @GCD(i32 %0, i32 %1) {
br label %3
3: ; preds = %10, %2
%4 = phi i32 [ %0, %2 ], [ %11, %10 ]
%5 = srem i32 %0, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = srem i32 %1, %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %3, %7
%11 = add nsw i32 %4, -1
br label %3
12: ; preds = %7
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ unused(char const *);
void adaptcase_refresh_dir(const char *directory) { unused(directory); }


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

x86 assembly (clang, -O2):
<adaptcase_refresh_dir>:
jmp    1030 <unused@plt>

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

LLVM IR (-O2):
define void @adaptcase_refresh_dir(i8* %0) {
%2 = tail call i32 @unused(i8* %0)
ret void
}
void foo567() {}


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

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

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

LLVM IR (-O2):
define void @foo567() {
ret void
}
int main(void) {
  double lower = 99.4, upper = 99.5;
  int one = 1, two = 2, ninetynine = 99;
  if (upper >= lower && two) {
    return 40 + (one < two && one < two) + (ninetynine && ninetynine);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xef5(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x2,-0x20(%rbp)
movl   $0x63,-0x24(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11ae <main+0xae>
cmpl   $0x0,-0x20(%rbp)
je     11ae <main+0xae>
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x20(%rbp),%ecx
mov    %al,-0x25(%rbp)
jge    1171 <main+0x71>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
setl   %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x28,%eax
mov    %eax,-0x2c(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x24(%rbp)
mov    %al,-0x26(%rbp)
je     1198 <main+0x98>
cmpl   $0x0,-0x24(%rbp)
setne  %al
mov    %al,-0x26(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x26(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    11b5 <main+0xb5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store double 9.940000e+01, double* %2
store double 9.950000e+01, double* %3
store i32 1, i32* %4
store i32 2, i32* %5
store i32 99, i32* %6
%7 = load double, double* %3
%8 = load double, double* %2
%9 = fcmp oge double %7, %8
br i1 %9, label %10, label %34
10: ; preds = %0
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %34
13: ; preds = %10
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = icmp slt i32 %18, %19
br label %21
21: ; preds = %17, %13
%22 = phi i1 [ false, %13 ], [ %20, %17 ]
%23 = zext i1 %22 to i32
%24 = add nsw i32 40, %23
%25 = load i32, i32* %6
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %21
%28 = load i32, i32* %6
%29 = icmp ne i32 %28, 0
br label %30
30: ; preds = %27, %21
%31 = phi i1 [ false, %21 ], [ %29, %27 ]
%32 = zext i1 %31 to i32
%33 = add nsw i32 %24, %32
store i32 %33, i32* %1
br label %35
34: ; preds = %10, %0
store i32 0, i32* %1
br label %35
35: ; preds = %34, %30
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ rewinddir(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) void softboundcets_rewinddir(DIR *dirp) {
  rewinddir(dirp);
}


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

x86 assembly (clang, -O2):
<softboundcets_rewinddir>:
jmp    1030 <rewinddir@plt>

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

LLVM IR (-O2):
define weak void @softboundcets_rewinddir(i32* %0) {
%2 = tail call i32 @rewinddir(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int __def_heap_data_release(void *_dat) {
  free(_dat);
  return 1;
}


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

x86 assembly (clang, -O2):
<__def_heap_data_release>:
push   %rax
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @__def_heap_data_release(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 1
}
void myPutchar(void *arg, char c) {
  char **s = (char **)arg;
  *(*s)++ = c;
}


x86 assembly (clang, -O0):
<myPutchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<myPutchar>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    %sil,(%rax)
ret

LLVM IR (-O0):
define void @myPutchar(i8* %0, i8 signext %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 = bitcast i8* %6 to i8**
store i8** %7, i8*** %5
%8 = load i8, i8* %4
%9 = load i8**, i8*** %5
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %9
store i8 %8, i8* %10
ret void
}

LLVM IR (-O2):
define void @myPutchar(i8* nocapture %0, i8 signext %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %3
store i8 %1, i8* %4
ret void
}
/* Variables and functions */
int syscall(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int exit(int errorlevel) { return syscall(1, errorlevel, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x1,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <syscall@plt>
mov    %eax,-0x4(%rbp)

x86 assembly (clang, -O2):
<exit>:
push   %rax
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    $0x1,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>

LLVM IR (-O0):
define i32 @exit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @syscall(i32 1, i32 %4, i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 %5, i32* %2
unreachable
}

LLVM IR (-O2):
define i32 @exit(i32 %0) {
%2 = tail call i32 @syscall(i32 1, i32 %0, i32 0, i32 0, i32 0, i32 0, i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void malloc_check_double_pointer(uint8_t **check_me, char *name) {
  if (check_me == NULL) {
    fprintf(stderr, "%s malloc error\n", name);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<malloc_check_double_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115e <malloc_check_double_pointer+0x3e>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_check_double_pointer>:
test   %rdi,%rdi
je     1126 <malloc_check_double_pointer+0x6>
ret
push   %rax
mov    %rsi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"%s malloc error\0A\00"
define void @malloc_check_double_pointer(i32** %0, i8* %1) {
%3 = alloca i32**
%4 = alloca i8*
store i32** %0, i32*** %3
store i8* %1, i8** %4
%5 = load i32**, i32*** %3
%6 = icmp eq i32** %5, null
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"%s malloc error\0A\00"
define void @malloc_check_double_pointer(i32** readnone %0, i8* %1) {
%3 = icmp eq i32** %0, null
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show_backtrace(int);
void *time__Tm__gmtime_from_timet(void *self, void *p0) {
  void *var;
  printf("NOT YET IMPLEMENTED nitni for time#Tm#gmtime_from_timet at "
         "lib/standard/time.nit:58,2--62,3\n");
  show_backtrace(1);
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<time__Tm__gmtime_from_timet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <show_backtrace@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time__Tm__gmtime_from_timet>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <show_backtrace@plt>

LLVM IR (-O0):
@.str = [93 x i8] c"NOT YET IMPLEMENTED nitni for time#Tm#gmtime_from_timet at lib/standard/time.nit:58,2--62,3\0A\00"
define i8* @time__Tm__gmtime_from_timet(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @show_backtrace(i32 1)
br label %8
8: ; preds = %2
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
@str = [92 x i8] c"NOT YET IMPLEMENTED nitni for time#Tm#gmtime_from_timet at lib/standard/time.nit:58,2--62,3\00"
define noalias i8* @time__Tm__gmtime_from_timet(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @show_backtrace(i32 1)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void netSleep(int milliseconds) { usleep(milliseconds * 1000); }


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

x86 assembly (clang, -O2):
<netSleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @netSleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ startPapiCounters();
int /*<<< orphan*/ stopPapiCounters();
int main() {
  startPapiCounters();
  stopPapiCounters();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @startPapiCounters()
%3 = call i32 (...) @stopPapiCounters()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @startPapiCounters()
%2 = tail call i32 (...) @stopPapiCounters()
ret i32 0
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
void *realloc(void *, size_t);
void *_realloc_r(struct _reent *ptr, void *old, size_t newlen) {
  return realloc(old, newlen);
}


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

x86 assembly (clang, -O2):
<_realloc_r>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
%struct._reent = type { i32 }
define i8* @_realloc_r(%struct._reent* %0, i8* %1, i64 %2) {
%4 = alloca %struct._reent*
%5 = alloca i8*
%6 = alloca i64
store %struct._reent* %0, %struct._reent** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = call i8* @realloc(i8* %7, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define noalias i8* @_realloc_r(%struct._reent* nocapture readnone %0, i8* nocapture %1, i64 %2) {
%4 = tail call i8* @realloc(i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int physmem_total();
double physmem_available(void) { return physmem_total() / 4; }


x86 assembly (clang, -O0):
<physmem_available>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <physmem_total@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<physmem_available>:
push   %rax
xor    %eax,%eax
call   1030 <physmem_total@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
sar    $0x2,%ecx
cvtsi2sd %ecx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @physmem_available() {
%1 = call i32 (...) @physmem_total()
%2 = sdiv i32 %1, 4
%3 = sitofp i32 %2 to double
ret double %3
}

LLVM IR (-O2):
define double @physmem_available() {
%1 = tail call i32 (...) @physmem_total()
%2 = sdiv i32 %1, 4
%3 = sitofp i32 %2 to double
ret double %3
}
char *ecc108h_get_library_version(void) {
  static char *version = "\x1\x2\x0";
  return version;
}


x86 assembly (clang, -O0):
<ecc108h_get_library_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecc108h_get_library_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@ecc108h_get_library_version.version = internal global i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0)
@.str = [4 x i8] c"\01\02\00\00"
define i8* @ecc108h_get_library_version() {
%1 = load i8*, i8** @ecc108h_get_library_version.version
ret i8* %1
}

LLVM IR (-O2):
@.str = [4 x i8] c"\01\02\00\00"
define i8* @ecc108h_get_library_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ arithmatic();
int /*<<< orphan*/ conditional();
int yyselect();
binary_op() {
  switch (yyselect()) {
  case 63: {
    arithmatic();
  } break;
  case 64: {
    conditional();
  } break;
  }
}


x86 assembly (clang, -O0):
<binary_op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <yyselect@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x3f,%eax
je     1163 <binary_op+0x33>
jmp    1152 <binary_op+0x22>
mov    -0x8(%rbp),%eax
sub    $0x40,%eax
je     116f <binary_op+0x3f>
jmp    1176 <binary_op+0x46>
mov    $0x0,%al
call   1050 <arithmatic@plt>
jmp    1176 <binary_op+0x46>
mov    $0x0,%al
call   1040 <conditional@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_op>:
push   %rax
xor    %eax,%eax
call   1030 <yyselect@plt>
cmp    $0x40,%eax
je     114b <binary_op+0x1b>
cmp    $0x3f,%eax
jne    1152 <binary_op+0x22>
xor    %eax,%eax
call   1050 <arithmatic@plt>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <conditional@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @binary_op() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %7 [
i32 63, label %3
i32 64, label %5
]
3: ; preds = %0
%4 = call i32 (...) @arithmatic()
br label %7
5: ; preds = %0
%6 = call i32 (...) @conditional()
br label %7
7: ; preds = %0, %5, %3
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @binary_op() {
%1 = tail call i32 (...) @yyselect()
switch i32 %1, label %6 [
i32 63, label %2
i32 64, label %4
]
2: ; preds = %0
%3 = tail call i32 (...) @arithmatic()
br label %6
4: ; preds = %0
%5 = tail call i32 (...) @conditional()
br label %6
6: ; preds = %0, %4, %2
ret i32 undef
}
int input_map_a1(char c) {
  if (c == 'a')
    return 1;
  if (c >= '0' && c <= '7')
    return 2;
  else
    return 0;
}


x86 assembly (clang, -O0):
<input_map_a1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jne    1123 <input_map_a1+0x23>
movl   $0x1,-0x4(%rbp)
jmp    1150 <input_map_a1+0x50>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1149 <input_map_a1+0x49>
movsbl -0x5(%rbp),%eax
cmp    $0x37,%eax
jg     1149 <input_map_a1+0x49>
movl   $0x2,-0x4(%rbp)
jmp    1150 <input_map_a1+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_map_a1>:
mov    %edi,%eax
and    $0xf8,%al
xor    %ecx,%ecx
cmp    $0x30,%al
sete   %cl
add    %ecx,%ecx
cmp    $0x61,%dil
mov    $0x1,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @input_map_a1(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 97
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %18
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sge i32 %10, 48
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 55
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 2, i32* %2
br label %18
17: ; preds = %12, %8
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %7
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @input_map_a1(i8 signext %0) {
%2 = icmp eq i8 %0, 97
%3 = and i8 %0, -8
%4 = icmp eq i8 %3, 48
%5 = select i1 %4, i32 2, i32 0
%6 = select i1 %2, i32 1, i32 %5
ret i32 %6
}
int Media_Stop() {}


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

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

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

LLVM IR (-O2):
define i32 @Media_Stop() {
ret i32 undef
}
void ff_hevc_put_hevc_epel_h6_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_h6_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
char *send_to(char *, int, char *);
int main(int argc, char **argv) {
  char *rec = send_to("127.0.0.1", 80, argv[1]);
  puts(rec);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xec2(%rip),%rdi
mov    $0x50,%esi
call   1040 <send_to@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdx
lea    0xed4(%rip),%rdi
mov    $0x50,%esi
call   1040 <send_to@plt>
mov    %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"127.0.0.1\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i8* @send_to(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 80, i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i32 @puts(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"127.0.0.1\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i8* @send_to(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 80, i8* %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printMellowStringInfo(void *mellowStr) {
  printf("Runtime header: %d\n", ((uint64_t *)mellowStr)[0]);
  printf("Length        : %d\n", ((uint64_t *)mellowStr)[1]);
}


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

x86 assembly (clang, -O2):
<printMellowStringInfo>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
lea    0xee8(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Runtime header: %d\0A\00"
@.str.1 = [20 x i8] c"Length : %d\0A\00"
define void @printMellowStringInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Runtime header: %d\0A\00"
@.str.1 = [20 x i8] c"Length : %d\0A\00"
define void @printMellowStringInfo(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}
void monkey(void) {
  int q;
  int a[4];
  int b;
  int c;
  b = b / 2;
  while (b == 3) {
    int x;
    x = q + 2;
  }
  if (c == b) {
    a[2 + 1] = 3;
  }
  return;
}


x86 assembly (clang, -O0):
<monkey>:
push   %rbp
mov    %rsp,%rbp
mov    -0x24(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
cmpl   $0x3,-0x24(%rbp)
jne    112a <monkey+0x2a>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x2c(%rbp)
jmp    1112 <monkey+0x12>
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    113d <monkey+0x3d>
movl   $0x3,-0x14(%rbp)
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ esp_rom_crc32_le(int /*<<< orphan*/,
                                    int /*<<< orphan*/ const *,
                                    int /*<<< orphan*/);
uint32_t esp_crc32_le(uint32_t crc, uint8_t const *buf, uint32_t len) {
  return esp_rom_crc32_le(crc, buf, len);
}


x86 assembly (clang, -O0):
<esp_crc32_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <esp_rom_crc32_le@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esp_crc32_le>:
jmp    1030 <esp_rom_crc32_le@plt>

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

LLVM IR (-O2):
define i32 @esp_crc32_le(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @esp_rom_crc32_le(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
char *trim_before(char *str) {
  if (str) {
    while (*str == '\t' || *str == ' ')
      str++;
  }
  return (str);
}


x86 assembly (clang, -O0):
<trim_before>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1163 <trim_before+0x63>
jmp    1118 <trim_before+0x18>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x9(%rbp)
je     113d <trim_before+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    114d <trim_before+0x4d>
jmp    115e <trim_before+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1118 <trim_before+0x18>
jmp    1163 <trim_before+0x63>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_before>:
test   %rdi,%rdi
je     1122 <trim_before+0x22>
mov    %rdi,%rax
jmp    1114 <trim_before+0x14>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <trim_before+0x10>
cmp    $0x9,%cl
je     1110 <trim_before+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @trim_before(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %22
5: ; preds = %1
br label %6
6: ; preds = %18, %5
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 9
br i1 %10, label %16, label %11
11: ; preds = %6
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 32
br label %16
16: ; preds = %11, %6
%17 = phi i1 [ true, %6 ], [ %15, %11 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %2
br label %6
21: ; preds = %16
br label %22
22: ; preds = %21, %1
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @trim_before(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 9, label %6
i8 32, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %1
%9 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ esp_rom_crc16_le(int /*<<< orphan*/,
                                    int /*<<< orphan*/ const *,
                                    int /*<<< orphan*/);
uint16_t esp_crc16_le(uint16_t crc, uint8_t const *buf, uint32_t len) {
  return esp_rom_crc16_le(crc, buf, len);
}


x86 assembly (clang, -O0):
<esp_crc16_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <esp_rom_crc16_le@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esp_crc16_le>:
jmp    1030 <esp_rom_crc16_le@plt>

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

LLVM IR (-O2):
define i32 @esp_crc16_le(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @esp_rom_crc16_le(i32 %0, i32* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ vecNf_sub_new(float *, float const *, float const *, int);
void vec4f_sub_new(float result[4], const float a[4], const float b[4]) {
  vecNf_sub_new(result, a, b, 4);
}


x86 assembly (clang, -O0):
<vec4f_sub_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <vecNf_sub_new@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4f_sub_new>:
mov    $0x4,%ecx
jmp    1030 <vecNf_sub_new@plt>

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

LLVM IR (-O2):
define void @vec4f_sub_new(float* %0, float* %1, float* %2) {
%4 = tail call i32 @vecNf_sub_new(float* %0, float* %1, float* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void end_asig_section() {
  write("ganttproject.gan", "\t</allocations>\n", NULL);
}


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

x86 assembly (clang, -O2):
<end_asig_section>:
lea    0xee9(%rip),%rdi
lea    0xef3(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [17 x i8] c"\09</allocations>\0A\00"
define void @end_asig_section() {
%1 = call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"ganttproject.gan\00"
@.str.1 = [17 x i8] c"\09</allocations>\0A\00"
define void @end_asig_section() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_test_encoding_name(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_test_encoding_name() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_test_encoding_name() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t gfmul(uint8_t a, uint8_t b) {
  uint8_t v = 0;
  while (b) {
    if (b & 1)
      v ^= a;
    a = (a << 1) ^ (a & 0x80 ? 0x1d : 0);
    b >>= 1;
  }
  return v;
}


x86 assembly (clang, -O0):
<gfmul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1162 <gfmul+0x62>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1133 <gfmul+0x33>
mov    -0x4(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%esi
and    $0x80,%esi
xor    %ecx,%ecx
mov    $0x1d,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1111 <gfmul+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfmul>:
xor    %eax,%eax
test   %esi,%esi
je     1133 <gfmul+0x33>
mov    %esi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %esi,%edx
and    $0x1,%edx
neg    %edx
and    %edi,%edx
xor    %edx,%eax
lea    (%rdi,%rdi,1),%edx
movsbl %dil,%edi
shr    $0x7,%edi
and    $0x1d,%edi
xor    %edx,%edi
sar    %ecx
cmp    $0x1,%esi
mov    %ecx,%esi
ja     1110 <gfmul+0x10>
ret

LLVM IR (-O0):
define i32 @gfmul(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %28
9: ; preds = %6
%10 = load i32, i32* %4
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = xor i32 %15, %14
store i32 %16, i32* %5
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %3
%19 = shl i32 %18, 1
%20 = load i32, i32* %3
%21 = and i32 %20, 128
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 29, i32 0
%25 = xor i32 %19, %24
store i32 %25, i32* %3
%26 = load i32, i32* %4
%27 = ashr i32 %26, 1
store i32 %27, i32* %4
br label %6
28: ; preds = %6
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
define i32 @gfmul(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %19, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 0, %2 ]
%6 = phi i32 [ %17, %4 ], [ %1, %2 ]
%7 = phi i32 [ %16, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 0, i32 %7
%11 = xor i32 %10, %5
%12 = shl i32 %7, 1
%13 = and i32 %7, 128
%14 = icmp eq i32 %13, 0
%15 = select i1 %14, i32 0, i32 29
%16 = xor i32 %15, %12
%17 = ashr i32 %6, 1
%18 = icmp ult i32 %6, 2
br i1 %18, label %19, label %4
19: ; preds = %4, %2
%20 = phi i32 [ 0, %2 ], [ %11, %4 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ NET_ShowIP();
void CL_ShowIP_f(void) { NET_ShowIP(); }


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

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

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

LLVM IR (-O2):
define void @CL_ShowIP_f() {
%1 = tail call i32 (...) @NET_ShowIP()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int fput_long(uint32_t val, FILE *file) {
  val = htonl(val);
  return fwrite(&val, 4, 1, file);
}


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

x86 assembly (clang, -O2):
<fput_long>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fput_long(i32 %0, i32* nocapture %1) {
%3 = alloca i32
%4 = tail call i32 @htonl(i32 %0)
store i32 %4, i32* %3
%5 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %1)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;
typedef scalar_t__ volatile int32_t;

/* Variables and functions */
int32_t GPIOPinRead(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  return ((*((volatile uint32_t *)(ui32Port + (0x00000000 + (ui8Pins << 2))))));
}


x86 assembly (clang, -O0):
<GPIOPinRead>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinRead>:
shl    $0x2,%esi
movslq %esi,%rax
mov    (%rax,%rdi,1),%rax
ret

LLVM IR (-O0):
define i64 @GPIOPinRead(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = shl i32 %6, 2
%8 = add nsw i32 0, %7
%9 = sext i32 %8 to i64
%10 = add nsw i64 %5, %9
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @GPIOPinRead(i64 %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = sext i32 %3 to i64
%5 = add nsw i64 %4, %0
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
ret i64 %7
}
/* Variables and functions */
int __dbg_hex(bool cond, const char *file, const char *func, unsigned lineno,
              const void *in_buf, size_t size, const char *fmt, ...) {
  return 0;
}


x86 assembly (clang, -O0):
<__dbg_hex>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__dbg_hex(i32 %0, i8* %1, i8* %2, i32 %3, i8* %4, i64 %5, i8* %6, ...) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
store i32 %0, i32* %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i64 %5, i64* %13
store i8* %6, i8** %14
ret i32 0
}

LLVM IR (-O2):
define i32 @__dbg_hex(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i64 %5, i8* nocapture readnone %6, ...) {
ret i32 0
}
int ec_running(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ec_running() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ts_free_default(void *buffer) { free(buffer); }


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

x86 assembly (clang, -O2):
<ts_free_default>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ts_free_default(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}