#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*/ testPrintError(char *, char const *, ...);
void argError(void *aData, const char *zType, int sz, const char *zArg) {
  struct Entry {
    const char *zName;
  };
  struct Entry *pEntry;
  const char *zPrev = 0;
  testPrintError("unrecognized %s \"%s\": must be ", zType, zArg);
  for (pEntry = (struct Entry *)aData; pEntry->zName;
       pEntry = (struct Entry *)&((unsigned char *)pEntry)[sz]) {
    if (zPrev) {
      testPrintError("%s, ", zPrev);
    }
    zPrev = pEntry->zName;
  }
  testPrintError("or %s\n", zPrev);
}


x86 assembly (clang, -O0):
<argError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <testPrintError@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmpq   $0x0,(%rax)
je     1197 <argError+0x87>
cmpq   $0x0,-0x30(%rbp)
je     1178 <argError+0x68>
mov    -0x30(%rbp),%rsi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <testPrintError@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    114d <argError+0x3d>
mov    -0x30(%rbp),%rsi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <testPrintError@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argError>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
lea    0xedd(%rip),%rdi
xor    %r14d,%r14d
mov    %rcx,%rdx
xor    %eax,%eax
call   1030 <testPrintError@plt>
mov    (%rbx),%rax
test   %rax,%rax
je     1176 <argError+0x66>
movslq %ebp,%rbp
lea    0xedd(%rip),%r15
xor    %r14d,%r14d
jmp    115f <argError+0x4f>
nopw   0x0(%rax,%rax,1)
mov    %rax,%r14
mov    (%rbx,%rbp,1),%rax
add    %rbp,%rbx
test   %rax,%rax
je     1176 <argError+0x66>
test   %r14,%r14
je     1150 <argError+0x40>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <testPrintError@plt>
mov    (%rbx),%rax
jmp    1150 <argError+0x40>
lea    0xea7(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <testPrintError@plt>

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

LLVM IR (-O2):
@.str = [31 x i8] c"unrecognized %s \22%s\22: must be \00"
@.str.1 = [5 x i8] c"%s, \00"
@.str.2 = [7 x i8] c"or %s\0A\00"
define void @argError(i8* nocapture %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 (i8*, i8*, ...) @testPrintError(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3)
%6 = bitcast i8* %0 to i8**
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %26, label %9
9: ; preds = %4
%10 = sext i32 %2 to i64
br label %11
11: ; preds = %9, %20
%12 = phi i8* [ %7, %9 ], [ %24, %20 ]
%13 = phi i8** [ %6, %9 ], [ %23, %20 ]
%14 = phi i8* [ null, %9 ], [ %21, %20 ]
%15 = bitcast i8** %13 to i8*
%16 = icmp eq i8* %14, null
br i1 %16, label %20, label %17
17: ; preds = %11
%18 = tail call i32 (i8*, i8*, ...) @testPrintError(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%19 = load i8*, i8** %13
br label %20
20: ; preds = %17, %11
%21 = phi i8* [ %19, %17 ], [ %12, %11 ]
%22 = getelementptr inbounds i8, i8* %15, i64 %10
%23 = bitcast i8* %22 to i8**
%24 = load i8*, i8** %23
%25 = icmp eq i8* %24, null
br i1 %25, label %26, label %11
26: ; preds = %20, %4
%27 = phi i8* [ null, %4 ], [ %21, %20 ]
%28 = tail call i32 (i8*, i8*, ...) @testPrintError(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %27)
ret void
}