#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*/ WriteKey(char const *, char const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char const *, int, int, int /*<<< orphan*/ *);
int strlen(char const *);
void InsertSectionKey(const char *section, const char *var,
                      const char *var_name, FILE *file, const int saut) {
  if (saut)
    fwrite("\n", 1, 1, file);
  fwrite("[", 1, 1, file);
  fwrite(section, strlen(section), 1, file);
  fwrite("]\n", 2, 1, file);
  WriteKey(var, var_name, file);
}


x86 assembly (clang, -O0):
<InsertSectionKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     116d <InsertSectionKey+0x3d>
mov    -0x20(%rbp),%rcx
lea    0xea2(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rcx
lea    0xe88(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1050 <fwrite@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rcx
lea    0xe4e(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <WriteKey@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InsertSectionKey>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
test   %r8d,%r8d
je     1166 <InsertSectionKey+0x26>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
mov    $0x5b,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %r12,%rdi
mov    %eax,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
lea    0xe6c(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <WriteKey@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [2 x i8] c"[\00"
@.str.2 = [3 x i8] c"]\0A\00"
define void @InsertSectionKey(i8* %0, i8* %1, i8* %2, i32* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %5
%14 = load i32*, i32** %9
%15 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32* %14)
br label %16
16: ; preds = %13, %5
%17 = load i32*, i32** %9
%18 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 1, i32* %17)
%19 = load i8*, i8** %6
%20 = load i8*, i8** %6
%21 = call i32 @strlen(i8* %20)
%22 = load i32*, i32** %9
%23 = call i32 @fwrite(i8* %19, i32 %21, i32 1, i32* %22)
%24 = load i32*, i32** %9
%25 = call i32 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 1, i32* %24)
%26 = load i8*, i8** %7
%27 = load i8*, i8** %8
%28 = load i32*, i32** %9
%29 = call i32 @WriteKey(i8* %26, i8* %27, i32* %28)
ret void
}

LLVM IR (-O2):
@.str.2 = [3 x i8] c"]\0A\00"
define void @InsertSectionKey(i8* %0, i8* %1, i8* %2, i32* %3, i32 %4) {
%6 = icmp eq i32 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @fputc(i32 10, i32* %3)
br label %9
9: ; preds = %7, %5
%10 = tail call i32 @fputc(i32 91, i32* %3)
%11 = tail call i32 @strlen(i8* %0)
%12 = tail call i32 @fwrite(i8* %0, i32 %11, i32 1, i32* %3)
%13 = tail call i32 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 1, i32* %3)
%14 = tail call i32 @WriteKey(i8* %1, i8* %2, i32* %3)
ret void
}