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

/* Variables and functions */
int /*<<< orphan*/ SDP_StrLCat(char *, char const *, int);
int _CheckForMissingField(char *missing_fields, const char *field,
                          const char *field_name) {
  if (field && *field)
    return 1;
  if (*missing_fields)
    SDP_StrLCat(missing_fields, ", ", sizeof(missing_fields));
  SDP_StrLCat(missing_fields, field_name, sizeof(missing_fields));
  return 0;
}


x86 assembly (clang, -O0):
<_CheckForMissingField>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114b <_CheckForMissingField+0x3b>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114b <_CheckForMissingField+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1186 <_CheckForMissingField+0x76>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116d <_CheckForMissingField+0x5d>
mov    -0x10(%rbp),%rdi
lea    0xe9d(%rip),%rsi
mov    $0x8,%edx
call   1030 <SDP_StrLCat@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   1030 <SDP_StrLCat@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_CheckForMissingField>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
test   %rsi,%rsi
je     1129 <_CheckForMissingField+0x19>
mov    $0x1,%eax
cmpb   $0x0,(%rsi)
jne    1154 <_CheckForMissingField+0x44>
cmpb   $0x0,(%rbx)
je     1142 <_CheckForMissingField+0x32>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <SDP_StrLCat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1030 <SDP_StrLCat@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c", \00"
define i32 @_CheckForMissingField(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i8*, i8** %6
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 1, i32* %4
br label %27
16: ; preds = %10, %3
%17 = load i8*, i8** %5
%18 = load i8, i8* %17
%19 = icmp ne i8 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i8*, i8** %5
%22 = call i32 @SDP_StrLCat(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 8)
br label %23
23: ; preds = %20, %16
%24 = load i8*, i8** %5
%25 = load i8*, i8** %7
%26 = call i32 @SDP_StrLCat(i8* %24, i8* %25, i32 8)
store i32 0, i32* %4
br label %27
27: ; preds = %23, %15
%28 = load i32, i32* %4
ret i32 %28
}

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