#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*/ minscanf(char *, int *, float *, char *, char *, float *);
int /*<<< orphan*/ printf(char *, int, float, ...);
int main() {
  int i = 0;
  float d = 0, e;
  char s[100];
  char c;
  printf("%d,%f\n", i, d);
  minscanf("%d%f%s%c%e", &i, &d, s, &c, &e);
  printf("%d,%f,%s,%c,%e\n", i, d, s, c, e);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    -0x80(%rbp),%rcx
lea    0xea5(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x81(%rbp),%r8
lea    -0x10(%rbp),%r9
call   1040 <minscanf@plt>
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
lea    -0x80(%rbp),%rdx
movsbl -0x81(%rbp),%ecx
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe75(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xec1(%rip),%rdi
xorps  %xmm0,%xmm0
xor    %esi,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
lea    0x10(%rsp),%rbx
lea    0x3(%rsp),%r8
lea    0xc(%rsp),%r9
mov    %rbx,%rcx
call   1040 <minscanf@plt>
mov    0x8(%rsp),%esi
movss  0x4(%rsp),%xmm0
movsbl 0x3(%rsp),%ecx
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe7f(%rip),%rdi
mov    %rbx,%rdx
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d,%f\0A\00"
@.str.1 = [11 x i8] c"%d%f%s%c%e\00"
@.str.2 = [16 x i8] c"%d,%f,%s,%c,%e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca [100 x i8]
%6 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %2
store float 0.000000e+00, float* %3
%7 = load i32, i32* %2
%8 = load float, float* %3
%9 = call i32 (i8*, i32, float, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, float %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = call i32 @minscanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %2, float* %3, i8* %10, i8* %6, float* %4)
%12 = load i32, i32* %2
%13 = load float, float* %3
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%15 = load i8, i8* %6
%16 = sext i8 %15 to i32
%17 = load float, float* %4
%18 = fpext float %17 to double
%19 = call i32 (i8*, i32, float, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %12, float %13, i8* %14, i32 %16, double %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d,%f\0A\00"
@.str.1 = [11 x i8] c"%d%f%s%c%e\00"
@.str.2 = [16 x i8] c"%d,%f,%s,%c,%e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca [100 x i8]
%5 = alloca i8
%6 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%7 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
%8 = bitcast float* %3 to i8*
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%10 = tail call i32 (i8*, i32, float, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, float 0.000000e+00)
%11 = call i32 @minscanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %1, float* %2, i8* %9, i8* %5, float* %3)
%12 = load i32, i32* %1
%13 = load float, float* %2
%14 = load i8, i8* %5
%15 = sext i8 %14 to i32
%16 = load float, float* %3
%17 = fpext float %16 to double
%18 = call i32 (i8*, i32, float, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %12, float %13, i8* %9, i32 %15, double %17)
ret i32 0
}