#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 sb {
  int dummy;
};
struct inode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ insert_inode_hash(struct inode *);
struct inode *new_inode(int /*<<< orphan*/);
int /*<<< orphan*/ tux_set_inum(struct inode *, int);
int /*<<< orphan*/ tux_setup_inode(struct inode *);
int /*<<< orphan*/ vfs_sb(struct sb *);
struct inode *tux_new_logmap(struct sb *sb) {
  struct inode *inode = new_inode(vfs_sb(sb));
  if (inode) {
    tux_set_inum(inode, 62);
    tux_setup_inode(inode);
    insert_inode_hash(inode);
  }
  return inode;
}


x86 assembly (clang, -O0):
<tux_new_logmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <vfs_sb@plt>
mov    %eax,%edi
call   1050 <new_inode@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     119b <tux_new_logmap+0x4b>
mov    -0x10(%rbp),%rdi
mov    $0x3e,%esi
call   1070 <tux_set_inum@plt>
mov    -0x10(%rbp),%rdi
call   1040 <tux_setup_inode@plt>
mov    -0x10(%rbp),%rdi
call   1030 <insert_inode_hash@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tux_new_logmap>:
push   %rbx
call   1060 <vfs_sb@plt>
mov    %eax,%edi
call   1050 <new_inode@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1182 <tux_new_logmap+0x32>
mov    %rbx,%rdi
mov    $0x3e,%esi
call   1070 <tux_set_inum@plt>
mov    %rbx,%rdi
call   1040 <tux_setup_inode@plt>
mov    %rbx,%rdi
call   1030 <insert_inode_hash@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.inode = type { i32 }
%struct.sb = type { i32 }
define %struct.inode* @tux_new_logmap(%struct.sb* %0) {
%2 = alloca %struct.sb*
%3 = alloca %struct.inode*
store %struct.sb* %0, %struct.sb** %2
%4 = load %struct.sb*, %struct.sb** %2
%5 = call i32 @vfs_sb(%struct.sb* %4)
%6 = call %struct.inode* @new_inode(i32 %5)
store %struct.inode* %6, %struct.inode** %3
%7 = load %struct.inode*, %struct.inode** %3
%8 = icmp ne %struct.inode* %7, null
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = load %struct.inode*, %struct.inode** %3
%11 = call i32 @tux_set_inum(%struct.inode* %10, i32 62)
%12 = load %struct.inode*, %struct.inode** %3
%13 = call i32 @tux_setup_inode(%struct.inode* %12)
%14 = load %struct.inode*, %struct.inode** %3
%15 = call i32 @insert_inode_hash(%struct.inode* %14)
br label %16
16: ; preds = %9, %1
%17 = load %struct.inode*, %struct.inode** %3
ret %struct.inode* %17
}

LLVM IR (-O2):
%struct.inode = type { i32 }
%struct.sb = type { i32 }
define %struct.inode* @tux_new_logmap(%struct.sb* %0) {
%2 = tail call i32 @vfs_sb(%struct.sb* %0)
%3 = tail call %struct.inode* @new_inode(i32 %2)
%4 = icmp eq %struct.inode* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = tail call i32 @tux_set_inum(%struct.inode* %3, i32 62)
%7 = tail call i32 @tux_setup_inode(%struct.inode* %3)
%8 = tail call i32 @insert_inode_hash(%struct.inode* %3)
br label %9
9: ; preds = %5, %1
ret %struct.inode* %3
}