#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*/ check_input(int);
int open_output(int, char **);
int /*<<< orphan*/ overwrite_prevent(int, char **);
int /*<<< orphan*/ shutdown_output(int);
int /*<<< orphan*/ write_file(int, char *);
int main(int argc, char **argv) {
  int fileDescriptor;
  check_input(argc);
  overwrite_prevent(argc, argv);
  fileDescriptor = open_output(argc, argv);
  write_file(fileDescriptor, argv[1]);
  write_file(fileDescriptor, argv[2]);
  shutdown_output(fileDescriptor);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <check_input@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <overwrite_prevent@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <open_output@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1070 <write_file@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1070 <write_file@plt>
mov    -0x14(%rbp),%edi
call   1040 <shutdown_output@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1050 <check_input@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <overwrite_prevent@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <open_output@plt>
mov    %eax,%ebp
mov    0x8(%rbx),%rsi
mov    %eax,%edi
call   1070 <write_file@plt>
mov    0x10(%rbx),%rsi
mov    %ebp,%edi
call   1070 <write_file@plt>
mov    %ebp,%edi
call   1040 <shutdown_output@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = call i32 @check_input(i32 %7)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = call i32 @overwrite_prevent(i32 %9, i8** %10)
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = call i32 @open_output(i32 %12, i8** %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @write_file(i32 %15, i8* %18)
%20 = load i32, i32* %6
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = call i32 @write_file(i32 %20, i8* %23)
%25 = load i32, i32* %6
%26 = call i32 @shutdown_output(i32 %25)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @check_input(i32 %0)
%4 = tail call i32 @overwrite_prevent(i32 %0, i8** %1)
%5 = tail call i32 @open_output(i32 %0, i8** %1)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @write_file(i32 %5, i8* %7)
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @write_file(i32 %5, i8* %10)
%12 = tail call i32 @shutdown_output(i32 %5)
ret i32 0
}