#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*/ sscanf(char *, char *, ...);
int main(void) {
  char tokenstring[] = "15 12 14...";
  char s[81];
  char c;
  int i;
  float fp;
  sscanf(tokenstring, "%80s", s);
  sscanf(tokenstring, "%c", &c);
  sscanf(tokenstring, "%d", &i);
  sscanf(tokenstring, "%f", &fp);
  printf("String    = %s\n", s);
  printf("Character = %c\n", c);
  printf("Integer:  = %d\n", i);
  printf("Real:     = %f\n", fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x60(%rbp),%rdx
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1040 <sscanf@plt>
lea    -0xc(%rbp),%rdi
lea    0xeb4(%rip),%rsi
lea    -0x61(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
lea    -0xc(%rbp),%rdi
lea    0xea1(%rip),%rsi
lea    -0x68(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
lea    -0xc(%rbp),%rdi
lea    0xe8e(%rip),%rsi
lea    -0x6c(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x61(%rbp),%esi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x6c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe71(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
movabs $0x3431203231203531,%rax
20 31 34
mov    %rax,0x10(%rsp)
movl   $0x2e2e2e,0x18(%rsp)
lea    0xec7(%rip),%rsi
lea    0x10(%rsp),%rbx
lea    0x20(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <sscanf@plt>
lea    0xeae(%rip),%rsi
lea    0x7(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sscanf@plt>
lea    0xe9b(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sscanf@plt>
lea    0xe88(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sscanf@plt>
lea    0xe75(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movsbl 0x7(%rsp),%esi
lea    0xe6f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe65(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.tokenstring = [12 x i8] c"15 12 14...\00"
@.str = [5 x i8] c"%80s\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [16 x i8] c"String = %s\0A\00"
@.str.5 = [16 x i8] c"Character = %c\0A\00"
@.str.6 = [16 x i8] c"Integer: = %d\0A\00"
@.str.7 = [16 x i8] c"Real: = %f\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = alloca [81 x i8]
%3 = alloca i8
%4 = alloca i32
%5 = alloca float
%6 = bitcast [12 x i8]* %1 to i8*
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%9 = call i32 (i8*, i8*, ...) @sscanf(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%11 = call i32 (i8*, i8*, ...) @sscanf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%12 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%13 = call i32 (i8*, i8*, ...) @sscanf(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%14 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%15 = call i32 (i8*, i8*, ...) @sscanf(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %5)
%16 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %16)
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %4
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %21)
%23 = load float, float* %5
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), double %24)
ret i32 0
}

LLVM IR (-O2):
@__const.main.tokenstring = [12 x i8] c"15 12 14...\00"
@.str = [5 x i8] c"%80s\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [16 x i8] c"String = %s\0A\00"
@.str.5 = [16 x i8] c"Character = %c\0A\00"
@.str.6 = [16 x i8] c"Integer: = %d\0A\00"
@.str.7 = [16 x i8] c"Real: = %f\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = alloca [81 x i8]
%3 = alloca i8
%4 = alloca i32
%5 = alloca float
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%8 = bitcast i32* %4 to i8*
%9 = bitcast float* %5 to i8*
%10 = call i32 (i8*, i8*, ...) @sscanf(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %7)
%11 = call i32 (i8*, i8*, ...) @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%12 = call i32 (i8*, i8*, ...) @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%13 = call i32 (i8*, i8*, ...) @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %5)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %7)
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %4
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 %18)
%20 = load float, float* %5
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), double %21)
ret i32 0
}