#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*/ write_h_file(char *, char *, char *);
int main(int argc, char **argv) {
  if (argc == 3)
    write_h_file(argv[1], argv[2], NULL);
  else if (argc == 4)
    write_h_file(argv[1], argv[2], argv[3]);
  else
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    114e <main+0x3e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write_h_file@plt>
jmp    118b <main+0x7b>
cmpl   $0x4,-0x8(%rbp)
jne    117a <main+0x6a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
call   1030 <write_h_file@plt>
jmp    1186 <main+0x76>
movl   $0x1,-0x4(%rbp)
jmp    1192 <main+0x82>
jmp    118b <main+0x7b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edx,%edx
cmp    $0x3,%edi
je     1126 <main+0x16>
mov    $0x1,%eax
cmp    $0x4,%edi
jne    1135 <main+0x25>
mov    0x18(%rsi),%rdx
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1030 <write_h_file@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
switch i32 %0, label %13 [
i32 3, label %6
i32 4, label %3
]
3: ; preds = %2
%4 = getelementptr inbounds i8*, i8** %1, i64 3
%5 = load i8*, i8** %4
br label %6
6: ; preds = %2, %3
%7 = phi i8* [ %5, %3 ], [ null, %2 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @write_h_file(i8* %9, i8* %11, i8* %7)
br label %13
13: ; preds = %6, %2
%14 = phi i32 [ 1, %2 ], [ 0, %6 ]
ret i32 %14
}