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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ *stderr;
int start(char *name, int atnum, char **atname, char **atval, char *buf,
          int sze, void *data) {
  int a;
  FILE *fp = NULL;
  if (data != NULL)
    fp = (FILE *)data;
  else
    fp = stderr;
  fprintf(fp, "\nStart Tag:%s\n", name);
  for (a = 0; a < atnum; a++) {
    fprintf(fp, "%s", atname[a]);
    if (atval[a] != 0)
      fprintf(fp, "=%s\n", atval[a]);
    else
      fprintf(fp, "\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
movq   $0x0,-0x38(%rbp)
cmpq   $0x0,0x10(%rbp)
je     1153 <start+0x43>
mov    0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    1161 <start+0x51>
mov    0x2e86(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1203 <start+0xf3>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe6e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11de <start+0xce>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe40(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11f0 <start+0xe0>
mov    -0x38(%rbp),%rdi
lea    0xe24(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11f5 <start+0xe5>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    117e <start+0x6e>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rdx
mov    0x40(%rsp),%rbx
test   %rbx,%rbx
jne    115a <start+0x2a>
mov    0x2e89(%rip),%rax
mov    (%rax),%rbx
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %ebp,%ebp
jle    11ba <start+0x8a>
mov    %ebp,%r13d
lea    0xe96(%rip),%r12
xor    %ebp,%ebp
jmp    1196 <start+0x66>
nopl   (%rax)
mov    $0xa,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
je     11ba <start+0x8a>
mov    (%r15,%rbp,8),%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
mov    (%r14,%rbp,8),%rdx
test   %rdx,%rdx
je     1180 <start+0x50>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
jmp    118d <start+0x5d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32* null
@.str = [15 x i8] c"\0AStart Tag:%s\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [5 x i8] c"=%s\0A\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @start(i8* %0, i32 %1, i8** %2, i8** %3, i8* %4, i32 %5, i8* %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8**
%11 = alloca i8**
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i8** %2, i8*** %10
store i8** %3, i8*** %11
store i8* %4, i8** %12
store i32 %5, i32* %13
store i8* %6, i8** %14
store i32* null, i32** %16
%17 = load i8*, i8** %14
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %22
19: ; preds = %7
%20 = load i8*, i8** %14
%21 = bitcast i8* %20 to i32*
store i32* %21, i32** %16
br label %24
22: ; preds = %7
%23 = load i32*, i32** @stderr
store i32* %23, i32** %16
br label %24
24: ; preds = %22, %19
%25 = load i32*, i32** %16
%26 = load i8*, i8** %8
%27 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %26)
store i32 0, i32* %15
br label %28
28: ; preds = %58, %24
%29 = load i32, i32* %15
%30 = load i32, i32* %9
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %61
32: ; preds = %28
%33 = load i32*, i32** %16
%34 = load i8**, i8*** %10
%35 = load i32, i32* %15
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8*, i8** %34, i64 %36
%38 = load i8*, i8** %37
%39 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %38)
%40 = load i8**, i8*** %11
%41 = load i32, i32* %15
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8*, i8** %40, i64 %42
%44 = load i8*, i8** %43
%45 = icmp ne i8* %44, null
br i1 %45, label %46, label %54
46: ; preds = %32
%47 = load i32*, i32** %16
%48 = load i8**, i8*** %11
%49 = load i32, i32* %15
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8*, i8** %48, i64 %50
%52 = load i8*, i8** %51
%53 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %52)
br label %57
54: ; preds = %32
%55 = load i32*, i32** %16
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %57
57: ; preds = %54, %46
br label %58
58: ; preds = %57
%59 = load i32, i32* %15
%60 = add nsw i32 %59, 1
store i32 %60, i32* %15
br label %28
61: ; preds = %28
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32* null
@.str = [15 x i8] c"\0AStart Tag:%s\0A\00"
@.str.2 = [5 x i8] c"=%s\0A\00"
define i32 @start(i8* %0, i32 %1, i8** nocapture %2, i8** nocapture %3, i8* nocapture readnone %4, i32 %5, i8* %6) {
%8 = icmp eq i8* %6, null
%9 = bitcast i8* %6 to i32*
%10 = load i32*, i32** @stderr
%11 = select i1 %8, i32* %10, i32* %9
%12 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%13 = icmp sgt i32 %1, 0
br i1 %13, label %14, label %31
14: ; preds = %7
%15 = zext i32 %1 to i64
br label %16
16: ; preds = %14, %28
%17 = phi i64 [ 0, %14 ], [ %29, %28 ]
%18 = getelementptr inbounds i8*, i8** %2, i64 %17
%19 = load i8*, i8** %18
%20 = tail call i32 @fputs(i8* %19, i32* %11)
%21 = getelementptr inbounds i8*, i8** %3, i64 %17
%22 = load i8*, i8** %21
%23 = icmp eq i8* %22, null
br i1 %23, label %26, label %24
24: ; preds = %16
%25 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %22)
br label %28
26: ; preds = %16
%27 = tail call i32 @fputc(i32 10, i32* %11)
br label %28
28: ; preds = %24, %26
%29 = add nuw nsw i64 %17, 1
%30 = icmp eq i64 %29, %15
br i1 %30, label %31, label %16
31: ; preds = %28, %7
ret i32 0
}