xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert_null_(char *, int, int /*<<< orphan*/ *);
void test_null_pass() {
  assert_null_("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/"
               "heads/master/test/pass_test.c",
               13, (NULL));
}


x86 assembly (clang, -O0):
<test_null_pass>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xd,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <assert_null_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_null_pass>:
lea    0xee9(%rip),%rdi
mov    $0xd,%esi
xor    %edx,%edx
jmp    1030 <assert_null_@plt>

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/pass_test.c\00"
define void @test_null_pass() {
%1 = call i32 @assert_null_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 13, i32* null)
ret void
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hughbien/assertive/refs/heads/master/test/pass_test.c\00"
define void @test_null_pass() {
%1 = tail call i32 @assert_null_(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 13, i32* null)
ret void
}
unsigned int _mutex_owner(unsigned int mid) {
  unsigned int cmd;
  unsigned int sta;
  cmd = (((0x13000000)) | ((3 & ((1 << 3) - 1)) << (8 + (6 + 2))) |
         ((0 & ((1 << 8) - 1)) << (6 + 2)) | ((mid & ((1 << 6) - 1)) << 2));
  sta = (*(volatile unsigned int *)(cmd));
  return (((sta) >> 0) & 0x000000FF);
}


x86 assembly (clang, -O0):
<_mutex_owner>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
shl    $0x2,%eax
or     $0x13030000,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x0,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mutex_owner>:
shl    $0x2,%edi
movzbl %dil,%eax
mov    0x13030000(%rax),%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @_mutex_owner(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 63
%7 = shl i32 %6, 2
%8 = or i32 318963712, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = lshr i32 %13, 0
%15 = and i32 %14, 255
ret i32 %15
}

LLVM IR (-O2):
define i32 @_mutex_owner(i32 %0) {
%2 = shl i32 %0, 2
%3 = and i32 %2, 252
%4 = or i32 %3, 318963712
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 255
ret i32 %8
}
/* Variables and functions */
int greater(void *base, int i, int j, size_t size,
            int (*cmp)(const void *, const void *)) {
  size_t a = (size_t)base + i * size;
  size_t b = (size_t)base + j * size;
  return (cmp((void *)a, (void *)b) > 0);
}


x86 assembly (clang, -O0):
<greater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   -0x18(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   -0x18(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   *%rax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greater>:
push   %rax
movslq %esi,%rax
imul   %rcx,%rax
add    %rdi,%rax
movslq %edx,%rsi
imul   %rcx,%rsi
add    %rdi,%rsi
mov    %rax,%rdi
call   *%r8
xor    %ecx,%ecx
test   %eax,%eax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @greater(i8* %0, i32 %1, i32 %2, i64 %3, i32 (i8*, i8*)* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
%10 = alloca i32 (i8*, i8*)*
%11 = alloca i64
%12 = alloca i64
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i64 %3, i64* %9
store i32 (i8*, i8*)* %4, i32 (i8*, i8*)** %10
%13 = load i8*, i8** %6
%14 = ptrtoint i8* %13 to i64
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = load i64, i64* %9
%18 = mul i64 %16, %17
%19 = add i64 %14, %18
store i64 %19, i64* %11
%20 = load i8*, i8** %6
%21 = ptrtoint i8* %20 to i64
%22 = load i32, i32* %8
%23 = sext i32 %22 to i64
%24 = load i64, i64* %9
%25 = mul i64 %23, %24
%26 = add i64 %21, %25
store i64 %26, i64* %12
%27 = load i32 (i8*, i8*)*, i32 (i8*, i8*)** %10
%28 = load i64, i64* %11
%29 = inttoptr i64 %28 to i8*
%30 = load i64, i64* %12
%31 = inttoptr i64 %30 to i8*
%32 = call i32 %27(i8* %29, i8* %31)
%33 = icmp sgt i32 %32, 0
%34 = zext i1 %33 to i32
ret i32 %34
}

LLVM IR (-O2):
define i32 @greater(i8* %0, i32 %1, i32 %2, i64 %3, i32 (i8*, i8*)* nocapture %4) {
%6 = ptrtoint i8* %0 to i64
%7 = sext i32 %1 to i64
%8 = mul i64 %7, %3
%9 = add i64 %8, %6
%10 = sext i32 %2 to i64
%11 = mul i64 %10, %3
%12 = add i64 %11, %6
%13 = inttoptr i64 %9 to i8*
%14 = inttoptr i64 %12 to i8*
%15 = tail call i32 %4(i8* %13, i8* %14)
%16 = icmp sgt i32 %15, 0
%17 = zext i1 %16 to i32
ret i32 %17
}
void RTStrPrintf(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrPrintf() {
ret void
}
/* Variables and functions */
int registers_get_integer(char *);
int debug_active_process() {
  int ptbr, pid;
  ptbr = registers_get_integer("PTBR");
  pid = (ptbr - 29696) / 20;
  if (pid < 0 || pid >= 16)
    pid = -1;
  return pid;
}


x86 assembly (clang, -O0):
<debug_active_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <registers_get_integer@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x7400,%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     114e <debug_active_process+0x3e>
cmpl   $0x10,-0x8(%rbp)
jl     1155 <debug_active_process+0x45>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_active_process>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <registers_get_integer@plt>
mov    %eax,%ecx
lea    -0x7540(%rcx),%edx
mov    $0xffffffff,%eax
cmp    $0xfffffead,%edx
jb     114f <debug_active_process+0x3f>
add    $0xffff8c00,%ecx
movslq %ecx,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"PTBR\00"
define i32 @debug_active_process() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @registers_get_integer(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = sub nsw i32 %4, 29696
%6 = sdiv i32 %5, 20
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp sge i32 %10, 16
br i1 %11, label %12, label %13
12: ; preds = %9, %0
store i32 -1, i32* %2
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"PTBR\00"
define i32 @debug_active_process() {
%1 = tail call i32 @registers_get_integer(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = add nsw i32 %1, -29696
%3 = sdiv i32 %2, 20
%4 = add i32 %1, -30016
%5 = icmp ult i32 %4, -339
%6 = select i1 %5, i32 -1, i32 %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fat(int);
int /*<<< orphan*/ fib(int);
int main() {
  fat(5);
  fib(10);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <fat@plt>
mov    $0xa,%edi
call   1030 <fib@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fat(i32 5)
%3 = call i32 @fib(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fat(i32 5)
%2 = tail call i32 @fib(i32 10)
ret i32 0
}
/* Variables and functions */
char *energymon_strencpy(char *, char *, size_t);
char *energymon_get_source_shmem(char *buffer, size_t n) {
  return energymon_strencpy(buffer, "Shared Memory", n);
}


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

x86 assembly (clang, -O2):
<energymon_get_source_shmem>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <energymon_strencpy@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Shared Memory\00"
define i8* @energymon_get_source_shmem(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @energymon_strencpy(i8* %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [14 x i8] c"Shared Memory\00"
define i8* @energymon_get_source_shmem(i8* %0, i64 %1) {
%3 = tail call i8* @energymon_strencpy(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ __ESBMC_assume(int);
int /*<<< orphan*/ assert(int);
int nondet_int();
int main() {
  int fail = 0;
  int x = nondet_int();
  __ESBMC_assume(x > 0);
  while (x > 0) {
    if (fail == 1) {
      x = -1;
      fail = 2;
    } else {
      x--;
    }
  }
  assert(x == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__ESBMC_assume@plt>
cmpl   $0x0,-0xc(%rbp)
jle    1196 <main+0x66>
cmpl   $0x1,-0x8(%rbp)
jne    1188 <main+0x58>
movl   $0xffffffff,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
jmp    1191 <main+0x61>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1161 <main+0x31>
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <nondet_int@plt>
mov    %eax,%ebx
xor    %edi,%edi
test   %eax,%eax
setg   %dil
call   1040 <__ESBMC_assume@plt>
not    %ebx
shr    $0x1f,%ebx
mov    %ebx,%edi
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i32 (...) @nondet_int()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @__ESBMC_assume(i32 %7)
br label %9
9: ; preds = %19, %0
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 -1, i32* %3
store i32 2, i32* %2
br label %19
16: ; preds = %12
%17 = load i32, i32* %3
%18 = add nsw i32 %17, -1
store i32 %18, i32* %3
br label %19
19: ; preds = %16, %15
br label %9
20: ; preds = %9
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = load i32, i32* %1
ret i32 %25
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nondet_int()
%2 = icmp sgt i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @__ESBMC_assume(i32 %3)
%5 = xor i32 %1, -1
%6 = lshr i32 %5, 31
%7 = tail call i32 @assert(i32 %6)
ret i32 0
}
int UnpackPadPack(const unsigned char *pbData, int Bytes) {
  unsigned short Len;
  Len = pbData[5] | (pbData[4] << 8);
  if (Bytes < 6)
    return Bytes;
  return Len + 6;
}


x86 assembly (clang, -O0):
<UnpackPadPack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl 0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %ax,-0x16(%rbp)
cmpl   $0x6,-0x14(%rbp)
jge    1139 <UnpackPadPack+0x39>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <UnpackPadPack+0x43>
movzwl -0x16(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnpackPadPack>:
mov    %esi,%eax
cmp    $0x6,%esi
jl     1113 <UnpackPadPack+0x13>
movzwl 0x4(%rdi),%eax
shl    $0x10,%eax
bswap  %eax
add    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @UnpackPadPack(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i16
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 5
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = shl i32 %14, 8
%16 = or i32 %10, %15
%17 = trunc i32 %16 to i16
store i16 %17, i16* %6
%18 = load i32, i32* %5
%19 = icmp slt i32 %18, 6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = load i32, i32* %5
store i32 %21, i32* %3
br label %26
22: ; preds = %2
%23 = load i16, i16* %6
%24 = zext i16 %23 to i32
%25 = add nsw i32 %24, 6
store i32 %25, i32* %3
br label %26
26: ; preds = %22, %20
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @UnpackPadPack(i8* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 6
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8, i8* %0, i64 5
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl nuw nsw i32 %9, 8
%11 = zext i8 %6 to i32
%12 = or i32 %10, %11
%13 = add nuw nsw i32 %12, 6
br label %14
14: ; preds = %2, %4
%15 = phi i32 [ %13, %4 ], [ %1, %2 ]
ret i32 %15
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_poly1305_selectznz(uintptr_t, uintptr_t,
                                                    uintptr_t, uintptr_t);
void fiat_poly1305_selectznz(uint64_t out1[3], uint8_t arg1,
                             const uint64_t arg2[3], const uint64_t arg3[3]) {
  internal_fiat_poly1305_selectznz((uintptr_t)out1, (uintptr_t)arg1,
                                   (uintptr_t)arg2, (uintptr_t)arg3);
}


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

x86 assembly (clang, -O2):
<fiat_poly1305_selectznz>:
jmp    1030 <internal_fiat_poly1305_selectznz@plt>

LLVM IR (-O0):
define void @fiat_poly1305_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i64, i64* %6
%12 = load i32*, i32** %7
%13 = ptrtoint i32* %12 to i64
%14 = load i32*, i32** %8
%15 = ptrtoint i32* %14 to i64
%16 = call i32 @internal_fiat_poly1305_selectznz(i64 %10, i64 %11, i64 %13, i64 %15)
ret void
}

LLVM IR (-O2):
define void @fiat_poly1305_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = ptrtoint i32* %0 to i64
%6 = ptrtoint i32* %2 to i64
%7 = ptrtoint i32* %3 to i64
%8 = tail call i32 @internal_fiat_poly1305_selectznz(i64 %5, i64 %1, i64 %6, i64 %7)
ret void
}
void X509_STORE_new(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_STORE_new() {
ret void
}
int fdmi_dbg(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define i32 @fdmi_dbg(i8* nocapture readnone %0, ...) {
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t h265hvcc_get_parallelism_type(const uint8_t *p) { return p[14] & 0x3; }


x86 assembly (clang, -O0):
<h265hvcc_get_parallelism_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_get_parallelism_type>:
mov    0x38(%rdi),%eax
and    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @h265hvcc_get_parallelism_type(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 14
%3 = load i32, i32* %2
%4 = and i32 %3, 3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ resetChip();
int /*<<< orphan*/ setupNodesAndTransistors();
void initAndResetChip() {
  setupNodesAndTransistors();
  resetChip();
}


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

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

LLVM IR (-O0):
define void @initAndResetChip() {
%1 = call i32 (...) @setupNodesAndTransistors()
%2 = call i32 (...) @resetChip()
ret void
}

LLVM IR (-O2):
define void @initAndResetChip() {
%1 = tail call i32 (...) @setupNodesAndTransistors()
%2 = tail call i32 (...) @resetChip()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ mbstate_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
size_t mbrtowc(int /*<<< orphan*/ *, char const *, size_t,
               int /*<<< orphan*/ *);
size_t mbrtowc_l(wchar_t *wc, const char *str, size_t max_sz, mbstate_t *ps,
                 locale_t loc) {
  return mbrtowc(wc, str, max_sz, ps);
}


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

x86 assembly (clang, -O2):
<mbrtowc_l>:
jmp    1030 <mbrtowc@plt>

LLVM IR (-O0):
define i64 @mbrtowc_l(i32* %0, i8* %1, i64 %2, i32* %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i32*, i32** %9
%15 = call i64 @mbrtowc(i32* %11, i8* %12, i64 %13, i32* %14)
ret i64 %15
}

LLVM IR (-O2):
define i64 @mbrtowc_l(i32* %0, i8* %1, i64 %2, i32* %3, i32 %4) {
%6 = tail call i64 @mbrtowc(i32* %0, i8* %1, i64 %2, i32* %3)
ret i64 %6
}
/* Type definitions */
struct passwd {
  int dummy;
};
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sdump_passwd(struct passwd *, char *, int);
void dump_passwd(struct passwd *pwd) {
  if (pwd != NULL) {
    char buffer[2048];
    sdump_passwd(pwd, buffer, sizeof(buffer));
    printf("%s\n", buffer);
  } else
    printf("(null)\n");
}


x86 assembly (clang, -O0):
<dump_passwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <dump_passwd+0x49>
mov    -0x8(%rbp),%rdi
lea    -0x810(%rbp),%rsi
mov    $0x800,%edx
call   1040 <sdump_passwd@plt>
lea    -0x810(%rbp),%rsi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1177 <dump_passwd+0x57>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_passwd>:
test   %rdi,%rdi
je     114e <dump_passwd+0x2e>
push   %rbx
sub    $0x800,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
mov    $0x800,%edx
call   1040 <sdump_passwd@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x800,%rsp
pop    %rbx
ret
lea    0xeab(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
%struct.passwd = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [8 x i8] c"(null)\0A\00"
define void @dump_passwd(%struct.passwd* %0) {
%2 = alloca %struct.passwd*
%3 = alloca [2048 x i8]
store %struct.passwd* %0, %struct.passwd** %2
%4 = load %struct.passwd*, %struct.passwd** %2
%5 = icmp ne %struct.passwd* %4, null
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load %struct.passwd*, %struct.passwd** %2
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%9 = call i32 @sdump_passwd(%struct.passwd* %7, i8* %8, i32 2048)
%10 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %14
12: ; preds = %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %6
ret void
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@str = [7 x i8] c"(null)\00"
define void @dump_passwd(%struct.passwd* %0) {
%2 = alloca [2048 x i8]
%3 = icmp eq %struct.passwd* %0, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%6 = call i32 @sdump_passwd(%struct.passwd* %0, i8* %5, i32 2048)
%7 = call i32 @puts(i8* %5)
br label %10
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CG_Printf(char *, char *);
void CG_printConsoleString(char *str) { CG_Printf("[skipnotify]%s", str); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"[skipnotify]%s\00"
define void @CG_printConsoleString(i8* %0) {
%2 = tail call i32 @CG_Printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void dvbvbittx_set_field(uint8_t *p, bool field) {
  p[0] |= 0xc0;
  if (field)
    p[0] |= 0x20;
  else
    p[0] &= ~0x20;
}


x86 assembly (clang, -O0):
<dvbvbittx_set_field>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0xc0,%ecx
mov    %ecx,(%rax)
cmpl   $0x0,-0xc(%rbp)
je     1133 <dvbvbittx_set_field+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0x20,%ecx
mov    %ecx,(%rax)
jmp    113e <dvbvbittx_set_field+0x3e>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xffffffdf,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvbvbittx_set_field>:
mov    (%rdi),%eax
mov    %eax,%ecx
and    $0xffffff1f,%ecx
or     $0xc0,%ecx
or     $0xe0,%eax
test   %esi,%esi
cmove  %ecx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @dvbvbittx_set_field(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = or i32 %7, 192
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = or i32 %14, 32
store i32 %15, i32* %13
br label %21
16: ; preds = %2
%17 = load i32*, i32** %3
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = and i32 %19, -33
store i32 %20, i32* %18
br label %21
21: ; preds = %16, %11
ret void
}

LLVM IR (-O2):
define void @dvbvbittx_set_field(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %1, 0
%5 = and i32 %3, -225
%6 = or i32 %5, 192
%7 = or i32 %3, 224
%8 = select i1 %4, i32 %6, i32 %7
store i32 %8, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_pin(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
uint8_t get_interrupt_on_pin(uint8_t address, uint8_t pin) {
  return get_pin(address, pin, 0x04, 0x05);
}


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

x86 assembly (clang, -O2):
<get_interrupt_on_pin>:
mov    $0x4,%edx
mov    $0x5,%ecx
jmp    1030 <get_pin@plt>

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

LLVM IR (-O2):
define i32 @get_interrupt_on_pin(i32 %0, i32 %1) {
%3 = tail call i32 @get_pin(i32 %0, i32 %1, i32 4, i32 5)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fputc(int, unsigned int);
void fput_int(int d, unsigned handle) { fputc(d, handle); }


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

x86 assembly (clang, -O2):
<fput_int>:
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @fput_int(i32 %0, i32 %1) {
%3 = tail call i32 @fputc(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  int c = getchar();
  if (c <= 'A')
    putchar('X');
  else
    putchar('Y');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jg     1152 <main+0x32>
mov    $0x58,%edi
call   1030 <putchar@plt>
jmp    115c <main+0x3c>
mov    $0x59,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %edi,%edi
cmp    $0x42,%eax
setl   %dil
xor    $0x59,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getchar()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 65
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @putchar(i8 signext 88)
br label %10
8: ; preds = %0
%9 = call i32 @putchar(i8 signext 89)
br label %10
10: ; preds = %8, %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = icmp slt i32 %1, 66
%3 = select i1 %2, i8 88, i8 89
%4 = tail call i32 @putchar(i8 signext %3)
ret i32 0
}
const char *getVersion() {
  return "Jobserver (executor) 2.9 (1.1)\n"
         "Copyright (C) 2017 independIT Integrative Technologies GmbH\n"
         "All rights reserved\n";
}


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

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

LLVM IR (-O0):
@.str = [112 x i8] c"Jobserver (executor) 2.9 (1.1)\0ACopyright (C) 2017 independIT Integrative Technologies GmbH\0AAll rights reserved\0A\00"
define i8* @getVersion() {
ret i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [112 x i8] c"Jobserver (executor) 2.9 (1.1)\0ACopyright (C) 2017 independIT Integrative Technologies GmbH\0AAll rights reserved\0A\00"
define i8* @getVersion() {
ret i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_cmp(int /*<<< orphan*/);
int /*<<< orphan*/ arm_data_regr_op();
void arm_cmp_regr() { arm_arith_cmp(arm_data_regr_op()); }


x86 assembly (clang, -O0):
<arm_cmp_regr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arm_data_regr_op@plt>
mov    %eax,%edi
call   1030 <arm_arith_cmp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_cmp_regr>:
push   %rax
xor    %eax,%eax
call   1040 <arm_data_regr_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_arith_cmp@plt>

LLVM IR (-O0):
define void @arm_cmp_regr() {
%1 = call i32 (...) @arm_data_regr_op()
%2 = call i32 @arm_arith_cmp(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_cmp_regr() {
%1 = tail call i32 (...) @arm_data_regr_op()
%2 = tail call i32 @arm_arith_cmp(i32 %1)
ret void
}
int has_depot(char *line) {
  if (line[0] == 'd')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<has_depot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x64,%eax
jne    1124 <has_depot+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <has_depot+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_depot>:
xor    %eax,%eax
cmpb   $0x64,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @has_depot(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 100
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @has_depot(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 100
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_request_call_context_create() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_request_call_context_create>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_request_call_context_create>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_request_call_context_create() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_request_call_context_create() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int ft_uporlow(int);
int ft_tolower(int c) {
  if (ft_uporlow(c) == 1)
    c += 32;
  return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ft_uporlow@plt>
cmp    $0x1,%eax
jne    1135 <ft_tolower+0x25>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <ft_uporlow@plt>
lea    0x20(%rbx),%ecx
cmp    $0x1,%eax
cmovne %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = tail call i32 @ft_uporlow(i32 %0)
%3 = icmp eq i32 %2, 1
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) { printf("Hello, %s!\n", argv[1]); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello, %s!\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
double contr5_(int *, double *, double *, int *);
double ccontr5(int i, double s, double *cont, int *lrc) {
  int I = i;
  double S = s;
  return contr5_(&I, &S, cont, lrc);
}


x86 assembly (clang, -O0):
<ccontr5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <contr5_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccontr5>:
sub    $0x18,%rsp
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <contr5_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ccontr5(i32 %0, double %1, double* %2, i32* %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double* %2, double** %7
store i32* %3, i32** %8
%11 = load i32, i32* %5
store i32 %11, i32* %9
%12 = load double, double* %6
store double %12, double* %10
%13 = load double*, double** %7
%14 = load i32*, i32** %8
%15 = call double @contr5_(i32* %9, double* %10, double* %13, i32* %14)
ret double %15
}

LLVM IR (-O2):
define double @ccontr5(i32 %0, double %1, double* %2, i32* %3) {
%5 = alloca i32
%6 = alloca double
%7 = bitcast i32* %5 to i8*
store i32 %0, i32* %5
%8 = bitcast double* %6 to i8*
store double %1, double* %6
%9 = call double @contr5_(i32* %5, double* %6, double* %2, i32* %3)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void die(char *mess) {
  perror(mess);
  exit(1);
}


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

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

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

LLVM IR (-O2):
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ uart0SendString(unsigned char *);
void printC(unsigned char chr) {
  unsigned char buf[2];
  buf[0] = chr;
  buf[1] = '\0';
  uart0SendString(buf);
}


x86 assembly (clang, -O0):
<printC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
call   1030 <uart0SendString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printC>:
push   %rax
mov    %dil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <uart0SendString@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @printC(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %4, i8* %5
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %6
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = call i32 @uart0SendString(i8* %7)
ret void
}

LLVM IR (-O2):
define void @printC(i8 zeroext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 %0, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %4
%5 = call i32 @uart0SendString(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ nl_catd;

/* Variables and functions */
nl_catd catopen(const char *name, int oflag) { return (nl_catd)-1; }


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

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

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

LLVM IR (-O2):
define i32 @catopen(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ set_WORM(struct list_head *);
uint8_t set_default_WORM(struct list_head *l) {
  ;
  return set_WORM(l);
}


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

x86 assembly (clang, -O2):
<set_default_WORM>:
jmp    1030 <set_WORM@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define i32 @set_default_WORM(%struct.list_head* %0) {
%2 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %2
%3 = load %struct.list_head*, %struct.list_head** %2
%4 = call i32 @set_WORM(%struct.list_head* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define i32 @set_default_WORM(%struct.list_head* %0) {
%2 = tail call i32 @set_WORM(%struct.list_head* %0)
ret i32 %2
}
int min(int a, int b) {
  if (b < a)
    return b;
  return a;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @min(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* %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %5
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %4
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int is_int(char *s) {
  for (; (*s >= '0' && *s <= '9') || *s == '+' || *s == '-'; s++)
    ;
  return *s == '\0' ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     112d <is_int+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x9(%rbp)
jle    1152 <is_int+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x9(%rbp)
je     1152 <is_int+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1162 <is_int+0x62>
jmp    1178 <is_int+0x78>
jmp    1167 <is_int+0x67>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <is_int+0x8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_int>:
jmp    1114 <is_int+0x14>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rdi
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%eax
cmp    $0xa,%al
jb     1110 <is_int+0x10>
cmp    $0x2d,%cl
je     1110 <is_int+0x10>
cmp    $0x2b,%cl
je     1110 <is_int+0x10>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @is_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %26, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 48
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sle i32 %11, 57
br i1 %12, label %23, label %13
13: ; preds = %8, %3
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 43
br i1 %17, label %23, label %18
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 45
br label %23
23: ; preds = %18, %13, %8
%24 = phi i1 [ true, %13 ], [ true, %8 ], [ %22, %18 ]
br i1 %24, label %25, label %29
25: ; preds = %23
br label %26
26: ; preds = %25
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %2
br label %3
29: ; preds = %23
%30 = load i8*, i8** %2
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 0
%34 = zext i1 %33 to i64
%35 = select i1 %33, i32 1, i32 0
ret i32 %35
}

LLVM IR (-O2):
define i32 @is_int(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = load i8, i8* %3
%5 = add i8 %4, -48
%6 = icmp ult i8 %5, 10
br i1 %6, label %8, label %7
7: ; preds = %2
switch i8 %4, label %10 [
i8 43, label %8
i8 45, label %8
]
8: ; preds = %7, %7, %2
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %7
%11 = icmp eq i8 %4, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, unsigned char);
void sprint_mov_Rn_to_direct(char *str, unsigned char n, uint8_t direct) {
  sprintf(str,
          "MOV   "
          "0x%02X"
          ", R%X                  ",
          direct, n);
}


x86 assembly (clang, -O0):
<sprint_mov_Rn_to_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
lea    0xecd(%rip),%rsi
movzbl -0x9(%rbp),%ecx
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_mov_Rn_to_direct>:
mov    %esi,%ecx
lea    0xee7(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"MOV 0x%02X, R%X \00"
define void @sprint_mov_Rn_to_direct(i8* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = load i8, i8* %5
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %8, i8 zeroext %9)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"MOV 0x%02X, R%X \00"
define void @sprint_mov_Rn_to_direct(i8* nocapture writeonly %0, i8 zeroext %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %2, i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage:\n");
  printf("  ./t8.6.2 <int_value> for sleep time\n");
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [39 x i8] c" ./t8.6.2 <int_value> for sleep time\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"usage:\00"
@str.2 = [38 x i8] c" ./t8.6.2 <int_value> for sleep time\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int chrkey(void const *);
int chrcmp(const void *a, const void *b) { return chrkey(a) - chrkey(b); }


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

x86 assembly (clang, -O2):
<chrcmp>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <chrkey@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <chrkey@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @chrcmp(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 = call i32 @chrkey(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @chrkey(i8* %7)
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @chrcmp(i8* %0, i8* %1) {
%3 = tail call i32 @chrkey(i8* %0)
%4 = tail call i32 @chrkey(i8* %1)
%5 = sub nsw i32 %3, %4
ret i32 %5
}