#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*/ printf(char *, char *, int, int);
int scanf(char *, ...);
void main(void) {
  char str[3];
  int i, d;
  d = scanf("%s %i", str, &i);
  printf("%s %i %i\n", str, i, d);
  d = scanf("%s %i", str, &i);
  printf("%s %i %i\n", str, i, d);
  d = scanf("%s %i", str, &i);
  printf("%s %i %i\n", str, i, d);
  d = scanf("%i", &i);
  printf("%s %i %i\n", str, i, d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x3(%rbp),%rsi
lea    0xecd(%rip),%rdi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    %eax,-0xc(%rbp)
lea    -0x3(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
lea    -0x3(%rbp),%rsi
lea    0xe9e(%rip),%rdi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    %eax,-0xc(%rbp)
lea    -0x3(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
lea    -0x3(%rbp),%rsi
lea    0xe6f(%rip),%rdi
lea    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    %eax,-0xc(%rbp)
lea    -0x3(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
lea    0xe47(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    %eax,-0xc(%rbp)
lea    -0x3(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%r12
lea    0x5(%rsp),%rbx
mov    %rsp,%r14
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    (%rsp),%edx
lea    0xeb5(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%ecx
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    (%rsp),%edx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%ecx
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    (%rsp),%edx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%ecx
call   1030 <printf@plt>
lea    0xe5e(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    (%rsp),%edx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %eax,%ecx
call   1030 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %i\00"
@.str.1 = [10 x i8] c"%s %i %i\0A\00"
@.str.2 = [3 x i8] c"%i\00"
define void @main() {
%1 = alloca [3 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4, i32* %2)
store i32 %5, i32* %3
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %6, i32 %7, i32 %8)
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %10, i32* %2)
store i32 %11, i32* %3
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %12, i32 %13, i32 %14)
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %16, i32* %2)
store i32 %17, i32* %3
%18 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %18, i32 %19, i32 %20)
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
store i32 %22, i32* %3
%23 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %23, i32 %24, i32 %25)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %i\00"
@.str.1 = [10 x i8] c"%s %i %i\0A\00"
@.str.2 = [3 x i8] c"%i\00"
define void @main() {
%1 = alloca [3 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 %6, i32 %5)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i32* %2)
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 %9, i32 %8)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i32* %2)
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 %12, i32 %11)
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 %15, i32 %14)
ret void
}