#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*/ add_zccopt(char *, ...);
void write_zcc_defined(char *name, int value) {
  add_zccopt("\nIF !DEFINED_%s\n", name);
  add_zccopt("\tdefc\tDEFINED_%s = 1\n", name);
  add_zccopt("\tdefc %s = %d\n", name, value);
  add_zccopt("ENDIF\n\n");
}


x86 assembly (clang, -O0):
<write_zcc_defined>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <add_zccopt@plt>
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <add_zccopt@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <add_zccopt@plt>
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <add_zccopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_zcc_defined>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xee1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <add_zccopt@plt>
lea    0xee1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <add_zccopt@plt>
lea    0xee6(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <add_zccopt@plt>
lea    0xee2(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <add_zccopt@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\0AIF !DEFINED_%s\0A\00"
@.str.1 = [22 x i8] c"\09defc\09DEFINED_%s = 1\0A\00"
@.str.2 = [15 x i8] c"\09defc %s = %d\0A\00"
@.str.3 = [8 x i8] c"ENDIF\0A\0A\00"
define void @write_zcc_defined(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @add_zccopt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 (i8*, ...) @add_zccopt(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 (i8*, ...) @add_zccopt(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %9, i32 %10)
%12 = call i32 (i8*, ...) @add_zccopt(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0AIF !DEFINED_%s\0A\00"
@.str.1 = [22 x i8] c"\09defc\09DEFINED_%s = 1\0A\00"
@.str.2 = [15 x i8] c"\09defc %s = %d\0A\00"
@.str.3 = [8 x i8] c"ENDIF\0A\0A\00"
define void @write_zcc_defined(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @add_zccopt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @add_zccopt(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 (i8*, ...) @add_zccopt(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %0, i32 %1)
%6 = tail call i32 (i8*, ...) @add_zccopt(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
ret void
}