#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 */
typedef int /*<<< orphan*/ uint32_t;
struct ext2_fs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ext2_alloc_inode(struct ext2_fs *);
size_t ext2_write_file(struct ext2_fs *, int /*<<< orphan*/, int, char *,
                       char *, int, size_t);
size_t ext2_touch_file(struct ext2_fs *f, int parent, char *name, char *data,
                       int mode, size_t n) {
  uint32_t inode_num = ext2_alloc_inode(f);
  return ext2_write_file(f, inode_num, parent, name, data, mode | 0x8000, n);
}


x86 assembly (clang, -O0):
<ext2_touch_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ext2_alloc_inode@plt>
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
or     $0x8000,%r9d
mov    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <ext2_write_file@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext2_touch_file>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r12
mov    %r8d,%ebp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%r13d
mov    %rdi,%rbx
call   1030 <ext2_alloc_inode@plt>
or     $0x8000,%ebp
mov    %r12,(%rsp)
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r13d,%edx
mov    %r15,%rcx
mov    %r14,%r8
mov    %ebp,%r9d
call   1040 <ext2_write_file@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ext2_fs = type { i32 }
define i64 @ext2_touch_file(%struct.ext2_fs* %0, i32 %1, i8* %2, i8* %3, i32 %4, i64 %5) {
%7 = alloca %struct.ext2_fs*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i64
%13 = alloca i32
store %struct.ext2_fs* %0, %struct.ext2_fs** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i64 %5, i64* %12
%14 = load %struct.ext2_fs*, %struct.ext2_fs** %7
%15 = call i32 @ext2_alloc_inode(%struct.ext2_fs* %14)
store i32 %15, i32* %13
%16 = load %struct.ext2_fs*, %struct.ext2_fs** %7
%17 = load i32, i32* %13
%18 = load i32, i32* %8
%19 = load i8*, i8** %9
%20 = load i8*, i8** %10
%21 = load i32, i32* %11
%22 = or i32 %21, 32768
%23 = load i64, i64* %12
%24 = call i64 @ext2_write_file(%struct.ext2_fs* %16, i32 %17, i32 %18, i8* %19, i8* %20, i32 %22, i64 %23)
ret i64 %24
}

LLVM IR (-O2):
%struct.ext2_fs = type { i32 }
define i64 @ext2_touch_file(%struct.ext2_fs* %0, i32 %1, i8* %2, i8* %3, i32 %4, i64 %5) {
%7 = tail call i32 @ext2_alloc_inode(%struct.ext2_fs* %0)
%8 = or i32 %4, 32768
%9 = tail call i64 @ext2_write_file(%struct.ext2_fs* %0, i32 %7, i32 %1, i8* %2, i8* %3, i32 %8, i64 %5)
ret i64 %9
}