#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 EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void dbl_spacing(FILE *in, FILE *out) {
  int ch;
  while ((ch = fgetc(in)) != EOF) {
    fputc(ch, out);
    if (ch == ' ')
      fputs("   ", out);
  }
}


x86 assembly (clang, -O0):
<dbl_spacing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%eax
je     1186 <dbl_spacing+0x56>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <fputc@plt>
cmpl   $0x20,-0x14(%rbp)
jne    1181 <dbl_spacing+0x51>
mov    -0x10(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1030 <fputs@plt>
jmp    1140 <dbl_spacing+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_spacing>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <fgetc@plt>
mov    0x2e9e(%rip),%r12
cmp    (%r12),%eax
jne    1159 <dbl_spacing+0x29>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%ebp
lea    0xe9e(%rip),%r15
jmp    1180 <dbl_spacing+0x50>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
cmp    (%r12),%eax
je     1150 <dbl_spacing+0x20>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
cmp    $0x20,%ebp
jne    1170 <dbl_spacing+0x40>
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %rbx,%rcx
call   1050 <fwrite@plt>
jmp    1170 <dbl_spacing+0x40>

LLVM IR (-O0):
@EOF = global i32 0
@.str = [4 x i8] c" \00"
define void @dbl_spacing(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %20, %2
%7 = load i32*, i32** %3
%8 = call i32 @fgetc(i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load i32, i32* %5
%13 = load i32*, i32** %4
%14 = call i32 @fputc(i32 %12, i32* %13)
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 32
br i1 %16, label %17, label %20
17: ; preds = %11
%18 = load i32*, i32** %4
%19 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %18)
br label %20
20: ; preds = %17, %11
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c" \00"
define void @dbl_spacing(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %16, label %6
6: ; preds = %2, %12
%7 = phi i32 [ %13, %12 ], [ %3, %2 ]
%8 = tail call i32 @fputc(i32 %7, i32* %1)
%9 = icmp eq i32 %7, 32
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %1)
br label %12
12: ; preds = %10, %6
%13 = tail call i32 @fgetc(i32* %0)
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %6
16: ; preds = %12, %2
ret void
}