#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 *, int);
int /*<<< orphan*/ qContentType(char *);
int strlen(char *);
int qArgPrint(char **qlist) {
  char **qp;
  int amount;
  qContentType("text/html");
  for (amount = 0, qp = qlist; *qp; amount++, qp++) {
    printf("'%s' (%d bytes)<br>\n", *qp, strlen(*qp));
  }
  return amount;
}


x86 assembly (clang, -O0):
<qArgPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1050 <qContentType@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     11a8 <qArgPrint+0x78>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1157 <qArgPrint+0x27>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qArgPrint>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xebe(%rip),%rdi
call   1050 <qContentType@plt>
mov    (%r14),%r15
xor    %ebx,%ebx
test   %r15,%r15
je     1183 <qArgPrint+0x53>
lea    0xeb2(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
mov    0x8(%r14,%rbx,8),%r15
add    $0x1,%rbx
test   %r15,%r15
jne    1160 <qArgPrint+0x30>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"text/html\00"
@.str.1 = [21 x i8] c"'%s' (%d bytes)<br>\0A\00"
define i32 @qArgPrint(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %2
%5 = call i32 @qContentType(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
%6 = load i8**, i8*** %2
store i8** %6, i8*** %3
br label %7
7: ; preds = %18, %1
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = call i32 @strlen(i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %13, i32 %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
%21 = load i8**, i8*** %3
%22 = getelementptr inbounds i8*, i8** %21, i32 1
store i8** %22, i8*** %3
br label %7
23: ; preds = %7
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
@.str = [10 x i8] c"text/html\00"
@.str.1 = [21 x i8] c"'%s' (%d bytes)<br>\0A\00"
define i32 @qArgPrint(i8** nocapture %0) {
%2 = tail call i32 @qContentType(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %15, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %13, %5 ], [ %3, %1 ]
%7 = phi i32 [ %11, %5 ], [ 0, %1 ]
%8 = phi i8** [ %12, %5 ], [ %0, %1 ]
%9 = tail call i32 @strlen(i8* %6)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %6, i32 %9)
%11 = add nuw nsw i32 %7, 1
%12 = getelementptr inbounds i8*, i8** %8, i64 1
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %5
15: ; preds = %5, %1
%16 = phi i32 [ 0, %1 ], [ %11, %5 ]
ret i32 %16
}