xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ is_prime(int /*<<< orphan*/);
int /*<<< orphan*/ quadratic(int, int, int);
int eval_func(int a, int b) {
  int n = 0;
  while (true) {
    if (is_prime(quadratic(n, a, b))) {
      n += 1;
    } else {
      break;
    }
  }
  return n;
}


x86 assembly (clang, -O0):
<eval_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <quadratic@plt>
mov    %eax,%edi
call   1030 <is_prime@plt>
cmp    $0x0,%rax
je     1162 <eval_func+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1167 <eval_func+0x47>
jmp    116c <eval_func+0x4c>
jmp    1135 <eval_func+0x15>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_func>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
mov    $0xffffffff,%ebp
xchg   %ax,%ax
add    $0x1,%ebp
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14d,%edx
call   1040 <quadratic@plt>
mov    %eax,%edi
call   1030 <is_prime@plt>
test   %rax,%rax
jne    1130 <eval_func+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @eval_func(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 = %2, %17
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @quadratic(i32 %7, i32 %8, i32 %9)
%11 = call i64 @is_prime(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %6
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %17
16: ; preds = %6
br label %18
17: ; preds = %13
br label %6
18: ; preds = %16
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @eval_func(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %8, %3 ]
%5 = tail call i32 @quadratic(i32 %4, i32 %0, i32 %1)
%6 = tail call i64 @is_prime(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = add nuw nsw i32 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *program) {
  printf("usage: %s <local-udp> <remote-udp> <ipv6-source> <ipv6-dest>\n",
         program);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"usage: %s <local-udp> <remote-udp> <ipv6-source> <ipv6-dest>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [62 x i8] c"usage: %s <local-udp> <remote-udp> <ipv6-source> <ipv6-dest>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char const *, char const *);
void usage(char const *name) {
  {
    printf((char const *__restrict)"Usage: %s mask_file outputdir\n", name);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Usage: %s mask_file outputdir\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"Usage: %s mask_file outputdir\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int rand();
int tahmin_sorusu_sor() {
  int tahmin;
  tahmin = (rand() % 1000) + 1;
  return tahmin;
}


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

x86 assembly (clang, -O2):
<tahmin_sorusu_sor>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @tahmin_sorusu_sor() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 1000
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @tahmin_sorusu_sor() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 1000
%3 = add nsw i32 %2, 1
ret i32 %3
}
unsigned long hash(char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(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 i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
int foo4(char *filename, const char *modes) {}


x86 assembly (clang, -O0):
<foo4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo4(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int RAND_MAX;
int rand();
int randRange(int n) { return rand() / (RAND_MAX / n + 1); }


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

x86 assembly (clang, -O2):
<randRange>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
mov    0x2ec5(%rip),%rax
mov    (%rax),%eax
cltd
idiv   %ebx
mov    %eax,%esi
add    $0x1,%esi
mov    %ecx,%eax
cltd
idiv   %esi
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @randRange(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* @RAND_MAX
%5 = load i32, i32* %2
%6 = sdiv i32 %4, %5
%7 = add nsw i32 %6, 1
%8 = sdiv i32 %3, %7
ret i32 %8
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @randRange(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = load i32, i32* @RAND_MAX
%4 = sdiv i32 %3, %0
%5 = add nsw i32 %4, 1
%6 = sdiv i32 %2, %5
ret i32 %6
}
void untrack_pfn_vma(struct vm_area_struct *vma, unsigned long pfn,
                     unsigned long size) {}


x86 assembly (clang, -O0):
<untrack_pfn_vma>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.vm_area_struct = type opaque
define void @untrack_pfn_vma(%struct.vm_area_struct* %0, i64 %1, i64 %2) {
%4 = alloca %struct.vm_area_struct*
%5 = alloca i64
%6 = alloca i64
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
define void @untrack_pfn_vma(%struct.vm_area_struct* nocapture %0, i64 %1, i64 %2) {
ret void
}
int test_imm_A3uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xA3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A3uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 163
%6 = icmp ne i64 %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_A3uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 163
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int SmallerOf(int a, int b) {
  if (a == b)
    return a;
  if (a < b) {
    return a;
  } else {
    return b;
  }
}


x86 assembly (clang, -O0):
<SmallerOf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1121 <SmallerOf+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <SmallerOf+0x3e>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <SmallerOf+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <SmallerOf+0x3e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SmallerOf>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @SmallerOf(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xe2() {
  Assert_real((isprint(226) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              1135, ("isprint should be 0 for 0xe2"));
}


x86 assembly (clang, -O0):
<t_isprint_0xe2>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe2,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x46f,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0xe2>:
push   %rax
mov    $0xe2,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x46f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xe2\00"
define void @t_isprint_0xe2() {
%1 = call i64 @isprint(i32 226)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xe2\00"
define void @t_isprint_0xe2() {
%1 = tail call i64 @isprint(i32 226)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1135, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int syscall(int, char const *, char const *);
int removexattr(const char *path, const char *name) {
  return syscall(235, path, name);
}


x86 assembly (clang, -O0):
<removexattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0xeb,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removexattr>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xeb,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @removexattr(i8* %0, i8* %1) {
%3 = tail call i32 @syscall(i32 235, i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ doStuff_variadic(int *, int *);
void f_variadic_unp_inp(void) {
  int t;
  int u = 3;
  int *vp = &u;
  int *tp = &t;
  doStuff_variadic(tp, vp);
}


x86 assembly (clang, -O0):
<f_variadic_unp_inp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x3,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <doStuff_variadic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_variadic_unp_inp>:
push   %rax
movl   $0x3,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <doStuff_variadic@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @f_variadic_unp_inp() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 3, i32* %2
store i32* %2, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32*, i32** %3
%7 = call i32 @doStuff_variadic(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @f_variadic_unp_inp() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 3, i32* %2
%5 = call i32 @doStuff_variadic(i32* %1, i32* %2)
ret void
}
int test_imm_C8int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xC8 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C8int64_highword_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, 32
%6 = and i64 %5, 200
%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_C8int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 858993459200
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void I2C1_ER_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @I2C1_ER_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

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

/* Variables and functions */
FILE *freopen(const char *path, const char *mode, FILE *stream) {
  ;
  return NULL;
}


x86 assembly (clang, -O0):
<freopen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32* @freopen(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @freopen(i8* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
ret i32* null
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void check_dimension(int dim) {
  if (dim < 1 || dim > 4000)
    do {
      fprintf(stderr, "El archivo no tiene un width o height razonable.\r\n");
      exit(EXIT_FAILURE);
    } while (0);
}


x86 assembly (clang, -O0):
<check_dimension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jl     1142 <check_dimension+0x22>
cmpl   $0xfa0,-0x4(%rbp)
jle    116a <check_dimension+0x4a>
jmp    1147 <check_dimension+0x27>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_dimension>:
add    $0xfffff05f,%edi
cmp    $0xfffff05f,%edi
jbe    112f <check_dimension+0xf>
ret
push   %rax
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"El archivo no tiene un width o height razonable.\0D\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_dimension(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 4000
br i1 %7, label %8, label %15
8: ; preds = %5, %1
br label %9
9: ; preds = %8
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; No predecessors!
br label %15
15: ; preds = %14, %5
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"El archivo no tiene un width o height razonable.\0D\0A\00"
@EXIT_FAILURE = global i32 0
define void @check_dimension(i32 %0) {
%2 = add i32 %0, -4001
%3 = icmp ult i32 %2, -4000
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
char *concatenate(char *, char *, int, char const *, char *);
char *get_job_work_directory(const char *job_dir) {
  return concatenate("%s/work", "job_work_dir_path", 2, job_dir, "");
}


x86 assembly (clang, -O0):
<get_job_work_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xed9(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0x2,%edx
lea    0xedf(%rip),%r8
call   1030 <concatenate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_job_work_directory>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xef1(%rip),%r8
mov    $0x2,%edx
jmp    1030 <concatenate@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s/work\00"
@.str.1 = [18 x i8] c"job_work_dir_path\00"
@.str.2 = [1 x i8] zeroinitializer
define i8* @get_job_work_directory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @concatenate(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s/work\00"
@.str.1 = [18 x i8] c"job_work_dir_path\00"
@.str.2 = [1 x i8] zeroinitializer
define i8* @get_job_work_directory(i8* %0) {
%2 = tail call i8* @concatenate(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void msg_babble() {
  system("clear");
  printf("Babble>\n");
  return;
}


x86 assembly (clang, -O0):
<msg_babble>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_babble>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <system@plt>
lea    0xed2(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [9 x i8] c"Babble>\0A\00"
define void @msg_babble() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@str = [8 x i8] c"Babble>\00"
define void @msg_babble() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
void INT_IRQ_handler() {}


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

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

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

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

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS) {
    stream = stdout;
  }
  fprintf(stream, "Usage: %s <NF> <DIR>\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [22 x i8] c"Usage: %s <NF> <DIR>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [22 x i8] c"Usage: %s <NF> <DIR>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("Hello, world!\r\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello, world!\0D\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Hello, world!\0D\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct Pl_utl_sema {
  int dummy;
};
struct Pl_utl_bsema {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pl_utl_sema_i_wait(struct Pl_utl_sema *);
void pl_utl_bsema_i_wait(struct Pl_utl_bsema *_bsema_p) {
  pl_utl_sema_i_wait((struct Pl_utl_sema *)_bsema_p);
}


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

x86 assembly (clang, -O2):
<pl_utl_bsema_i_wait>:
jmp    1030 <pl_utl_sema_i_wait@plt>

LLVM IR (-O0):
%struct.Pl_utl_bsema = type { i32 }
%struct.Pl_utl_sema = type { i32 }
define void @pl_utl_bsema_i_wait(%struct.Pl_utl_bsema* %0) {
%2 = alloca %struct.Pl_utl_bsema*
store %struct.Pl_utl_bsema* %0, %struct.Pl_utl_bsema** %2
%3 = load %struct.Pl_utl_bsema*, %struct.Pl_utl_bsema** %2
%4 = bitcast %struct.Pl_utl_bsema* %3 to %struct.Pl_utl_sema*
%5 = call i32 @pl_utl_sema_i_wait(%struct.Pl_utl_sema* %4)
ret void
}

LLVM IR (-O2):
%struct.Pl_utl_bsema = type { i32 }
%struct.Pl_utl_sema = type { i32 }
define void @pl_utl_bsema_i_wait(%struct.Pl_utl_bsema* %0) {
%2 = bitcast %struct.Pl_utl_bsema* %0 to %struct.Pl_utl_sema*
%3 = tail call i32 @pl_utl_sema_i_wait(%struct.Pl_utl_sema* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_wsr(int /*<<< orphan*/, unsigned int);
void string_literal(unsigned v) { __builtin_arm_wsr(0, v); }


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

x86 assembly (clang, -O2):
<string_literal>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <__builtin_arm_wsr@plt>

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

LLVM IR (-O2):
define void @string_literal(i32 %0) {
%2 = tail call i32 @__builtin_arm_wsr(i32 0, i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_mcrr(int, int /*<<< orphan*/,
                                      int /*<<< orphan*/, int /*<<< orphan*/);
void mcrr(uint64_t a) { __builtin_arm_mcrr(15, 0, a, 0); }


x86 assembly (clang, -O0):
<mcrr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xf,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
call   1030 <__builtin_arm_mcrr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcrr>:
mov    %edi,%edx
mov    $0xf,%edi
xor    %esi,%esi
xor    %ecx,%ecx
jmp    1030 <__builtin_arm_mcrr@plt>

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

LLVM IR (-O2):
define void @mcrr(i32 %0) {
%2 = tail call i32 @__builtin_arm_mcrr(i32 15, i32 0, i32 %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _FPU_GETCW(int);
int fegetround(void) {
  int cw;
  _FPU_GETCW(cw);
  return cw & 0x3;
}


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

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

LLVM IR (-O0):
define i32 @fegetround() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @_FPU_GETCW(i32 %2)
%4 = load i32, i32* %1
%5 = and i32 %4, 3
ret i32 %5
}

LLVM IR (-O2):
define i32 @fegetround() {
%1 = tail call i32 @_FPU_GETCW(i32 undef)
ret i32 0
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void CRCSeedSet(uint32_t ui32Base, uint32_t ui32Seed) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000C10))) = ui32Seed;
}


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

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

LLVM IR (-O0):
define void @CRCSeedSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 3088
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @CRCSeedSet(i64 %0, i64 %1) {
%3 = add i64 %0, 3088
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
unsigned int utf8_char_length(char *utf) {
  unsigned int ulen = 0;
  char u = *utf;
  while (u & 0x80) {
    ulen++;
    u <<= 1;
  }
  return (ulen ? ulen : 1);
}


x86 assembly (clang, -O0):
<utf8_char_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1142 <utf8_char_length+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsbl -0xd(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0xd(%rbp)
jmp    1118 <utf8_char_length+0x18>
cmpl   $0x0,-0xc(%rbp)
je     1157 <utf8_char_length+0x57>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <utf8_char_length+0x64>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <utf8_char_length+0x64>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_char_length>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
jns    1117 <utf8_char_length+0x17>
xor    %eax,%eax
nopl   (%rax)
add    $0x1,%eax
add    %cl,%cl
js     1110 <utf8_char_length+0x10>
ret

LLVM IR (-O0):
define i32 @utf8_char_length(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
store i8 %6, i8* %4
br label %7
7: ; preds = %12, %1
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = and i32 %9, 128
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add i32 %13, 1
store i32 %14, i32* %3
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = shl i32 %16, 1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %4
br label %7
19: ; preds = %7
%20 = load i32, i32* %3
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = load i32, i32* %3
br label %25
24: ; preds = %19
br label %25
25: ; preds = %24, %22
%26 = phi i32 [ %23, %22 ], [ 1, %24 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @utf8_char_length(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp sgt i8 %2, -1
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %8, %4 ], [ %2, %1 ]
%6 = phi i32 [ %7, %4 ], [ 0, %1 ]
%7 = add nuw nsw i32 %6, 1
%8 = shl i8 %5, 1
%9 = icmp sgt i8 %8, -1
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %11
}
unsigned int h(unsigned int a) { return a / 8; }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x3,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @h(i32 %0) {
%2 = lshr i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ cnet_close();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void handle_sigint(int x) {
  fprintf(stderr, "Received SIGINT, Quitting...\n");
  cnet_close();
  exit(0);
}


x86 assembly (clang, -O0):
<handle_sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <cnet_close@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<handle_sigint>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <cnet_close@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Received SIGINT, Quitting...\0A\00"
define void @handle_sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @cnet_close()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Received SIGINT, Quitting...\0A\00"
define void @handle_sigint(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @cnet_close()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void exiterror(const char *s) {
  printf("%s", s);
  exit(1);
}


x86 assembly (clang, -O0):
<exiterror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exiterror>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @exiterror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ mc_is_boundary_ohmic(int, int);
scalar_t__ mc_is_boundary_schottky(int, int);
int mc_is_boundary_contact(int direction, int index) {
  return mc_is_boundary_schottky(direction, index) ||
         mc_is_boundary_ohmic(direction, index);
}


x86 assembly (clang, -O0):
<mc_is_boundary_contact>:
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   1040 <mc_is_boundary_schottky@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1160 <mc_is_boundary_contact+0x40>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <mc_is_boundary_ohmic@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_is_boundary_contact>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <mc_is_boundary_schottky@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    114d <mc_is_boundary_contact+0x2d>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <mc_is_boundary_ohmic@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mc_is_boundary_contact(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 i64 @mc_is_boundary_schottky(i32 %5, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i64 @mc_is_boundary_ohmic(i32 %10, i32 %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ true, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @mc_is_boundary_contact(i32 %0, i32 %1) {
%3 = tail call i64 @mc_is_boundary_schottky(i32 %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @mc_is_boundary_ohmic(i32 %0, i32 %1)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(void) {
  unsigned int multiplo = 100000000;
  unsigned int contatore = (unsigned int)1;
  while (contatore <= (unsigned int)1000000000) {
    if (contatore % multiplo == 0) {
      printf("%u\n", contatore);
    }
    contatore++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5f5e100,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x3b9aca00,-0xc(%rbp)
ja     1168 <main+0x58>
mov    -0xc(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
cmp    $0x0,%edx
jne    115a <main+0x4a>
mov    -0xc(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
jmp    113b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x3b9aca01,%ebx
je     115e <main+0x4e>
mov    %ebx,%eax
imul   $0x55e63b89,%rax,%rax
shr    $0x39,%rax
imul   $0x5f5e100,%eax,%eax
cmp    %eax,%ebx
jne    1130 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 1, %0 ], [ %8, %7 ]
%3 = urem i32 %2, 100000000
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %5, %1
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 1000000001
br i1 %9, label %10, label %1
10: ; preds = %7
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void p_sizeof(char *s) {
  printf("sizeof(*s) = [%ld]\n", sizeof(s));
  printf("*s = [%s]\n", s);
}


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

x86 assembly (clang, -O2):
<p_sizeof>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"sizeof(*s) = [%ld]\0A\00"
@.str.1 = [11 x i8] c"*s = [%s]\0A\00"
define void @p_sizeof(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 8)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int EFlash_ReturnBank1BaseAddress() {
  unsigned int hwparams0;
  int baseaddr;
  hwparams0 = *(volatile unsigned int *)(0x40009000 + 0x034) & 0x1F;
  switch (hwparams0) {
  case 0x11:
    baseaddr = 0x20000;
    break;
  case 0x12:
    baseaddr = 0x40000;
    break;
  default:
    baseaddr = -1;
    break;
  }
  return baseaddr;
}


x86 assembly (clang, -O0):
<EFlash_ReturnBank1BaseAddress>:
push   %rbp
mov    %rsp,%rbp
mov    0x40009034,%eax
and    $0x1f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x11,%eax
je     1136 <EFlash_ReturnBank1BaseAddress+0x36>
jmp    1125 <EFlash_ReturnBank1BaseAddress+0x25>
mov    -0xc(%rbp),%eax
sub    $0x12,%eax
je     1142 <EFlash_ReturnBank1BaseAddress+0x42>
jmp    114e <EFlash_ReturnBank1BaseAddress+0x4e>
movl   $0x20000,-0x8(%rbp)
jmp    1155 <EFlash_ReturnBank1BaseAddress+0x55>
movl   $0x40000,-0x8(%rbp)
jmp    1155 <EFlash_ReturnBank1BaseAddress+0x55>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EFlash_ReturnBank1BaseAddress>:
mov    0x40009034,%eax
and    $0x1f,%eax
cmp    $0x12,%eax
mov    $0x40000,%ecx
mov    $0xffffffff,%edx
cmove  %ecx,%edx
cmp    $0x11,%eax
mov    $0x20000,%eax
cmovne %edx,%eax
ret

LLVM IR (-O0):
define i32 @EFlash_ReturnBank1BaseAddress() {
%1 = alloca i32
%2 = alloca i32
%3 = load volatile i32, i32* inttoptr (i64 1073778740 to i32*)
%4 = and i32 %3, 31
store i32 %4, i32* %1
%5 = load i32, i32* %1
switch i32 %5, label %8 [
i32 17, label %6
i32 18, label %7
]
6: ; preds = %0
store i32 131072, i32* %2
br label %9
7: ; preds = %0
store i32 262144, i32* %2
br label %9
8: ; preds = %0
store i32 -1, i32* %2
br label %9
9: ; preds = %8, %7, %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @EFlash_ReturnBank1BaseAddress() {
%1 = load volatile i32, i32* inttoptr (i64 1073778740 to i32*)
%2 = and i32 %1, 31
%3 = icmp eq i32 %2, 18
%4 = select i1 %3, i32 262144, i32 -1
%5 = icmp eq i32 %2, 17
%6 = select i1 %5, i32 131072, i32 %4
ret i32 %6
}