#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 const *, int *, int *,
                     struct buffer_head **, struct msdos_dir_entry **, char);
int raw_scan_root(struct super_block *, char const *, int *, int *,
                  struct buffer_head **, struct msdos_dir_entry **, char);
int raw_scan(struct super_block *sb, int start, const char *name, int *number,
             int *ino, struct buffer_head **res_bh,
             struct msdos_dir_entry **res_de, char scantype) {
  if (start)
    return raw_scan_nonroot(sb, start, name, number, ino, res_bh, res_de,
                            scantype);
  else
    return raw_scan_root(sb, name, number, ino, res_bh, res_de, scantype);
}


x86 assembly (clang, -O0):
<raw_scan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x18(%rbp),%al
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     1184 <raw_scan+0x64>
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)
movsbl 0x18(%rbp),%eax
mov    %eax,0x8(%rsp)
call   1030 <raw_scan_nonroot@plt>
mov    %eax,-0x4(%rbp)
jmp    11ab <raw_scan+0x8b>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    0x10(%rbp),%r9
movsbl 0x18(%rbp),%eax
mov    %eax,(%rsp)
call   1040 <raw_scan_root@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

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

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

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, i8 signext %7) {
%9 = icmp eq i32 %1, 0
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = 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, i8 signext %7)
br label %14
12: ; preds = %8
%13 = 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, i8 signext %7)
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
ret i32 %15
}