#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*/ printf(char *, char const *, char *);
void startElement(void *userData, const char *name, const char **atts) {
  int i;
  printf("start(%s)\n", name, userData);
  for (i = 0; atts[i]; i += 2) {
    char *key = atts[i + 0];
    char *val = atts[i + 1];
    printf(" * %s = %s\n", key, val);
  }
}


x86 assembly (clang, -O0):
<startElement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     119e <startElement+0x8e>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x1c(%rbp)
jmp    113f <startElement+0x2f>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startElement>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%rdx
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
test   %rsi,%rsi
je     1158 <startElement+0x48>
add    $0x10,%rbx
lea    0xed2(%rip),%r14
nopl   0x0(%rax)
mov    -0x8(%rbx),%rdx
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x10,%rbx
test   %rsi,%rsi
jne    1140 <startElement+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"start(%s)\0A\00"
@.str.1 = [12 x i8] c" * %s = %s\0A\00"
define void @startElement(i8* %0, i8* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%10 = load i8*, i8** %5
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
store i32 0, i32* %7
br label %13
13: ; preds = %36, %3
%14 = load i8**, i8*** %6
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8*, i8** %14, i64 %16
%18 = load i8*, i8** %17
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %39
20: ; preds = %13
%21 = load i8**, i8*** %6
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 0
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %21, i64 %24
%26 = load i8*, i8** %25
store i8* %26, i8** %8
%27 = load i8**, i8*** %6
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8*, i8** %27, i64 %30
%32 = load i8*, i8** %31
store i8* %32, i8** %9
%33 = load i8*, i8** %8
%34 = load i8*, i8** %9
%35 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %33, i8* %34)
br label %36
36: ; preds = %20
%37 = load i32, i32* %7
%38 = add nsw i32 %37, 2
store i32 %38, i32* %7
br label %13
39: ; preds = %13
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"start(%s)\0A\00"
@.str.1 = [12 x i8] c" * %s = %s\0A\00"
define void @startElement(i8* %0, i8* %1, i8** nocapture %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %18, label %7
7: ; preds = %3, %7
%8 = phi i64 [ %14, %7 ], [ 0, %3 ]
%9 = phi i8* [ %16, %7 ], [ %5, %3 ]
%10 = or i64 %8, 1
%11 = getelementptr inbounds i8*, i8** %2, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %9, i8* %12)
%14 = add nuw i64 %8, 2
%15 = getelementptr inbounds i8*, i8** %2, i64 %14
%16 = load i8*, i8** %15
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %7
18: ; preds = %7, %3
ret void
}