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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/
update_section_tree_dot_file_with_section_edges(int /*<<< orphan*/ *,
                                                struct ct_section const *);
int /*<<< orphan*/
update_section_tree_dot_file_with_section_info(int /*<<< orphan*/ *,
                                               struct ct_section const *);
void compute_section_tree_dot_file(FILE *fout,
                                   const struct ct_section *section) {
  fprintf(fout, "digraph {\n");
  update_section_tree_dot_file_with_section_info(fout, section);
  update_section_tree_dot_file_with_section_edges(fout, section);
  fprintf(fout, "}\n");
}


x86 assembly (clang, -O0):
<compute_section_tree_dot_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <update_section_tree_dot_file_with_section_info@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <update_section_tree_dot_file_with_section_edges@plt>
mov    -0x8(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_section_tree_dot_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <update_section_tree_dot_file_with_section_info@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <update_section_tree_dot_file_with_section_edges@plt>
lea    0xe9b(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <fwrite@plt>

LLVM IR (-O0):
%struct.ct_section = type { i32 }
@.str = [11 x i8] c"digraph {\0A\00"
@.str.1 = [3 x i8] c"}\0A\00"
define void @compute_section_tree_dot_file(i32* %0, %struct.ct_section* %1) {
%3 = alloca i32*
%4 = alloca %struct.ct_section*
store i32* %0, i32** %3
store %struct.ct_section* %1, %struct.ct_section** %4
%5 = load i32*, i32** %3
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %3
%8 = load %struct.ct_section*, %struct.ct_section** %4
%9 = call i32 @update_section_tree_dot_file_with_section_info(i32* %7, %struct.ct_section* %8)
%10 = load i32*, i32** %3
%11 = load %struct.ct_section*, %struct.ct_section** %4
%12 = call i32 @update_section_tree_dot_file_with_section_edges(i32* %10, %struct.ct_section* %11)
%13 = load i32*, i32** %3
%14 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ct_section = type { i32 }
@.str = [11 x i8] c"digraph {\0A\00"
@.str.1 = [3 x i8] c"}\0A\00"
define void @compute_section_tree_dot_file(i32* %0, %struct.ct_section* %1) {
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 10, i64 1, i32* %0)
%4 = tail call i32 @update_section_tree_dot_file_with_section_info(i32* %0, %struct.ct_section* %1)
%5 = tail call i32 @update_section_tree_dot_file_with_section_edges(i32* %0, %struct.ct_section* %1)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 2, i64 1, i32* %0)
ret void
}