#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*/ minprintf(char *, ...);
int /*<<< orphan*/ minscanf(char *, int *, int *, int *, int *, int *,
                            unsigned int *, unsigned int *, char *, float *,
                            float *, float *, char **);
int main(void) {
  int ret = 0;
  int d, i, o, h1, h2;
  unsigned int u1, u2;
  char c;
  char s[40];
  float f1, f2, f3;
  char print_str[] = "\ndecimal = %d\ndecimal = %i\noctal = %o\nhex = %x\nhex "
                     "= %X\nunsigned = %u \nunsigned = %u \nchar = %c \nfloat "
                     "= %f \nstring = %s \nfloat = %e \nfloat = %g \n";
  char scan_str[] = "%d %i %o %x %X %u %u %c %f %s %e %g";
  minprintf("\n This program uses minscanf to read input from stdin");
  minprintf("\n Give me the next types as input: %%d %%i %%o %%x %%X %%u %%u "
            "%%c %%f %%e %%g %%s\n");
  minscanf(scan_str, &d, &i, &o, &h1, &h2, &u1, &u2, &c, &f1, &f2, &f3, &s);
  minprintf("\n Your input is:");
  minprintf(print_str, d, i, o, h1, h2, u1, u2, c, f1, f2, f3, s);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x160,%rsp
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
lea    -0x110(%rbp),%rdi
lea    0xea2(%rip),%rsi
mov    $0x93,%edx
call   1050 <memcpy@plt>
lea    -0x140(%rbp),%rdi
lea    0xf2a(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
lea    0xf3d(%rip),%rdi
mov    $0x0,%al
call   1030 <minprintf@plt>
lea    0xf65(%rip),%rdi
mov    $0x0,%al
call   1030 <minprintf@plt>
lea    -0x140(%rbp),%rdi
lea    -0x70(%rbp),%rax
lea    -0x2c(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x34(%rbp),%rcx
lea    -0x38(%rbp),%r8
lea    -0x3c(%rbp),%r9
lea    -0x40(%rbp),%r12
lea    -0x44(%rbp),%r15
lea    -0x45(%rbp),%r14
lea    -0x74(%rbp),%rbx
lea    -0x78(%rbp),%r11
lea    -0x7c(%rbp),%r10
mov    %r12,(%rsp)
mov    %r15,0x8(%rsp)
mov    %r14,0x10(%rsp)
mov    %rbx,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1040 <minscanf@plt>
lea    0xf4d(%rip),%rdi
mov    $0x0,%al
call   1030 <minprintf@plt>
lea    -0x110(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
mov    -0x3c(%rbp),%r9d
mov    -0x40(%rbp),%ebx
mov    -0x44(%rbp),%r11d
movsbl -0x45(%rbp),%r10d
movss  -0x74(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x78(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x7c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    -0x70(%rbp),%rax
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    $0x3,%al
call   1030 <minprintf@plt>
mov    -0x28(%rbp),%eax
add    $0x160,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x130,%rsp
lea    0xeb9(%rip),%rsi
lea    0x90(%rsp),%r14
mov    $0x93,%edx
mov    %r14,%rdi
call   1050 <memcpy@plt>
movaps 0xf4d(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf31(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movl   $0x672520,0x50(%rsp)
lea    0xf41(%rip),%rdi
xor    %eax,%eax
call   1030 <minprintf@plt>
lea    0xf69(%rip),%rdi
xor    %eax,%eax
call   1030 <minprintf@plt>
sub    $0x8,%rsp
lea    0x68(%rsp),%r15
lea    0x10(%rsp),%rax
lea    0x14(%rsp),%rbx
lea    0x18(%rsp),%r10
lea    0xf(%rsp),%r11
lea    0x1c(%rsp),%r12
lea    0x20(%rsp),%r13
lea    0x38(%rsp),%rdi
lea    0x34(%rsp),%rsi
lea    0x30(%rsp),%rdx
lea    0x2c(%rsp),%rcx
lea    0x28(%rsp),%r8
lea    0x24(%rsp),%r9
push   %r15
push   %rax
push   %rbx
push   %r10
push   %r11
push   %r12
push   %r13
call   1040 <minscanf@plt>
add    $0x40,%rsp
lea    0xf55(%rip),%rdi
xor    %eax,%eax
call   1030 <minprintf@plt>
mov    0x2c(%rsp),%esi
mov    0x28(%rsp),%edx
mov    0x24(%rsp),%ecx
mov    0x20(%rsp),%r8d
mov    0x1c(%rsp),%r9d
mov    0x18(%rsp),%r10d
mov    0x14(%rsp),%r11d
movsbl 0x7(%rsp),%ebx
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xc(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  0x8(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
mov    %r14,%rdi
mov    $0x3,%al
push   %r15
push   %rbx
push   %r11
push   %r10
call   1030 <minprintf@plt>
add    $0x20,%rsp
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.print_str = [147 x i8] c"\0Adecimal = %d\0Adecimal = %i\0Aoctal = %o\0Ahex = %x\0Ahex = %X\0Aunsigned = %u \0Aunsigned = %u \0Achar = %c \0Afloat = %f \0Astring = %s \0Afloat = %e \0Afloat = %g \0A\00"
@__const.main.scan_str = [36 x i8] c"%d %i %o %x %X %u %u %c %f %s %e %g\00"
@.str = [54 x i8] c"\0A This program uses minscanf to read input from stdin\00"
@.str.1 = [84 x i8] c"\0A Give me the next types as input: %%d %%i %%o %%x %%X %%u %%u %%c %%f %%e %%g %%s\0A\00"
@.str.2 = [17 x i8] c"\0A Your input is:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
%11 = alloca [40 x i8]
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca [147 x i8]
%16 = alloca [36 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
%17 = bitcast [147 x i8]* %15 to i8*
%18 = bitcast [36 x i8]* %16 to i8*
%19 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%20 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.1, i64 0, i64 0))
%21 = getelementptr inbounds [36 x i8], [36 x i8]* %16, i64 0, i64 0
%22 = bitcast [40 x i8]* %11 to i8**
%23 = call i32 @minscanf(i8* %21, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9, i8* %10, float* %12, float* %13, float* %14, i8** %22)
%24 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%25 = getelementptr inbounds [147 x i8], [147 x i8]* %15, i64 0, i64 0
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = load i32, i32* %5
%29 = load i32, i32* %6
%30 = load i32, i32* %7
%31 = load i32, i32* %8
%32 = load i32, i32* %9
%33 = load i8, i8* %10
%34 = sext i8 %33 to i32
%35 = load float, float* %12
%36 = fpext float %35 to double
%37 = load float, float* %13
%38 = fpext float %37 to double
%39 = load float, float* %14
%40 = fpext float %39 to double
%41 = getelementptr inbounds [40 x i8], [40 x i8]* %11, i64 0, i64 0
%42 = call i32 (i8*, ...) @minprintf(i8* %25, i32 %26, i32 %27, i32 %28, i32 %29, i32 %30, i32 %31, i32 %32, i32 %34, double %36, double %38, double %40, i8* %41)
%43 = load i32, i32* %2
ret i32 %43
}

LLVM IR (-O2):
@__const.main.print_str = [147 x i8] c"\0Adecimal = %d\0Adecimal = %i\0Aoctal = %o\0Ahex = %x\0Ahex = %X\0Aunsigned = %u \0Aunsigned = %u \0Achar = %c \0Afloat = %f \0Astring = %s \0Afloat = %e \0Afloat = %g \0A\00"
@__const.main.scan_str = [36 x i8] c"%d %i %o %x %X %u %u %c %f %s %e %g\00"
@.str = [54 x i8] c"\0A This program uses minscanf to read input from stdin\00"
@.str.1 = [84 x i8] c"\0A Give me the next types as input: %%d %%i %%o %%x %%X %%u %%u %%c %%f %%e %%g %%s\0A\00"
@.str.2 = [17 x i8] c"\0A Your input is:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
%9 = alloca [40 x i8]
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca [147 x i8]
%14 = alloca [36 x i8]
%15 = bitcast i32* %1 to i8*
%16 = bitcast i32* %2 to i8*
%17 = bitcast i32* %3 to i8*
%18 = bitcast i32* %4 to i8*
%19 = bitcast i32* %5 to i8*
%20 = bitcast i32* %6 to i8*
%21 = bitcast i32* %7 to i8*
%22 = getelementptr inbounds [40 x i8], [40 x i8]* %9, i64 0, i64 0
%23 = bitcast float* %10 to i8*
%24 = bitcast float* %11 to i8*
%25 = bitcast float* %12 to i8*
%26 = getelementptr inbounds [147 x i8], [147 x i8]* %13, i64 0, i64 0
%27 = getelementptr inbounds [36 x i8], [36 x i8]* %14, i64 0, i64 0
%28 = tail call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%29 = tail call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.1, i64 0, i64 0))
%30 = bitcast [40 x i8]* %9 to i8**
%31 = call i32 @minscanf(i8* %27, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i8* %8, float* %10, float* %11, float* %12, i8** %30)
%32 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%33 = load i32, i32* %1
%34 = load i32, i32* %2
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = load i32, i32* %7
%40 = load i8, i8* %8
%41 = sext i8 %40 to i32
%42 = load float, float* %10
%43 = fpext float %42 to double
%44 = load float, float* %11
%45 = fpext float %44 to double
%46 = load float, float* %12
%47 = fpext float %46 to double
%48 = call i32 (i8*, ...) @minprintf(i8* %26, i32 %33, i32 %34, i32 %35, i32 %36, i32 %37, i32 %38, i32 %39, i32 %41, double %43, double %45, double %47, i8* %22)
ret i32 0
}