xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t ptrCount(const void **ptr) {
  size_t result = 0;
  if (ptr)
    while (*ptr++)
      result++;
  return result;
}


x86 assembly (clang, -O0):
<ptrCount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114f <ptrCount+0x4f>
jmp    1120 <ptrCount+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,(%rax)
je     114a <ptrCount+0x4a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <ptrCount+0x20>
jmp    114f <ptrCount+0x4f>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrCount>:
test   %rdi,%rdi
je     1120 <ptrCount+0x20>
cmpq   $0x0,(%rdi)
je     1120 <ptrCount+0x20>
xor    %ecx,%ecx
nopl   (%rax)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rdi,%rcx,8)
mov    %rax,%rcx
jne    1110 <ptrCount+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @ptrCount(i8** %0) {
%2 = alloca i8**
%3 = alloca i64
store i8** %0, i8*** %2
store i64 0, i64* %3
%4 = load i8**, i8*** %2
%5 = icmp ne i8** %4, null
br i1 %5, label %6, label %16
6: ; preds = %1
br label %7
7: ; preds = %12, %6
%8 = load i8**, i8*** %2
%9 = getelementptr inbounds i8*, i8** %8, i32 1
store i8** %9, i8*** %2
%10 = load i8*, i8** %8
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i64, i64* %3
%14 = add i64 %13, 1
store i64 %14, i64* %3
br label %7
15: ; preds = %7
br label %16
16: ; preds = %15, %1
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @ptrCount(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i64 [ %10, %6 ], [ 0, %3 ]
%8 = phi i8** [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = add i64 %7, 1
%11 = load i8*, i8** %9
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i64 [ 0, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i64 %14
}
int test_imm_0Aint64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x0A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Aint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 10
%7 = icmp ne i64 %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_0Aint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 655360
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void newlinespec2newlinespec_unit_newlinespec() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_sad_epu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_sad_epu8(__m128i A, __m128i B) { return _mm_sad_epu8(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_sad_epu8>:
jmp    1030 <_mm_sad_epu8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_sad_epu8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sad_epu8(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;
typedef int time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *calloc(int, int);
struct tm *localtime(int *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
char *FormatTime(uint64_t TimeMs) {
  char *timeBuff = calloc(20 + 1, 1);
  struct tm *timeinfo;
  time_t timeRaw = TimeMs / 1000;
  timeinfo = localtime(&timeRaw);
  strftime(timeBuff, 20, "%Y-%m-%d %H:%M:%S", timeinfo);
  return timeBuff;
}


x86 assembly (clang, -O0):
<FormatTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x15,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x14,%esi
lea    0xe83(%rip),%rdx
call   1050 <strftime@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FormatTime>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x15,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%r14
movslq %ebx,%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xe8c(%rip),%rdx
mov    %r14,%rdi
mov    $0x14,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @FormatTime(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.tm*
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i8* @calloc(i32 21, i32 1)
store i8* %6, i8** %3
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 1000
store i32 %8, i32* %5
%9 = call %struct.tm* @localtime(i32* %5)
store %struct.tm* %9, %struct.tm** %4
%10 = load i8*, i8** %3
%11 = load %struct.tm*, %struct.tm** %4
%12 = call i32 @strftime(i8* %10, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @FormatTime(i32 %0) {
%2 = alloca i32
%3 = tail call dereferenceable_or_null(21) i8* @calloc(i32 21, i32 1)
%4 = bitcast i32* %2 to i8*
%5 = sdiv i32 %0, 1000
store i32 %5, i32* %2
%6 = call %struct.tm* @localtime(i32* %2)
%7 = call i32 @strftime(i8* %3, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret i8* %3
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ srand(scalar_t__);
scalar_t__ time(int /*<<< orphan*/ *);
void randgen_init(void) {
  srand(time(NULL) + getpid());
  return;
}


x86 assembly (clang, -O0):
<randgen_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x8(%rbp),%rdi
add    %rax,%rdi
call   1040 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randgen_init>:
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
add    %rax,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <srand@plt>

LLVM IR (-O0):
define void @randgen_init() {
%1 = call i64 @time(i32* null)
%2 = call i64 (...) @getpid()
%3 = add nsw i64 %1, %2
%4 = call i32 @srand(i64 %3)
ret void
}

LLVM IR (-O2):
define void @randgen_init() {
%1 = tail call i64 @time(i32* null)
%2 = tail call i64 (...) @getpid()
%3 = add nsw i64 %2, %1
%4 = tail call i32 @srand(i64 %3)
ret void
}
/* Variables and functions */
long labs(long);
int long_chars(long numb) {
  int i;
  long l;
  l = labs(numb);
  i = 1;
  while (l > 9) {
    i++;
    l /= 10;
  }
  return i;
}


x86 assembly (clang, -O0):
<long_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <labs@plt>
mov    %rax,-0x18(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x9,-0x18(%rbp)
jle    115b <long_chars+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
jmp    1130 <long_chars+0x20>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_chars>:
mov    %rdi,%rcx
neg    %rcx
cmovs  %rdi,%rcx
mov    $0x1,%esi
cmp    $0xa,%rcx
jb     1146 <long_chars+0x46>
mov    $0x1,%esi
movabs $0xcccccccccccccccd,%rdi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%esi
mov    %rcx,%rax
mul    %rdi
shr    $0x3,%rdx
cmp    $0x63,%rcx
mov    %rdx,%rcx
ja     1130 <long_chars+0x30>
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @long_chars(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
%3 = icmp ugt i64 %2, 9
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ %2, %1 ]
%6 = phi i32 [ %7, %4 ], [ 1, %1 ]
%7 = add nuw nsw i32 %6, 1
%8 = udiv i64 %5, 10
%9 = icmp ugt i64 %5, 99
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %11
}
int test_imm_97int16_reg(short val) {
  return ((val) & (-0x97 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_97int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff69,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_97int16_reg>:
test   $0xff69,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_97int16_reg(i16 signext %0) {
%2 = and i16 %0, -151
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *leerUnStringArbitrariamenteLargo();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Introduce tu nombre: ");
  char *nom = leerUnStringArbitrariamenteLargo();
  printf("Este es tu nombre: %s\n", nom);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <leerUnStringArbitrariamenteLargo@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <leerUnStringArbitrariamenteLargo@plt>
lea    0xed9(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Introduce tu nombre: \00"
@.str.1 = [23 x i8] c"Este es tu nombre: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i8* (...) @leerUnStringArbitrariamenteLargo()
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Introduce tu nombre: \00"
@.str.1 = [23 x i8] c"Este es tu nombre: %s\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* (...) @leerUnStringArbitrariamenteLargo()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int mkdirat(int /*<<< orphan*/, char *, int);
int main(void) { return mkdirat(AT_FDCWD, "test", 0666); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
mov    $0x1b6,%edx
call   1030 <mkdirat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x1b6,%edx
jmp    1030 <mkdirat@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @AT_FDCWD
%3 = call i32 @mkdirat(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 438)
ret i32 %3
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
@.str = [5 x i8] c"test\00"
define i32 @main() {
%1 = load i32, i32* @AT_FDCWD
%2 = tail call i32 @mkdirat(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 438)
ret i32 %2
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ basic_test(int);
int /*<<< orphan*/ cleanup_test();
int /*<<< orphan*/ init_test();
int log_write_middle(int);
void write_one_page_middle(void) {
  ssize_t n;
  init_test();
  n = log_write_middle(4096);
  basic_test(n == 4096);
  cleanup_test();
}


x86 assembly (clang, -O0):
<write_one_page_middle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <init_test@plt>
mov    $0x1000,%edi
call   1040 <log_write_middle@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <basic_test@plt>
mov    $0x0,%al
call   1050 <cleanup_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_one_page_middle>:
push   %rax
xor    %eax,%eax
call   1060 <init_test@plt>
mov    $0x1000,%edi
call   1040 <log_write_middle@plt>
xor    %edi,%edi
cmp    $0x1000,%eax
sete   %dil
call   1030 <basic_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cleanup_test@plt>

LLVM IR (-O0):
define void @write_one_page_middle() {
%1 = alloca i32
%2 = call i32 (...) @init_test()
%3 = call i32 @log_write_middle(i32 4096)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 4096
%6 = zext i1 %5 to i32
%7 = call i32 @basic_test(i32 %6)
%8 = call i32 (...) @cleanup_test()
ret void
}

LLVM IR (-O2):
define void @write_one_page_middle() {
%1 = tail call i32 (...) @init_test()
%2 = tail call i32 @log_write_middle(i32 4096)
%3 = icmp eq i32 %2, 4096
%4 = zext i1 %3 to i32
%5 = tail call i32 @basic_test(i32 %4)
%6 = tail call i32 (...) @cleanup_test()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           unsigned int, char const *);
int /*<<< orphan*/ stderr;
void assertInternal(const char *filename, unsigned int line, int cond,
                    const char *condString) {
  if (cond) {
    return;
  }
  fprintf(stderr, "%s:%i: assert %s\n", filename, line, condString);
  abort();
}


x86 assembly (clang, -O0):
<assertInternal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1146 <assertInternal+0x26>
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xe9f(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<assertInternal>:
test   %edx,%edx
je     1125 <assertInternal+0x5>
ret
push   %rax
mov    %rcx,%r8
mov    %esi,%ecx
mov    %rdi,%rax
mov    0x2eab(%rip),%rdx
mov    (%rdx),%edi
lea    0xec2(%rip),%rsi
mov    %rax,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"%s:%i: assert %s\0A\00"
define void @assertInternal(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %7
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %4
ret void
12: ; preds = %4
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = load i8*, i8** %8
%17 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %15, i8* %16)
%18 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"%s:%i: assert %s\0A\00"
define void @assertInternal(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = icmp eq i32 %2, 0
br i1 %5, label %7, label %6
6: ; preds = %4
ret void
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %3)
%10 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ my_fatal(char const *, int, char *);
char *allocator(int quantity, int size, const char *file, int line) {
  char *temp;
  if (!(temp = (char *)malloc((unsigned)quantity * size))) {
    my_fatal(file, line, "Memory allocation failure.\n");
    exit(1);
  }
  return (temp);
}


x86 assembly (clang, -O0):
<allocator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    117c <allocator+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    0xe93(%rip),%rdx
call   1040 <my_fatal@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocator>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
imul   %esi,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     114c <allocator+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xead(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <my_fatal@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Memory allocation failure.\0A\00"
define i8* @allocator(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = mul i32 %10, %11
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %9
%15 = icmp ne i8* %14, null
br i1 %15, label %21, label %16
16: ; preds = %4
%17 = load i8*, i8** %7
%18 = load i32, i32* %8
%19 = call i32 @my_fatal(i8* %17, i32 %18, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %4
%22 = load i8*, i8** %9
ret i8* %22
}

LLVM IR (-O2):
@.str = [28 x i8] c"Memory allocation failure.\0A\00"
define i8* @allocator(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = mul i32 %1, %0
%6 = tail call i64 @malloc(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = tail call i32 @my_fatal(i8* %2, i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %4
%12 = inttoptr i64 %6 to i8*
ret i8* %12
}
double evaluate(int i) { return 0.; }


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

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

LLVM IR (-O0):
define double @evaluate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @evaluate(i32 %0) {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void add10real(int *x, int *y) {
  printf("Second Function\n");
  *x += 10;
  *y += 10;
}


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

x86 assembly (clang, -O2):
<add10real>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
addl   $0xa,(%rbx)
addl   $0xa,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Second Function\0A\00"
define void @add10real(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 10
store i32 %8, i32* %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 10
store i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"Second Function\00"
define void @add10real(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* %0
%5 = add nsw i32 %4, 10
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 10
store i32 %7, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gcd(int, int);
int input();
int /*<<< orphan*/ output(int /*<<< orphan*/);
void main(void) {
  int x;
  int y;
  x = input();
  y = input();
  output(gcd(x, y));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <input@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <gcd@plt>
mov    %eax,%edi
call   1040 <output@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <input@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <input@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <gcd@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <output@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @input()
store i32 %3, i32* %1
%4 = call i32 (...) @input()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @gcd(i32 %5, i32 %6)
%8 = call i32 @output(i32 %7)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @input()
%2 = tail call i32 (...) @input()
%3 = tail call i32 @gcd(i32 %1, i32 %2)
%4 = tail call i32 @output(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo06();
void bar06() { foo06(); }


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

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

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

LLVM IR (-O2):
define void @bar06() {
%1 = tail call i32 (...) @foo06()
ret void
}
/* Variables and functions */
int do_send(int, char *);
int irc_version(int fd) { return do_send(fd, "VERSION"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"VERSION\00"
define i32 @irc_version(i32 %0) {
%2 = tail call i32 @do_send(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
struct net_interface_info {
  int dummy;
};
struct net_interface_event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
net_interface_const_obus_event(struct net_interface_event const *);
scalar_t__ obus_event_get_info(int /*<<< orphan*/);
const struct net_interface_info *
net_interface_event_get_info(const struct net_interface_event *event) {
  return (const struct net_interface_info *)obus_event_get_info(
      net_interface_const_obus_event(event));
}


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

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

LLVM IR (-O0):
%struct.net_interface_info = type { i32 }
%struct.net_interface_event = type { i32 }
define %struct.net_interface_info* @net_interface_event_get_info(%struct.net_interface_event* %0) {
%2 = alloca %struct.net_interface_event*
store %struct.net_interface_event* %0, %struct.net_interface_event** %2
%3 = load %struct.net_interface_event*, %struct.net_interface_event** %2
%4 = call i32 @net_interface_const_obus_event(%struct.net_interface_event* %3)
%5 = call i64 @obus_event_get_info(i32 %4)
%6 = inttoptr i64 %5 to %struct.net_interface_info*
ret %struct.net_interface_info* %6
}

LLVM IR (-O2):
%struct.net_interface_info = type { i32 }
%struct.net_interface_event = type { i32 }
define %struct.net_interface_info* @net_interface_event_get_info(%struct.net_interface_event* %0) {
%2 = tail call i32 @net_interface_const_obus_event(%struct.net_interface_event* %0)
%3 = tail call i64 @obus_event_get_info(i32 %2)
%4 = inttoptr i64 %3 to %struct.net_interface_info*
ret %struct.net_interface_info* %4
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_rec_flt(float *, float);
float xil_fpo_rec_flt(float a) {
  float res_flt;
  xip_fpo_rec_flt(&res_flt, a);
  return res_flt;
}


x86 assembly (clang, -O0):
<xil_fpo_rec_flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    -0x8(%rbp),%rdi
call   1030 <xip_fpo_rec_flt@plt>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_rec_flt>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_rec_flt@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @xil_fpo_rec_flt(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call i32 @xip_fpo_rec_flt(float* %3, float %4)
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @xil_fpo_rec_flt(float %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i32 @xip_fpo_rec_flt(float* %2, float %0)
%5 = load float, float* %2
ret float %5
}
unsigned int ic_parse_perm_has_immut(unsigned int permissions) {
  return 0 != (permissions & 0x08);
}


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

x86 assembly (clang, -O2):
<ic_parse_perm_has_immut>:
mov    %edi,%eax
shr    $0x3,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ic_parse_perm_has_immut(i32 %0) {
%2 = lshr i32 %0, 3
%3 = and i32 %2, 1
ret i32 %3
}
void R_Surf16Patch(void) {}


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

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

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

LLVM IR (-O2):
define void @R_Surf16Patch() {
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
scalar_t__ sancus_time_cmp(struct timespec const *, struct timespec const *);
int sancus_time_is_lt(const struct timespec *a, const struct timespec *b) {
  return sancus_time_cmp(a, b) < 0;
}


x86 assembly (clang, -O0):
<sancus_time_is_lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <sancus_time_cmp@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @sancus_time_is_lt(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i64 @sancus_time_cmp(%struct.timespec* %5, %struct.timespec* %6)
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @sancus_time_is_lt(%struct.timespec* %0, %struct.timespec* %1) {
%3 = tail call i64 @sancus_time_cmp(%struct.timespec* %0, %struct.timespec* %1)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
int useitp(val) const int *val;
{
  static int usedval;
  usedval = *val;
  return *val + sum_upto(0);
}


x86 assembly (clang, -O0):
<useitp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,0x2f04(%rip)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <sum_upto@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<useitp>:
push   %rbx
mov    (%rdi),%ebx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <sum_upto@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@useitp.usedval = internal global i32 0
define i32 @useitp(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
store i32 %4, i32* @useitp.usedval
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = call i32 (i32, ...) bitcast (i32 (...)* @sum_upto to i32 (i32, ...)*)(i32 0)
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @useitp(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @sum_upto to i32 (i32, ...)*)(i32 0)
%4 = add nsw i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ initTimer();
void borTimerInit() { initTimer(); }


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

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

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

LLVM IR (-O2):
define void @borTimerInit() {
%1 = tail call i32 (...) @initTimer()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XKeyReleasedEvent;

/* Variables and functions */
int get_XKeyReleasedEvent_send_event(void *_p) {
  return (int)((XKeyReleasedEvent *)_p)->send_event;
}


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

x86 assembly (clang, -O2):
<get_XKeyReleasedEvent_send_event>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XKeyReleasedEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ handle_SAK(int /*<<< orphan*/);
int gen_SAK() {
  handle_SAK(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_SAK>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_SAK@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_SAK() {
%1 = call i32 @handle_SAK(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_SAK() {
%1 = tail call i32 @handle_SAK(i32 0)
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcat(char *, char *);
char *str_cat(char *path, char *ext) {
  char *res = malloc(200);
  strcat(res, path);
  strcat(res, ext);
  return res;
}


x86 assembly (clang, -O0):
<str_cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cat>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @str_cat(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 i8* @malloc(i32 200)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %3
%9 = call i32 @strcat(i8* %7, i8* %8)
%10 = load i8*, i8** %5
%11 = load i8*, i8** %4
%12 = call i32 @strcat(i8* %10, i8* %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define i8* @str_cat(i8* %0, i8* %1) {
%3 = tail call dereferenceable_or_null(200) i8* @malloc(i32 200)
%4 = tail call i32 @strcat(i8* %3, i8* %0)
%5 = tail call i32 @strcat(i8* %3, i8* %1)
ret i8* %3
}
void eventOS_scheduler_mutex_wait(void) {}


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

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

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

LLVM IR (-O2):
define void @eventOS_scheduler_mutex_wait() {
ret void
}
/* Variables and functions */
int syscall(int, int, char const *, unsigned int);
int inotify_add_watch(int fd, const char *name, unsigned int mask) {
  return syscall(254, fd, name, mask);
}


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

x86 assembly (clang, -O2):
<inotify_add_watch>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0xfe,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @inotify_add_watch(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @syscall(i32 254, i32 %0, i8* %1, i32 %2)
ret i32 %4
}
int hash_name(char *name) {
  int i = 0;
  while (*name)
    i = (i << 1) ^ *name++;
  if (i < 0)
    i = -i;
  return i;
}


x86 assembly (clang, -O0):
<hash_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <hash_name+0x3e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_name+0xf>
cmpl   $0x0,-0xc(%rbp)
jge    1150 <hash_name+0x50>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_name>:
mov    (%rdi),%al
test   %al,%al
je     1124 <hash_name+0x24>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
add    %ecx,%ecx
movsbl %al,%eax
xor    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash_name+0x10>
jmp    1126 <hash_name+0x26>
xor    %ecx,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_name(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = xor i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
%16 = tail call i32 @llvm.abs.i32(i32 %15, i1 true)
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 10;
  while (a < 20) {
    printf("a: %d\n", a);
    a++;
    if (a > 15) {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    115c <main+0x4c>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jle    1157 <main+0x47>
jmp    115c <main+0x4c>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xb,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xf,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"a: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 11)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 12)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 13)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 14)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 15)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void _set_utf8(int enable) {
  if (enable)
    fprintf(stdout, "\x1B%%G");
  else
    fprintf(stdout, "\x1B%%@");
}


x86 assembly (clang, -O0):
<_set_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113f <_set_utf8+0x2f>
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1154 <_set_utf8+0x44>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_utf8>:
test   %edi,%edi
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xee3(%rip),%rax
lea    0xed7(%rip),%rsi
cmove  %rax,%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [5 x i8] c"\1B%%G\00"
@.str.1 = [5 x i8] c"\1B%%@\00"
define void @_set_utf8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = load i32, i32* @stdout
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [5 x i8] c"\1B%%G\00"
@.str.1 = [5 x i8] c"\1B%%@\00"
define void @_set_utf8(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @stdout
%4 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @fprintf(i32 %3, i8* %4)
ret void
}
/* Variables and functions */
unsigned int stb_hashptr(void *);
unsigned int stb_rehash_improved(unsigned int v) {
  return stb_hashptr((void *)v);
}


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

x86 assembly (clang, -O2):
<stb_rehash_improved>:
mov    %edi,%edi
jmp    1030 <stb_hashptr@plt>

LLVM IR (-O0):
define i32 @stb_rehash_improved(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = call i32 @stb_hashptr(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @stb_rehash_improved(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @stb_hashptr(i8* %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ be32toh(int /*<<< orphan*/);
uint32_t yay1_get_size(uint8_t *s) { return be32toh(*(uint32_t *)(s + 4)); }


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

x86 assembly (clang, -O2):
<yay1_get_size>:
mov    0x10(%rdi),%edi
jmp    1030 <be32toh@plt>

LLVM IR (-O0):
define i32 @yay1_get_size(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = call i32 @be32toh(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @yay1_get_size(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = tail call i32 @be32toh(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __disable_fault_irq();
int /*<<< orphan*/ __disable_irq();
void Interrupts_Disable() {
  __disable_irq();
  __disable_fault_irq();
}


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

x86 assembly (clang, -O2):
<Interrupts_Disable>:
push   %rax
xor    %eax,%eax
call   1040 <__disable_irq@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__disable_fault_irq@plt>

LLVM IR (-O0):
define void @Interrupts_Disable() {
%1 = call i32 (...) @__disable_irq()
%2 = call i32 (...) @__disable_fault_irq()
ret void
}

LLVM IR (-O2):
define void @Interrupts_Disable() {
%1 = tail call i32 (...) @__disable_irq()
%2 = tail call i32 (...) @__disable_fault_irq()
ret void
}