#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*/ myprintf(char *, ...);
int /*<<< orphan*/ myscanf(char *, int *);
int main(int argc, char *argv[]) {
  int test = 0;
  myprintf("**** Program testujący do funkcji myprinf i myscanf **** \nProszę "
           "wpisać liczbę całkowitą\n");
  myscanf("%d", &test);
  myprintf("Wpisałeś liczbę \n%d (base 10)\n%b (base 2)\n%x (base 16)\n", test,
           test, test);
  myprintf("Proszę wpisać liczbę binarną\n");
  myscanf("%b", &test);
  myprintf("Wpisałeś liczbę \n%d (base 10)\n%b (base 2)\n%x (base 16)\n", test,
           test, test);
  myprintf("Proszę wpisać liczbę szestnastkową\n");
  myscanf("%x", &test);
  myprintf("Wpisałeś liczbę \n%d (base 10)\n%b (base 2)\n%x (base 16)\n", test,
           test, test);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <myprintf@plt>
lea    0xf0e(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <myscanf@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1040 <myprintf@plt>
lea    0xf25(%rip),%rdi
mov    $0x0,%al
call   1040 <myprintf@plt>
lea    0xf39(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <myscanf@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <myprintf@plt>
lea    0xf15(%rip),%rdi
mov    $0x0,%al
call   1040 <myprintf@plt>
lea    0xf2f(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <myscanf@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <myprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1040 <myprintf@plt>
lea    0xf1f(%rip),%rdi
lea    0x4(%rsp),%r14
mov    %r14,%rsi
call   1030 <myscanf@plt>
mov    0x4(%rsp),%ecx
lea    0xf0a(%rip),%rbx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1040 <myprintf@plt>
lea    0xf30(%rip),%rdi
xor    %eax,%eax
call   1040 <myprintf@plt>
lea    0xf44(%rip),%rdi
mov    %r14,%rsi
call   1030 <myscanf@plt>
mov    0x4(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1040 <myprintf@plt>
lea    0xf26(%rip),%rdi
xor    %eax,%eax
call   1040 <myprintf@plt>
lea    0xf40(%rip),%rdi
mov    %r14,%rsi
call   1030 <myscanf@plt>
mov    0x4(%rsp),%ecx
mov    %rbx,%rdi
mov    %ecx,%esi
mov    %ecx,%edx
xor    %eax,%eax
call   1040 <myprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [96 x i8] c"**** Program testuj\C4\85cy do funkcji myprinf i myscanf **** \0AProsz\C4\99 wpisa\C4\87 liczb\C4\99 ca\C5\82kowit\C4\85\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [59 x i8] c"Wpisa\C5\82e\C5\9B liczb\C4\99 \0A%d (base 10)\0A%b (base 2)\0A%x (base 16)\0A\00"
@.str.3 = [34 x i8] c"Prosz\C4\99 wpisa\C4\87 liczb\C4\99 binarn\C4\85\0A\00"
@.str.4 = [3 x i8] c"%b\00"
@.str.5 = [40 x i8] c"Prosz\C4\99 wpisa\C4\87 liczb\C4\99 szestnastkow\C4\85\0A\00"
@.str.6 = [3 x i8] c"%x\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @myscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* %6
%12 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
%13 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @myscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %6)
%15 = load i32, i32* %6
%16 = load i32, i32* %6
%17 = load i32, i32* %6
%18 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %16, i32 %17)
%19 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
%20 = call i32 @myscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %6)
%21 = load i32, i32* %6
%22 = load i32, i32* %6
%23 = load i32, i32* %6
%24 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i32 %21, i32 %22, i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [96 x i8] c"**** Program testuj\C4\85cy do funkcji myprinf i myscanf **** \0AProsz\C4\99 wpisa\C4\87 liczb\C4\99 ca\C5\82kowit\C4\85\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [59 x i8] c"Wpisa\C5\82e\C5\9B liczb\C4\99 \0A%d (base 10)\0A%b (base 2)\0A%x (base 16)\0A\00"
@.str.3 = [34 x i8] c"Prosz\C4\99 wpisa\C4\87 liczb\C4\99 binarn\C4\85\0A\00"
@.str.4 = [3 x i8] c"%b\00"
@.str.5 = [40 x i8] c"Prosz\C4\99 wpisa\C4\87 liczb\C4\99 szestnastkow\C4\85\0A\00"
@.str.6 = [3 x i8] c"%x\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = tail call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @myscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %7, i32 %7)
%9 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @myscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i32 %11, i32 %11, i32 %11)
%13 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 @myscanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%15 = load i32, i32* %3
%16 = call i32 (i8*, ...) @myprintf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %15, i32 %15)
ret i32 0
}