#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 */
struct ValueType {
  int dummy;
};
struct ParseState {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ PlatformErrorPrefix(struct ParseState *);
int /*<<< orphan*/ PlatformPrintf(char const *, ...);
int /*<<< orphan*/ ProgramFail(int /*<<< orphan*/, char *);
void AssignFail(struct ParseState *Parser, const char *Format,
                struct ValueType *Type1, struct ValueType *Type2, int Num1,
                int Num2, const char *FuncName, int ParamNo) {
  PlatformErrorPrefix(Parser);
  PlatformPrintf("can't %s ", (FuncName == 0) ? "assign" : "set");
  if (Type1 != 0)
    PlatformPrintf(Format, Type1, Type2);
  else
    PlatformPrintf(Format, Num1, Num2);
  if (FuncName != 0)
    PlatformPrintf(" in argument %d of call to %s()", ParamNo, FuncName);
  ProgramFail(0, "");
}


x86 assembly (clang, -O0):
<AssignFail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <PlatformErrorPrefix@plt>
mov    0x10(%rbp),%rcx
lea    0xea6(%rip),%rsi
lea    0xe98(%rip),%rax
cmp    $0x0,%rcx
cmove  %rax,%rsi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1050 <PlatformPrintf@plt>
cmpq   $0x0,-0x18(%rbp)
je     11ab <AssignFail+0x7b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1050 <PlatformPrintf@plt>
jmp    11bc <AssignFail+0x8c>
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    $0x0,%al
call   1050 <PlatformPrintf@plt>
cmpq   $0x0,0x10(%rbp)
je     11dc <AssignFail+0xac>
mov    0x18(%rbp),%esi
mov    0x10(%rbp),%rdx
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1050 <PlatformPrintf@plt>
xor    %edi,%edi
lea    0xe24(%rip),%rsi
call   1040 <ProgramFail@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AssignFail>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r15d
mov    %r8d,%r13d
mov    %rcx,%r12
mov    %rdx,%r14
mov    %rsi,%rbp
mov    0x48(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    0x40(%rsp),%rbx
call   1030 <PlatformErrorPrefix@plt>
test   %rbx,%rbx
lea    0xea4(%rip),%rax
lea    0xea4(%rip),%rsi
cmove  %rax,%rsi
lea    0xe88(%rip),%rdi
xor    %eax,%eax
call   1050 <PlatformPrintf@plt>
mov    %rbp,%rdi
test   %r14,%r14
je     11ca <AssignFail+0x9a>
mov    %r14,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1050 <PlatformPrintf@plt>
test   %rbx,%rbx
je     11ae <AssignFail+0x7e>
lea    0xe75(%rip),%rdi
mov    0x4(%rsp),%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <PlatformPrintf@plt>
lea    0xe54(%rip),%rsi
xor    %edi,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <ProgramFail@plt>
mov    %r13d,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1050 <PlatformPrintf@plt>
test   %rbx,%rbx
jne    1199 <AssignFail+0x69>
jmp    11ae <AssignFail+0x7e>

LLVM IR (-O0):
%struct.ParseState = type { i32 }
%struct.ValueType = type { i32 }
@.str = [10 x i8] c"can't %s \00"
@.str.1 = [7 x i8] c"assign\00"
@.str.2 = [4 x i8] c"set\00"
@.str.3 = [32 x i8] c" in argument %d of call to %s()\00"
@.str.4 = [1 x i8] zeroinitializer
define void @AssignFail(%struct.ParseState* %0, i8* %1, %struct.ValueType* %2, %struct.ValueType* %3, i32 %4, i32 %5, i8* %6, i32 %7) {
%9 = alloca %struct.ParseState*
%10 = alloca i8*
%11 = alloca %struct.ValueType*
%12 = alloca %struct.ValueType*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i32
store %struct.ParseState* %0, %struct.ParseState** %9
store i8* %1, i8** %10
store %struct.ValueType* %2, %struct.ValueType** %11
store %struct.ValueType* %3, %struct.ValueType** %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i8* %6, i8** %15
store i32 %7, i32* %16
%17 = load %struct.ParseState*, %struct.ParseState** %9
%18 = call i32 @PlatformErrorPrefix(%struct.ParseState* %17)
%19 = load i8*, i8** %15
%20 = icmp eq i8* %19, null
%21 = zext i1 %20 to i64
%22 = select i1 %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%23 = call i32 (i8*, ...) @PlatformPrintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = load %struct.ValueType*, %struct.ValueType** %11
%25 = icmp ne %struct.ValueType* %24, null
br i1 %25, label %26, label %31
26: ; preds = %8
%27 = load i8*, i8** %10
%28 = load %struct.ValueType*, %struct.ValueType** %11
%29 = load %struct.ValueType*, %struct.ValueType** %12
%30 = call i32 (i8*, ...) @PlatformPrintf(i8* %27, %struct.ValueType* %28, %struct.ValueType* %29)
br label %36
31: ; preds = %8
%32 = load i8*, i8** %10
%33 = load i32, i32* %13
%34 = load i32, i32* %14
%35 = call i32 (i8*, ...) @PlatformPrintf(i8* %32, i32 %33, i32 %34)
br label %36
36: ; preds = %31, %26
%37 = load i8*, i8** %15
%38 = icmp ne i8* %37, null
br i1 %38, label %39, label %43
39: ; preds = %36
%40 = load i32, i32* %16
%41 = load i8*, i8** %15
%42 = call i32 (i8*, ...) @PlatformPrintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %40, i8* %41)
br label %43
43: ; preds = %39, %36
%44 = call i32 @ProgramFail(i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ParseState = type { i32 }
%struct.ValueType = type { i32 }
@.str = [10 x i8] c"can't %s \00"
@.str.1 = [7 x i8] c"assign\00"
@.str.2 = [4 x i8] c"set\00"
@.str.3 = [32 x i8] c" in argument %d of call to %s()\00"
@.str.4 = [1 x i8] zeroinitializer
define void @AssignFail(%struct.ParseState* %0, i8* %1, %struct.ValueType* %2, %struct.ValueType* %3, i32 %4, i32 %5, i8* %6, i32 %7) {
%9 = tail call i32 @PlatformErrorPrefix(%struct.ParseState* %0)
%10 = icmp eq i8* %6, null
%11 = select i1 %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%12 = tail call i32 (i8*, ...) @PlatformPrintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = icmp eq %struct.ValueType* %2, null
br i1 %13, label %16, label %14
14: ; preds = %8
%15 = tail call i32 (i8*, ...) @PlatformPrintf(i8* %1, %struct.ValueType* %2, %struct.ValueType* %3)
br label %18
16: ; preds = %8
%17 = tail call i32 (i8*, ...) @PlatformPrintf(i8* %1, i32 %4, i32 %5)
br label %18
18: ; preds = %16, %14
br i1 %10, label %21, label %19
19: ; preds = %18
%20 = tail call i32 (i8*, ...) @PlatformPrintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %7, i8* %6)
br label %21
21: ; preds = %19, %18
%22 = tail call i32 @ProgramFail(i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0))
ret void
}