#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 ic_kludge {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
unsigned int ic_b2c_compile_entry(struct ic_kludge *kludge, FILE *f) {
  if (!kludge) {
    puts("ic_b2c_compile_entry: kludge was null");
    return 0;
  }
  if (!f) {
    puts("ic_b2c_compile_entry: file was null");
    return 0;
  }
  fputs("#include \"backends/2c/entry.c\"\n", f);
  return 1;
}


x86 assembly (clang, -O0):
<ic_b2c_compile_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <ic_b2c_compile_entry+0x33>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    118d <ic_b2c_compile_entry+0x6d>
cmpq   $0x0,-0x18(%rbp)
jne    1176 <ic_b2c_compile_entry+0x56>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    118d <ic_b2c_compile_entry+0x6d>
mov    -0x18(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <fputs@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ic_b2c_compile_entry>:
push   %rax
test   %rdi,%rdi
je     114b <ic_b2c_compile_entry+0x2b>
mov    %rsi,%rcx
test   %rsi,%rsi
je     1154 <ic_b2c_compile_entry+0x34>
lea    0xf15(%rip),%rdi
mov    $0x1f,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    $0x1,%eax
pop    %rcx
ret
lea    0xeae(%rip),%rdi
jmp    115b <ic_b2c_compile_entry+0x3b>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ic_kludge = type { i32 }
@.str = [38 x i8] c"ic_b2c_compile_entry: kludge was null\00"
@.str.1 = [36 x i8] c"ic_b2c_compile_entry: file was null\00"
@.str.2 = [32 x i8] c"#include \22backends/2c/entry.c\22\0A\00"
define i32 @ic_b2c_compile_entry(%struct.ic_kludge* %0, i32* %1) {
%3 = alloca i32
%4 = alloca %struct.ic_kludge*
%5 = alloca i32*
store %struct.ic_kludge* %0, %struct.ic_kludge** %4
store i32* %1, i32** %5
%6 = load %struct.ic_kludge*, %struct.ic_kludge** %4
%7 = icmp ne %struct.ic_kludge* %6, null
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 @puts(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %18
10: ; preds = %2
%11 = load i32*, i32** %5
%12 = icmp ne i32* %11, null
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %18
15: ; preds = %10
%16 = load i32*, i32** %5
%17 = call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32* %16)
store i32 1, i32* %3
br label %18
18: ; preds = %15, %13, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.ic_kludge = type { i32 }
@.str = [38 x i8] c"ic_b2c_compile_entry: kludge was null\00"
@.str.1 = [36 x i8] c"ic_b2c_compile_entry: file was null\00"
@.str.2 = [32 x i8] c"#include \22backends/2c/entry.c\22\0A\00"
define i32 @ic_b2c_compile_entry(%struct.ic_kludge* readnone %0, i32* %1) {
%3 = icmp eq %struct.ic_kludge* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %12
6: ; preds = %2
%7 = icmp eq i32* %1, null
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
br label %12
10: ; preds = %6
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i64 31, i64 1, i32* %1)
br label %12
12: ; preds = %10, %8, %4
%13 = phi i32 [ 1, %10 ], [ 0, %8 ], [ 0, %4 ]
ret i32 %13
}