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


x86 assembly (clang, -O0):
<WriteKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    -0x18(%rbp),%rcx
lea    0xe9c(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%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,%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    -0x18(%rbp),%rcx
lea    0xe62(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <fwrite@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteKey>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1050 <fwrite@plt>
mov    $0x3d,%edi
mov    %r15,%rsi
call   1040 <fputc@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x1,%edx
mov    %r15,%rcx
call   1050 <fwrite@plt>
mov    $0xa,%edi
mov    %r15,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fputc@plt>

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

LLVM IR (-O2):
define void @WriteKey(i8* %0, i8* %1, i32* nocapture %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @fwrite(i8* %0, i32 %4, i32 1, i32* %2)
%6 = tail call i32 @fputc(i32 61, i32* %2)
%7 = tail call i32 @strlen(i8* %1)
%8 = tail call i32 @fwrite(i8* %1, i32 %7, i32 1, i32* %2)
%9 = tail call i32 @fputc(i32 10, i32* %2)
ret void
}