xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printIntArray(int *array, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("%d ", array[i]);
  }
}


x86 assembly (clang, -O0):
<printIntArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <printIntArray+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printIntArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printIntArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <printIntArray+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printIntArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printIntArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump_group(char const *, unsigned int, unsigned int, int,
                              int);
void dump(const char *executable, unsigned row, unsigned col) {
  dump_group(executable, row, col, 1, 1);
}


x86 assembly (clang, -O0):
<dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x1,%r8d
mov    %r8d,%ecx
call   1030 <dump_group@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump>:
mov    $0x1,%ecx
mov    $0x1,%r8d
jmp    1030 <dump_group@plt>

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

LLVM IR (-O2):
define void @dump(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @dump_group(i8* %0, i32 %1, i32 %2, i32 1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ KeccakP200_AddByte(void *, int, int);
int /*<<< orphan*/ KeccakP200_Permute_Nrounds(void *, int);
void Ket_Step(void *state, unsigned int size,
              unsigned char frameAndPaddingBits) {
  KeccakP200_AddByte(state, frameAndPaddingBits, size);
  KeccakP200_AddByte(state, 0x08, (2 * 200 / 8 / 25));
  KeccakP200_Permute_Nrounds(state, 1);
}


x86 assembly (clang, -O0):
<Ket_Step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xd(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <KeccakP200_AddByte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x2,%edx
call   1030 <KeccakP200_AddByte@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <KeccakP200_Permute_Nrounds@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ket_Step>:
push   %rbx
mov    %esi,%eax
mov    %rdi,%rbx
mov    %edx,%esi
mov    %eax,%edx
call   1030 <KeccakP200_AddByte@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x2,%edx
call   1030 <KeccakP200_AddByte@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1040 <KeccakP200_Permute_Nrounds@plt>

LLVM IR (-O0):
define void @Ket_Step(i8* %0, i32 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = load i32, i32* %5
%11 = call i32 @KeccakP200_AddByte(i8* %7, i32 %9, i32 %10)
%12 = load i8*, i8** %4
%13 = call i32 @KeccakP200_AddByte(i8* %12, i32 8, i32 2)
%14 = load i8*, i8** %4
%15 = call i32 @KeccakP200_Permute_Nrounds(i8* %14, i32 1)
ret void
}

LLVM IR (-O2):
define void @Ket_Step(i8* %0, i32 %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = tail call i32 @KeccakP200_AddByte(i8* %0, i32 %4, i32 %1)
%6 = tail call i32 @KeccakP200_AddByte(i8* %0, i32 8, i32 2)
%7 = tail call i32 @KeccakP200_Permute_Nrounds(i8* %0, i32 1)
ret void
}
void hardware_lock_door() {}


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

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

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

LLVM IR (-O2):
define void @hardware_lock_door() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, long, char *);
int /*<<< orphan*/ stderr;
void MemoryError(char *fileName, long lineNumber, char *functionName) {
  fprintf(stderr, "%s: %ld: Not enough memory at %s", fileName, lineNumber,
          functionName);
  exit(1);
}


x86 assembly (clang, -O0):
<MemoryError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<MemoryError>:
push   %rax
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"%s: %ld: Not enough memory at %s\00"
define void @MemoryError(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = load i8*, i8** %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %8, i64 %9, i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"%s: %ld: Not enough memory at %s\00"
define void @MemoryError(i8* %0, i64 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1, i8* %2)
%6 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_78uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x78 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_78uint64_highword_reg>:
movabs $0x7800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_78uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 120
%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_78uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 515396075520
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_CEint8_mem(signed char *val) {
  return ((*val) & (0xCE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CEint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -50
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void on_groupstop(pid_t pid, void *user_ptr __attribute__((unused))) {
  fprintf(stderr, "Group stop %d\n", (int)(pid));
}


x86 assembly (clang, -O0):
<on_groupstop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_groupstop>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"Group stop %d\0A\00"
define void @on_groupstop(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"Group stop %d\0A\00"
define void @on_groupstop(i64 %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = trunc i64 %0 to i32
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MAP_SHARED;
int remap_file_pages(void *, int, int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/);
int main(void) { return remap_file_pages((void *)0, 4096, 0, 0, MAP_SHARED); }


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

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%r8d
xor    %edi,%edi
mov    $0x1000,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <remap_file_pages@plt>

LLVM IR (-O0):
@MAP_SHARED = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @MAP_SHARED
%3 = call i32 @remap_file_pages(i8* null, i32 4096, i32 0, i32 0, i32 %2)
ret i32 %3
}

LLVM IR (-O2):
@MAP_SHARED = global i32 0
define i32 @main() {
%1 = load i32, i32* @MAP_SHARED
%2 = tail call i32 @remap_file_pages(i8* null, i32 4096, i32 0, i32 0, i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int isright(char buf[8]) { return !strcmp(buf, "\033[C"); }


x86 assembly (clang, -O0):
<isright>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isright>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[C\00"
define i32 @isright(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[C\00"
define i32 @isright(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void X509_PUBKEY_set(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_PUBKEY_set() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ system(char *);
int main() {
  puts("Calling the system:");
  system("dir");
  puts("All done!");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Calling the system:\00"
@.str.1 = [4 x i8] c"dir\00"
@.str.2 = [10 x i8] c"All done!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Calling the system:\00"
@.str.1 = [4 x i8] c"dir\00"
@.str.2 = [10 x i8] c"All done!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
int do_224() { return 224; }


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

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

LLVM IR (-O0):
define i32 @do_224() {
ret i32 224
}

LLVM IR (-O2):
define i32 @do_224() {
ret i32 224
}
__attribute__((always_)) void sti(void) {
  __asm__ __volatile__("sti" : : : "memory");
}


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

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

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

LLVM IR (-O2):
define void @sti() {
tail call void asm sideeffect "sti", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void abb_iwinfo_stop(void) { {}; }


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

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

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

LLVM IR (-O2):
define void @abb_iwinfo_stop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int const);
void f() {
  static const unsigned a[5] = {1, 2, 3, 4, 5};
  for (int i = 0; i < 5; i++) {
    int b[1] = {0};
    printf("%d ", a[i]);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1171 <f+0x51>
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
movslq -0x4(%rbp),%rcx
lea    0xeac(%rip),%rax
mov    (%rax,%rcx,4),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <f+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @f() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ constants_init();
int /*<<< orphan*/ parameter_setup();
int /*<<< orphan*/ parse_input();
int /*<<< orphan*/ set_default_parameters();
int /*<<< orphan*/ sim_init();
int /*<<< orphan*/ simple_tank_fill();
void initialize() {
  constants_init();
  set_default_parameters();
  parse_input();
  parameter_setup();
  sim_init();
  simple_tank_fill();
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <constants_init@plt>
mov    $0x0,%al
call   1060 <set_default_parameters@plt>
mov    $0x0,%al
call   1040 <parse_input@plt>
mov    $0x0,%al
call   1070 <parameter_setup@plt>
mov    $0x0,%al
call   1050 <sim_init@plt>
mov    $0x0,%al
call   1080 <simple_tank_fill@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
push   %rax
xor    %eax,%eax
call   1030 <constants_init@plt>
xor    %eax,%eax
call   1060 <set_default_parameters@plt>
xor    %eax,%eax
call   1040 <parse_input@plt>
xor    %eax,%eax
call   1070 <parameter_setup@plt>
xor    %eax,%eax
call   1050 <sim_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <simple_tank_fill@plt>

LLVM IR (-O0):
define void @initialize() {
%1 = call i32 (...) @constants_init()
%2 = call i32 (...) @set_default_parameters()
%3 = call i32 (...) @parse_input()
%4 = call i32 (...) @parameter_setup()
%5 = call i32 (...) @sim_init()
%6 = call i32 (...) @simple_tank_fill()
ret void
}

LLVM IR (-O2):
define void @initialize() {
%1 = tail call i32 (...) @constants_init()
%2 = tail call i32 (...) @set_default_parameters()
%3 = tail call i32 (...) @parse_input()
%4 = tail call i32 (...) @parameter_setup()
%5 = tail call i32 (...) @sim_init()
%6 = tail call i32 (...) @simple_tank_fill()
ret void
}
unsigned int mpos(unsigned int i, unsigned int j) {
  return (i) + (((j) * ((j) + 1)) >> 1);
}


x86 assembly (clang, -O0):
<mpos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
shr    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpos>:
lea    0x1(%rsi),%eax
imul   %esi,%eax
shr    %eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @mpos(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 = load i32, i32* %4
%8 = add i32 %7, 1
%9 = mul i32 %6, %8
%10 = lshr i32 %9, 1
%11 = add i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mpos(i32 %0, i32 %1) {
%3 = add i32 %1, 1
%4 = mul i32 %3, %1
%5 = lshr i32 %4, 1
%6 = add i32 %5, %0
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fd_nrf8001_change_timing_request_error(int);
int /*<<< orphan*/ fd_nrf8001_change_timing_request_success();
void fd_nrf8001_dispatch_change_timing_request_response(
    uint8_t status, uint8_t *response_data __attribute__((unused)),
    uint32_t response_data_length __attribute__((unused))) {
  if (status != 0x00) {
    fd_nrf8001_change_timing_request_error(status);
    return;
  }
  fd_nrf8001_change_timing_request_success();
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <fd_nrf8001_dispatch_change_timing_request_response+0x29>
mov    -0x4(%rbp),%edi
call   1040 <fd_nrf8001_change_timing_request_error@plt>
jmp    1150 <fd_nrf8001_dispatch_change_timing_request_response+0x30>
mov    $0x0,%al
call   1030 <fd_nrf8001_change_timing_request_success@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
test   %edi,%edi
je     1129 <fd_nrf8001_dispatch_change_timing_request_response+0x9>
jmp    1040 <fd_nrf8001_change_timing_request_error@plt>
xor    %eax,%eax
jmp    1030 <fd_nrf8001_change_timing_request_success@plt>

LLVM IR (-O0):
define void @fd_nrf8001_dispatch_change_timing_request_response(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %4
%11 = call i32 @fd_nrf8001_change_timing_request_error(i32 %10)
br label %14
12: ; preds = %3
%13 = call i32 (...) @fd_nrf8001_change_timing_request_success()
br label %14
14: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
define void @fd_nrf8001_dispatch_change_timing_request_response(i32 %0, i32* nocapture readnone %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @fd_nrf8001_change_timing_request_error(i32 %0)
br label %9
7: ; preds = %3
%8 = tail call i32 (...) @fd_nrf8001_change_timing_request_success()
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ runTest();
int main() { runTest(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @runTest()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @runTest()
ret i32 0
}
extern unsigned int __inlc_p(unsigned short port) {
  unsigned int _v;
  __asm__ __volatile__("in"
                       "l"
                       " %"
                       ""
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "id"(port));
  __asm__ __volatile__("outb %al,$0x80");
  return _v;
}


x86 assembly (clang, -O0):
<__inlc_p>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%eax
mov    %eax,-0x8(%rbp)
out    %al,$0x80
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inlc_p>:
mov    %edi,%edx
in     (%dx),%eax
out    %al,$0x80
ret

LLVM IR (-O0):
define i32 @__inlc_p(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 asm sideeffect "inl $1,$0", "={ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @__inlc_p(i16 zeroext %0) {
%2 = tail call i32 asm sideeffect "inl $1,$0", "={ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
tail call void asm sideeffect "outb %al,$$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x58() {
  Assert_real((isprint(88)),
              "/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",
              445, ("isprint should be 1 for X"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for X\00"
define void @t_isprint_0x58() {
%1 = tail call i32 @isprint(i32 88)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ generate_trap_h(char const *, int);
void generate_traps_h(const char *path) {
  generate_trap_h(path, 1);
  generate_trap_h(path, 13);
  generate_trap_h(path, 14);
}


x86 assembly (clang, -O0):
<generate_traps_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <generate_trap_h@plt>
mov    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1030 <generate_trap_h@plt>
mov    -0x8(%rbp),%rdi
mov    $0xe,%esi
call   1030 <generate_trap_h@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_traps_h>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
call   1030 <generate_trap_h@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <generate_trap_h@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
pop    %rbx
jmp    1030 <generate_trap_h@plt>

LLVM IR (-O0):
define void @generate_traps_h(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @generate_trap_h(i8* %3, i32 1)
%5 = load i8*, i8** %2
%6 = call i32 @generate_trap_h(i8* %5, i32 13)
%7 = load i8*, i8** %2
%8 = call i32 @generate_trap_h(i8* %7, i32 14)
ret void
}

LLVM IR (-O2):
define void @generate_traps_h(i8* %0) {
%2 = tail call i32 @generate_trap_h(i8* %0, i32 1)
%3 = tail call i32 @generate_trap_h(i8* %0, i32 13)
%4 = tail call i32 @generate_trap_h(i8* %0, i32 14)
ret void
}
/* Variables and functions */
int START_OF_LINE_ADDR(int);
int END_OF_LINE_ADDR(int ADDRESS) {
  return (START_OF_LINE_ADDR(ADDRESS) + 4 * 4 - 1);
}


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

x86 assembly (clang, -O2):
<END_OF_LINE_ADDR>:
push   %rax
call   1030 <START_OF_LINE_ADDR@plt>
add    $0xf,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @END_OF_LINE_ADDR(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @START_OF_LINE_ADDR(i32 %3)
%5 = add nsw i32 %4, 16
%6 = sub nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @END_OF_LINE_ADDR(i32 %0) {
%2 = tail call i32 @START_OF_LINE_ADDR(i32 %0)
%3 = add nsw i32 %2, 15
ret i32 %3
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t hook_del() { return -1; }


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

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

LLVM IR (-O0):
define i32 @hook_del() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @hook_del() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  const int bonus = 10;
  int exam1;
  int exam2;
  int score;
  scanf("%d %d", &exam1, &exam2);
  score = (exam1 + exam2) / 2 + bonus;
  printf("score = %d\n", score);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0xa,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%eax
add    0x4(%rsp),%eax
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
add    $0xa,%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [12 x i8] c"score = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = sdiv i32 %9, 2
%11 = add nsw i32 %10, 10
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [12 x i8] c"score = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = sdiv i32 %8, 2
%10 = add nsw i32 %9, 10
%11 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
void foo481(int p) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int writen(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
int fputs(const char *str, FILE *stream) {
  if (-1 == writen(stream, str, strlen(str)))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1040 <writen@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1173 <fputs+0x53>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <fputs+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <writen@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @fputs(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
%6 = load i32*, i32** %5
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = call i32 @writen(i32* %6, i8* %7, i32 %9)
%11 = icmp eq i32 -1, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @fputs(i8* %0, i32* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @writen(i32* %1, i8* %0, i32 %3)
%5 = icmp eq i32 %4, -1
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, ...);
void log_exit_reason(int exit_code, void *priv) {
  if (exit_code != 0) {
    syslog(LOG_ERR, "Abnormal exit code %d", exit_code);
  } else {
    syslog(LOG_NOTICE, "Shutting down");
  }
}


x86 assembly (clang, -O0):
<log_exit_reason>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1148 <log_exit_reason+0x38>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <syslog@plt>
jmp    115f <log_exit_reason+0x4f>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1030 <syslog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_exit_reason>:
test   %edi,%edi
je     112d <log_exit_reason+0x1d>
mov    %edi,%edx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
xor    %eax,%eax
jmp    1030 <syslog@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
xor    %eax,%eax
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [22 x i8] c"Abnormal exit code %d\00"
@LOG_NOTICE = global i32 0
@.str.1 = [14 x i8] c"Shutting down\00"
define void @log_exit_reason(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @LOG_ERR
%9 = load i32, i32* %3
%10 = call i32 (i32, i8*, ...) @syslog(i32 %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %14
11: ; preds = %2
%12 = load i32, i32* @LOG_NOTICE
%13 = call i32 (i32, i8*, ...) @syslog(i32 %12, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [22 x i8] c"Abnormal exit code %d\00"
@LOG_NOTICE = global i32 0
@.str.1 = [14 x i8] c"Shutting down\00"
define void @log_exit_reason(i32 %0, i8* nocapture readnone %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @LOG_ERR
%6 = tail call i32 (i32, i8*, ...) @syslog(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %10
7: ; preds = %2
%8 = load i32, i32* @LOG_NOTICE
%9 = tail call i32 (i32, i8*, ...) @syslog(i32 %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Valoarea lui 0xBEC83D7 in dec este: %d", 0xBEC83D7);
  getchar();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"Valoarea lui 0xBEC83D7 in dec este: %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 200049623)
%3 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Valoarea lui 0xBEC83D7 in dec este: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 200049623)
%2 = tail call i32 (...) @getchar()
ret i32 0
}
int is_zlib_compressed_data(unsigned char *data) {
  unsigned int w;
  w = ((unsigned int)(data[0]) << 8) + data[1];
  return data[0] == 0x78 && !(w % 31);
}


x86 assembly (clang, -O0):
<is_zlib_compressed_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x78,%ecx
mov    %al,-0xd(%rbp)
jne    114b <is_zlib_compressed_data+0x4b>
mov    -0xc(%rbp),%eax
mov    $0x1f,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
setne  %al
xor    $0xff,%al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_zlib_compressed_data>:
xor    %eax,%eax
cmpb   $0x78,(%rdi)
jne    1121 <is_zlib_compressed_data+0x21>
movzbl 0x1(%rdi),%eax
or     $0x7800,%eax
imul   $0xbdef7bdf,%eax,%ecx
xor    %eax,%eax
cmp    $0x8421085,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @is_zlib_compressed_data(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = add i32 %8, %12
store i32 %13, i32* %3
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = icmp eq i32 %17, 120
br i1 %18, label %19, label %24
19: ; preds = %1
%20 = load i32, i32* %3
%21 = urem i32 %20, 31
%22 = icmp ne i32 %21, 0
%23 = xor i1 %22, true
br label %24
24: ; preds = %19, %1
%25 = phi i1 [ false, %1 ], [ %23, %19 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @is_zlib_compressed_data(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 120
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %7, 30720
%9 = urem i32 %8, 31
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %1
%13 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %13
}
void metal_cache_invalidate(void *addr, unsigned int len) {
  (void)addr;
  (void)len;
  return;
}


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

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

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

LLVM IR (-O2):
define void @metal_cache_invalidate(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("foo\n");
  printf("bar\n");
  printf("baz\n");
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"foo\0A\00"
@.str.1 = [5 x i8] c"bar\0A\00"
@.str.2 = [5 x i8] c"baz\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [4 x i8] c"foo\00"
@str.3 = [4 x i8] c"bar\00"
@str.4 = [4 x i8] c"baz\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
int test_imm_14int8_reg(signed char val) {
  return ((val) & (-0x14 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_14int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffec,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_14int8_reg>:
test   $0xec,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_14int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -20
%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_14int8_reg(i8 signext %0) {
%2 = and i8 %0, -20
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double abs(double x) { return x > 0 ? x : -x; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <abs+0x2a>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    114b <abs+0x4b>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @abs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load double, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = fneg double %8
br label %10
10: ; preds = %7, %5
%11 = phi double [ %6, %5 ], [ %9, %7 ]
ret double %11
}

LLVM IR (-O2):
define double @abs(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ generate_pyramid(int);
int read_user_input(char *);
int main() {
  int height = read_user_input("Enter height");
  generate_pyramid(height);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <read_user_input@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <generate_pyramid@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <read_user_input@plt>
mov    %eax,%edi
call   1030 <generate_pyramid@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Enter height\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @read_user_input(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @generate_pyramid(i32 %4)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}

LLVM IR (-O2):
@.str = [13 x i8] c"Enter height\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @read_user_input(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @generate_pyramid(i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}