#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 */

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *mallocNCopyMcfio(char *, int);
int mcfioC_OpenWriteSequential(char *, char *, char *, char *, int, int *,
                               unsigned int);
int mcfio_openwritesequential_(char *device, char *vsn, char *title,
                               char *comment, int *numevts_pred, int *blkIds,
                               int *nBlocks, int ll1, int ll2, int ll3,
                               int ll4) {
  char *aString, *bString, *cString, *dString;
  int iret;
  aString = mallocNCopyMcfio(device, ll1);
  bString = mallocNCopyMcfio(vsn, ll2);
  cString = mallocNCopyMcfio(title, ll3);
  dString = mallocNCopyMcfio(comment, ll4);
  iret =
      mcfioC_OpenWriteSequential(aString, bString, cString, dString,
                                 *numevts_pred, blkIds, (unsigned int)*nBlocks);
  if (aString != NULL)
    free(aString);
  if (bString != NULL)
    free(bString);
  if (cString != NULL)
    free(cString);
  if (dString != NULL)
    free(dString);
  return iret;
}


x86 assembly (clang, -O0):
<mcfio_openwritesequential_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x18(%rbp),%esi
call   1040 <mallocNCopyMcfio@plt>
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x20(%rbp),%esi
call   1040 <mallocNCopyMcfio@plt>
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x28(%rbp),%esi
call   1040 <mallocNCopyMcfio@plt>
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x30(%rbp),%esi
call   1040 <mallocNCopyMcfio@plt>
mov    %rax,-0x50(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x50(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
call   1050 <mcfioC_OpenWriteSequential@plt>
mov    %eax,-0x54(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     11e0 <mcfio_openwritesequential_+0xb0>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x40(%rbp)
je     11f4 <mcfio_openwritesequential_+0xc4>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x48(%rbp)
je     1208 <mcfio_openwritesequential_+0xd8>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x50(%rbp)
je     121c <mcfio_openwritesequential_+0xec>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x54(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcfio_openwritesequential_>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r15
mov    %r8,%r13
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%rbx
mov    0x48(%rsp),%esi
call   1040 <mallocNCopyMcfio@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    0x50(%rsp),%esi
call   1040 <mallocNCopyMcfio@plt>
mov    %rax,%rbx
mov    %r12,%rdi
mov    0x58(%rsp),%esi
call   1040 <mallocNCopyMcfio@plt>
mov    %rax,%r12
mov    %r14,%rdi
mov    0x60(%rsp),%esi
call   1040 <mallocNCopyMcfio@plt>
mov    %rax,%r14
mov    0x0(%r13),%r8d
mov    0x40(%rsp),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r14,%rcx
mov    %r15,%r9
call   1050 <mcfioC_OpenWriteSequential@plt>
mov    %eax,%r15d
test   %rbp,%rbp
je     11b5 <mcfio_openwritesequential_+0x85>
mov    %rbp,%rdi
call   1030 <free@plt>
test   %rbx,%rbx
je     11c2 <mcfio_openwritesequential_+0x92>
mov    %rbx,%rdi
call   1030 <free@plt>
test   %r12,%r12
je     11cf <mcfio_openwritesequential_+0x9f>
mov    %r12,%rdi
call   1030 <free@plt>
test   %r14,%r14
je     11dc <mcfio_openwritesequential_+0xac>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mcfio_openwritesequential_(i8* %0, i8* %1, i8* %2, i8* %3, i32* %4, i32* %5, i32* %6, i32 %7, i32 %8, i32 %9, i32 %10) {
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i8*
%24 = alloca i8*
%25 = alloca i8*
%26 = alloca i8*
%27 = alloca i32
store i8* %0, i8** %12
store i8* %1, i8** %13
store i8* %2, i8** %14
store i8* %3, i8** %15
store i32* %4, i32** %16
store i32* %5, i32** %17
store i32* %6, i32** %18
store i32 %7, i32* %19
store i32 %8, i32* %20
store i32 %9, i32* %21
store i32 %10, i32* %22
%28 = load i8*, i8** %12
%29 = load i32, i32* %19
%30 = call i8* @mallocNCopyMcfio(i8* %28, i32 %29)
store i8* %30, i8** %23
%31 = load i8*, i8** %13
%32 = load i32, i32* %20
%33 = call i8* @mallocNCopyMcfio(i8* %31, i32 %32)
store i8* %33, i8** %24
%34 = load i8*, i8** %14
%35 = load i32, i32* %21
%36 = call i8* @mallocNCopyMcfio(i8* %34, i32 %35)
store i8* %36, i8** %25
%37 = load i8*, i8** %15
%38 = load i32, i32* %22
%39 = call i8* @mallocNCopyMcfio(i8* %37, i32 %38)
store i8* %39, i8** %26
%40 = load i8*, i8** %23
%41 = load i8*, i8** %24
%42 = load i8*, i8** %25
%43 = load i8*, i8** %26
%44 = load i32*, i32** %16
%45 = load i32, i32* %44
%46 = load i32*, i32** %17
%47 = load i32*, i32** %18
%48 = load i32, i32* %47
%49 = call i32 @mcfioC_OpenWriteSequential(i8* %40, i8* %41, i8* %42, i8* %43, i32 %45, i32* %46, i32 %48)
store i32 %49, i32* %27
%50 = load i8*, i8** %23
%51 = icmp ne i8* %50, null
br i1 %51, label %52, label %55
52: ; preds = %11
%53 = load i8*, i8** %23
%54 = call i32 @free(i8* %53)
br label %55
55: ; preds = %52, %11
%56 = load i8*, i8** %24
%57 = icmp ne i8* %56, null
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i8*, i8** %24
%60 = call i32 @free(i8* %59)
br label %61
61: ; preds = %58, %55
%62 = load i8*, i8** %25
%63 = icmp ne i8* %62, null
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = load i8*, i8** %25
%66 = call i32 @free(i8* %65)
br label %67
67: ; preds = %64, %61
%68 = load i8*, i8** %26
%69 = icmp ne i8* %68, null
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = load i8*, i8** %26
%72 = call i32 @free(i8* %71)
br label %73
73: ; preds = %70, %67
%74 = load i32, i32* %27
ret i32 %74
}

LLVM IR (-O2):
define i32 @mcfio_openwritesequential_(i8* %0, i8* %1, i8* %2, i8* %3, i32* nocapture %4, i32* %5, i32* nocapture %6, i32 %7, i32 %8, i32 %9, i32 %10) {
%12 = tail call i8* @mallocNCopyMcfio(i8* %0, i32 %7)
%13 = tail call i8* @mallocNCopyMcfio(i8* %1, i32 %8)
%14 = tail call i8* @mallocNCopyMcfio(i8* %2, i32 %9)
%15 = tail call i8* @mallocNCopyMcfio(i8* %3, i32 %10)
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = tail call i32 @mcfioC_OpenWriteSequential(i8* %12, i8* %13, i8* %14, i8* %15, i32 %16, i32* %5, i32 %17)
%19 = icmp eq i8* %12, null
br i1 %19, label %22, label %20
20: ; preds = %11
%21 = tail call i32 @free(i8* %12)
br label %22
22: ; preds = %20, %11
%23 = icmp eq i8* %13, null
br i1 %23, label %26, label %24
24: ; preds = %22
%25 = tail call i32 @free(i8* %13)
br label %26
26: ; preds = %24, %22
%27 = icmp eq i8* %14, null
br i1 %27, label %30, label %28
28: ; preds = %26
%29 = tail call i32 @free(i8* %14)
br label %30
30: ; preds = %28, %26
%31 = icmp eq i8* %15, null
br i1 %31, label %34, label %32
32: ; preds = %30
%33 = tail call i32 @free(i8* %15)
br label %34
34: ; preds = %32, %30
ret i32 %18
}