#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 */
scalar_t__ fwrite(char *, int, int, int /*<<< orphan*/ *);
scalar_t__ writeFLVBool(int /*<<< orphan*/ *, int);
scalar_t__ writeFLVScriptDataString(int /*<<< orphan*/ *, char const *);
size_t writeFLVScriptDataValueBool(FILE *fp, const char *name, int value) {
  size_t datasize = 0;
  char type;
  if (name != NULL)
    datasize += writeFLVScriptDataString(fp, name);
  type = 1;
  datasize += fwrite(&type, 1, 1, fp);
  datasize += writeFLVBool(fp, value);
  return datasize;
}


x86 assembly (clang, -O0):
<writeFLVScriptDataValueBool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116b <writeFLVScriptDataValueBool+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <writeFLVScriptDataString@plt>
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
movb   $0x1,-0x21(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x21(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <fwrite@plt>
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <writeFLVBool@plt>
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeFLVScriptDataValueBool>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rdi,%rbx
test   %rsi,%rsi
je     114f <writeFLVScriptDataValueBool+0x1f>
mov    %rbx,%rdi
call   1050 <writeFLVScriptDataString@plt>
mov    %rax,%r15
jmp    1152 <writeFLVScriptDataValueBool+0x22>
xor    %r15d,%r15d
movb   $0x1,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rax,%rbp
add    %r15,%rbp
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <writeFLVBool@plt>
add    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @writeFLVScriptDataValueBool(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i64 0, i64* %7
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i8*, i8** %5
%14 = call i64 @writeFLVScriptDataString(i32* %12, i8* %13)
%15 = load i64, i64* %7
%16 = add i64 %15, %14
store i64 %16, i64* %7
br label %17
17: ; preds = %11, %3
store i8 1, i8* %8
%18 = load i32*, i32** %4
%19 = call i64 @fwrite(i8* %8, i32 1, i32 1, i32* %18)
%20 = load i64, i64* %7
%21 = add i64 %20, %19
store i64 %21, i64* %7
%22 = load i32*, i32** %4
%23 = load i32, i32* %6
%24 = call i64 @writeFLVBool(i32* %22, i32 %23)
%25 = load i64, i64* %7
%26 = add i64 %25, %24
store i64 %26, i64* %7
%27 = load i64, i64* %7
ret i64 %27
}

LLVM IR (-O2):
define i64 @writeFLVScriptDataValueBool(i32* %0, i8* %1, i32 %2) {
%4 = alloca i8
%5 = icmp eq i8* %1, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i64 @writeFLVScriptDataString(i32* %0, i8* %1)
br label %8
8: ; preds = %6, %3
%9 = phi i64 [ %7, %6 ], [ 0, %3 ]
store i8 1, i8* %4
%10 = call i64 @fwrite(i8* %4, i32 1, i32 1, i32* %0)
%11 = add i64 %10, %9
%12 = tail call i64 @writeFLVBool(i32* %0, i32 %2)
%13 = add i64 %11, %12
ret i64 %13
}