#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 *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main(void) {
  int i;
  float f;
  char c;
  char str[32];
  printf("i: ");
  scanf("%d", &i);
  printf("f: ");
  scanf("%f", &f);
  printf("c: ");
  scanf("%*c%c", &c);
  printf("str: ");
  scanf("%s", str);
  printf("i = %d, f = %f, c = %c, str = %s\n", i, f, c, str);
  printf("ex) 10 123 A ABC\n");
  scanf("%d %f %c %s", &i, &f, &c, str);
  printf("i = %d, f = %f, c = %c, str = %s\n", i, f, c, str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8e(%rip),%rdi
lea    -0xd(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsbl -0xd(%rbp),%edx
lea    -0x30(%rbp),%rcx
lea    0xe54(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%r8
lea    0xe68(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0xd(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsbl -0xd(%rbp),%edx
lea    -0x30(%rbp),%rcx
lea    0xe06(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    0xc(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
lea    0x8(%rsp),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe82(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe78(%rip),%rdi
lea    0x7(%rsp),%r12
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe68(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8b(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsbl 0x7(%rsp),%edx
lea    0xe37(%rip),%r13
mov    %r13,%rdi
mov    %rbx,%rcx
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe51(%rip),%rdi
call   1030 <puts@plt>
lea    0xe39(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsbl 0x7(%rsp),%edx
mov    %r13,%rdi
mov    %rbx,%rcx
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"i: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"f: \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [4 x i8] c"c: \00"
@.str.5 = [6 x i8] c"%*c%c\00"
@.str.6 = [6 x i8] c"str: \00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [34 x i8] c"i = %d, f = %f, c = %c, str = %s\0A\00"
@.str.9 = [18 x i8] c"ex) 10 123 A ABC\0A\00"
@.str.10 = [12 x i8] c"%d %f %c %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca i8
%5 = alloca [32 x i8]
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %4)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %13)
%15 = load i32, i32* %2
%16 = load float, float* %3
%17 = fpext float %16 to double
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), i32 %15, double %17, i32 %19, i8* %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%23 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i32* %2, float* %3, i8* %4, i8* %23)
%25 = load i32, i32* %2
%26 = load float, float* %3
%27 = fpext float %26 to double
%28 = load i8, i8* %4
%29 = sext i8 %28 to i32
%30 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), i32 %25, double %27, i32 %29, i8* %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"i: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"f: \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [4 x i8] c"c: \00"
@.str.5 = [6 x i8] c"%*c%c\00"
@.str.6 = [6 x i8] c"str: \00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [34 x i8] c"i = %d, f = %f, c = %c, str = %s\0A\00"
@.str.10 = [12 x i8] c"%d %f %c %s\00"
@str = [17 x i8] c"ex) 10 123 A ABC\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i8
%4 = alloca [32 x i8]
%5 = bitcast i32* %1 to i8*
%6 = bitcast float* %2 to i8*
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %7)
%16 = load i32, i32* %1
%17 = load float, float* %2
%18 = fpext float %17 to double
%19 = load i8, i8* %3
%20 = sext i8 %19 to i32
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), i32 %16, double %18, i32 %20, i8* %7)
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i32* %1, float* %2, i8* %3, i8* %7)
%24 = load i32, i32* %1
%25 = load float, float* %2
%26 = fpext float %25 to double
%27 = load i8, i8* %3
%28 = sext i8 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), i32 %24, double %26, i32 %28, i8* %7)
ret i32 0
}