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

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int /*<<< orphan*/,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char *);
void KAPI_save_as_header_String(FILE *fp, char *pch) {
  FILE *fpTmp = fp;
  fwrite("NULL/*", sizeof(char), strlen("NULL/*"), fp);
  fwrite(pch, sizeof(char), strlen(pch), fp);
  fwrite("*/", sizeof(char), strlen("*/"), fp);
}


x86 assembly (clang, -O0):
<KAPI_save_as_header_String>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xec1(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
lea    0xeaf(%rip),%rdi
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
lea    0xe80(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rcx
lea    0xe6e(%rip),%rdi
mov    $0x1,%esi
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KAPI_save_as_header_String>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xece(%rip),%r15
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %r15,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xe9a(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"NULL/*\00"
@.str.1 = [3 x i8] c"*/\00"
define void @KAPI_save_as_header_String(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32*
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i32*, i32** %3
store i32* %6, i32** %5
%7 = call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %3
%9 = call i32 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1, i32 %7, i32* %8)
%10 = load i8*, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @strlen(i8* %11)
%13 = load i32*, i32** %3
%14 = call i32 @fwrite(i8* %10, i32 1, i32 %12, i32* %13)
%15 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32*, i32** %3
%17 = call i32 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %15, i32* %16)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"NULL/*\00"
@.str.1 = [3 x i8] c"*/\00"
define void @KAPI_save_as_header_String(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1, i32 %3, i32* %0)
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @fwrite(i8* %1, i32 1, i32 %5, i32* %0)
%7 = tail call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %7, i32* %0)
ret void
}