#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 age;
  char c;
  double income;
  printf("input age:\n");
  scanf("%d", &age);
  scanf("%*[^\n]");
  scanf("%*c");
  printf("input c:\n");
  scanf("%c", &c);
  scanf("%*[^\n]");
  scanf("%*c");
  printf("input income:\n");
  scanf("%lf", &income);
  printf("你的年龄是%d, %s, %g\n", age, c == 'f' ? "女" : "男", income);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7a(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
movsbl -0x9(%rbp),%ecx
lea    0xe84(%rip),%rdx
lea    0xe79(%rip),%rax
cmp    $0x66,%ecx
cmove  %rax,%rdx
movsd  -0x18(%rbp),%xmm0
lea    0xe4b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xea6(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe9c(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
lea    0xe83(%rip),%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe53(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
cmpb   $0x66,0xb(%rsp)
lea    0xe56(%rip),%rax
lea    0xe53(%rip),%rdx
cmove  %rax,%rdx
movsd  0x10(%rsp),%xmm0
lea    0xe23(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"input age:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"%*[^\0A]\00"
@.str.3 = [4 x i8] c"%*c\00"
@.str.4 = [10 x i8] c"input c:\0A\00"
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [15 x i8] c"input income:\0A\00"
@.str.7 = [4 x i8] c"%lf\00"
@.str.8 = [27 x i8] c"\E4\BD\A0\E7\9A\84\E5\B9\B4\E9\BE\84\E6\98\AF%d, %s, %g\0A\00"
@.str.9 = [4 x i8] c"\E5\A5\B3\00"
@.str.10 = [4 x i8] c"\E7\94\B7\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %3)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), double* %4)
%15 = load i32, i32* %2
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 102
%19 = zext i1 %18 to i64
%20 = select i1 %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0)
%21 = load double, double* %4
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i32 %15, i8* %20, double %21)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"%*[^\0A]\00"
@.str.3 = [4 x i8] c"%*c\00"
@.str.5 = [3 x i8] c"%c\00"
@.str.7 = [4 x i8] c"%lf\00"
@.str.8 = [27 x i8] c"\E4\BD\A0\E7\9A\84\E5\B9\B4\E9\BE\84\E6\98\AF%d, %s, %g\0A\00"
@.str.9 = [4 x i8] c"\E5\A5\B3\00"
@.str.10 = [4 x i8] c"\E7\94\B7\00"
@str = [11 x i8] c"input age:\00"
@str.11 = [9 x i8] c"input c:\00"
@str.12 = [14 x i8] c"input income:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca double
%4 = bitcast i32* %1 to i8*
%5 = bitcast double* %3 to i8*
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 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* %1)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.11, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.12, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), double* %3)
%16 = load i32, i32* %1
%17 = load i8, i8* %2
%18 = icmp eq i8 %17, 102
%19 = select i1 %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0)
%20 = load double, double* %3
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i32 %16, i8* %19, double %20)
ret i32 0
}