#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct super_block {
  int dummy;
};
struct msdos_dir_entry {
  int dummy;
};
struct buffer_head {
  int dummy;
};

/* Variables and functions */
int raw_scan_nonroot(struct super_block *, int, char *, int *, int *,
                     struct buffer_head **, struct msdos_dir_entry **);
int raw_scan_root(struct super_block *, char *, int *, int *,
                  struct buffer_head **, struct msdos_dir_entry **);
int raw_scan(struct super_block *sb, int start, char *name, int *number,
             int *ino, struct buffer_head **res_bh,
             struct msdos_dir_entry **res_de) {
  if (start)
    return raw_scan_nonroot(sb, start, name, number, ino, res_bh, res_de);
  else
    return raw_scan_root(sb, name, number, ino, res_bh, res_de);
}


x86 assembly (clang, -O0):
<raw_scan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1179 <raw_scan+0x59>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <raw_scan_nonroot@plt>
mov    %eax,-0x4(%rbp)
jmp    1199 <raw_scan+0x79>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    0x10(%rbp),%r9
call   1040 <raw_scan_root@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_scan>:
test   %esi,%esi
je     1129 <raw_scan+0x9>
jmp    1030 <raw_scan_nonroot@plt>
mov    0x8(%rsp),%rax
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %r9,%r8
mov    %rax,%r9
jmp    1040 <raw_scan_root@plt>

LLVM IR (-O0):
%struct.super_block = type { i32 }
%struct.buffer_head = type { i32 }
%struct.msdos_dir_entry = type { i32 }
define i32 @raw_scan(%struct.super_block* %0, i32 %1, i8* %2, i32* %3, i32* %4, %struct.buffer_head** %5, %struct.msdos_dir_entry** %6) {
%8 = alloca i32
%9 = alloca %struct.super_block*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca %struct.buffer_head**
%15 = alloca %struct.msdos_dir_entry**
store %struct.super_block* %0, %struct.super_block** %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store %struct.buffer_head** %5, %struct.buffer_head*** %14
store %struct.msdos_dir_entry** %6, %struct.msdos_dir_entry*** %15
%16 = load i32, i32* %10
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %27
18: ; preds = %7
%19 = load %struct.super_block*, %struct.super_block** %9
%20 = load i32, i32* %10
%21 = load i8*, i8** %11
%22 = load i32*, i32** %12
%23 = load i32*, i32** %13
%24 = load %struct.buffer_head**, %struct.buffer_head*** %14
%25 = load %struct.msdos_dir_entry**, %struct.msdos_dir_entry*** %15
%26 = call i32 @raw_scan_nonroot(%struct.super_block* %19, i32 %20, i8* %21, i32* %22, i32* %23, %struct.buffer_head** %24, %struct.msdos_dir_entry** %25)
store i32 %26, i32* %8
br label %35
27: ; preds = %7
%28 = load %struct.super_block*, %struct.super_block** %9
%29 = load i8*, i8** %11
%30 = load i32*, i32** %12
%31 = load i32*, i32** %13
%32 = load %struct.buffer_head**, %struct.buffer_head*** %14
%33 = load %struct.msdos_dir_entry**, %struct.msdos_dir_entry*** %15
%34 = call i32 @raw_scan_root(%struct.super_block* %28, i8* %29, i32* %30, i32* %31, %struct.buffer_head** %32, %struct.msdos_dir_entry** %33)
store i32 %34, i32* %8
br label %35
35: ; preds = %27, %18
%36 = load i32, i32* %8
ret i32 %36
}

LLVM IR (-O2):
%struct.super_block = type { i32 }
%struct.buffer_head = type { i32 }
%struct.msdos_dir_entry = type { i32 }
define i32 @raw_scan(%struct.super_block* %0, i32 %1, i8* %2, i32* %3, i32* %4, %struct.buffer_head** %5, %struct.msdos_dir_entry** %6) {
%8 = icmp eq i32 %1, 0
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 @raw_scan_nonroot(%struct.super_block* %0, i32 %1, i8* %2, i32* %3, i32* %4, %struct.buffer_head** %5, %struct.msdos_dir_entry** %6)
br label %13
11: ; preds = %7
%12 = tail call i32 @raw_scan_root(%struct.super_block* %0, i8* %2, i32* %3, i32* %4, %struct.buffer_head** %5, %struct.msdos_dir_entry** %6)
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
ret i32 %14
}