#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 */

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(void) {
  int i;
  for (i = 0; i < 42; i++) {
    fputs("test_fputs\n", stdout);
    fputs("test_fputs  ", stdout);
    fputs("test_fputs  ", stdout);
    fputs("test_fputs\n", stdout);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2a,-0x8(%rbp)
jge    1192 <main+0x82>
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xec0(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
lea    0xeb7(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%esi
lea    0xea2(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
lea    0xe81(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x2a,%ebp
mov    0x2ebd(%rip),%rbx
lea    0xed6(%rip),%r14
lea    0xedb(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    %r15,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    %r15,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <fputs@plt>
add    $0xffffffff,%ebp
jne    1140 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"test_fputs\0A\00"
@stdout = global i32 0
@.str.1 = [13 x i8] c"test_fputs \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %15, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 42
br i1 %5, label %6, label %18
6: ; preds = %3
%7 = load i32, i32* @stdout
%8 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @stdout
%14 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %6
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %3
18: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"test_fputs\0A\00"
@stdout = global i32 0
@.str.1 = [13 x i8] c"test_fputs \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %11, %1 ]
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fputs(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* @stdout
%10 = tail call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i32 %2, 1
%12 = icmp eq i32 %11, 42
br i1 %12, label %13, label %1
13: ; preds = %1
ret i32 0
}