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

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void main_header(int argc, char **argv) {
  int n;
  time_t t;
  t = time(NULL);
  printf("* Created by NELMA capacitance calculator, version %s\n", "3.2");
  printf("* %s", ctime(&t));
  printf("*\n");
  printf("* Command line:");
  for (n = 0; n < argc; n++) {
    printf(" %s", argv[n]);
  }
  printf("\n\n");
}


x86 assembly (clang, -O0):
<main_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x18(%rbp)
lea    0xeae(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x18(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11d1 <main_header+0xa1>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119d <main_header+0x6d>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_header>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,0x4(%rsp)
lea    0xea2(%rip),%rdi
lea    0xed2(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x4(%rsp),%rdi
call   1040 <ctime@plt>
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %ebp,%ebp
jle    11c7 <main_header+0x87>
mov    %ebp,%ebx
lea    0xe8e(%rip),%r15
xor    %ebp,%ebp
mov    (%r14,%rbp,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    11b0 <main_header+0x70>
lea    0xe67(%rip),%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [55 x i8] c"* Created by NELMA capacitance calculator, version %s\0A\00"
@.str.1 = [4 x i8] c"3.2\00"
@.str.2 = [5 x i8] c"* %s\00"
@.str.3 = [3 x i8] c"*\0A\00"
@.str.4 = [16 x i8] c"* Command line:\00"
@.str.5 = [4 x i8] c" %s\00"
@.str.6 = [3 x i8] c"\0A\0A\00"
define void @main_header(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = call i32 @time(i32* null)
store i32 %7, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = call i8* @ctime(i32* %6)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %5
br label %13
13: ; preds = %24, %2
%14 = load i32, i32* %5
%15 = load i32, i32* %3
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %27
17: ; preds = %13
%18 = load i8**, i8*** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %22)
br label %24
24: ; preds = %17
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %13
27: ; preds = %13
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"* Created by NELMA capacitance calculator, version %s\0A\00"
@.str.1 = [4 x i8] c"3.2\00"
@.str.2 = [5 x i8] c"* %s\00"
@.str.4 = [16 x i8] c"* Command line:\00"
@.str.5 = [4 x i8] c" %s\00"
@str = [2 x i8] c"*\00"
@str.7 = [2 x i8] c"\0A\00"
define void @main_header(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = call i8* @ctime(i32* %3)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%11 = icmp sgt i32 %0, 0
br i1 %11, label %12, label %21
12: ; preds = %2
%13 = zext i32 %0 to i64
br label %14
14: ; preds = %12, %14
%15 = phi i64 [ 0, %12 ], [ %19, %14 ]
%16 = getelementptr inbounds i8*, i8** %1, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %17)
%19 = add nuw nsw i64 %15, 1
%20 = icmp eq i64 %19, %13
br i1 %20, label %21, label %14
21: ; preds = %14, %2
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
ret void
}