#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*/ fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, int, char *);
int /*<<< orphan*/ *stdin;
int main() {
  FILE *ifp = stdin;
  int t;
  fscanf(ifp, "%d", &t);
  int i;
  for (i = 0; i < t; i++) {
    char s[50];
    fscanf(ifp, "%s", &s);
    printf("Word #%d: How do you %s?\n", i + 1, s);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11a0 <main+0x80>
mov    -0x10(%rbp),%rdi
lea    0xe92(%rip),%rsi
lea    -0x50(%rbp),%rdx
mov    $0x0,%al
call   1040 <fscanf@plt>
mov    -0x18(%rbp),%esi
add    $0x1,%esi
lea    -0x50(%rbp),%rdx
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115a <main+0x3a>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x50,%rsp
mov    0x2eb5(%rip),%rax
mov    (%rax),%r15
lea    0xec3(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <fscanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1196 <main+0x76>
lea    0xea9(%rip),%r14
lea    0x10(%rsp),%rbx
lea    0xea0(%rip),%r12
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <fscanf@plt>
add    $0x1,%ebp
mov    %r12,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
cmp    0xc(%rsp),%ebp
jl     1170 <main+0x50>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdin = global i32* null
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [26 x i8] c"Word #%d: How do you %s?\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [50 x i8]
store i32 0, i32* %1
%6 = load i32*, i32** @stdin
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = call i32 (i32*, i8*, ...) @fscanf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 0, i32* %4
br label %9
9: ; preds = %20, %0
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %9
%14 = load i32*, i32** %2
%15 = call i32 (i32*, i8*, ...) @fscanf(i32* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [50 x i8]* %5)
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
%18 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%19 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %17, i8* %18)
br label %20
20: ; preds = %13
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %9
23: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32* null
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [26 x i8] c"Word #%d: How do you %s?\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = load i32*, i32** @stdin
%4 = bitcast i32* %1 to i8*
%5 = call i32 (i32*, i8*, ...) @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %0
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
br label %10
10: ; preds = %8, %10
%11 = phi i32 [ 0, %8 ], [ %13, %10 ]
%12 = call i32 (i32*, i8*, ...) @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [50 x i8]* %2)
%13 = add nuw nsw i32 %11, 1
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %13, i8* %9)
%15 = load i32, i32* %1
%16 = icmp slt i32 %13, %15
br i1 %16, label %10, label %17
17: ; preds = %10, %0
ret i32 0
}