int main(void) {
  int integer;
  float decimal;
  for (;;) {
    printf("Integer: ");
    if (scanf("%d", &integer) > 0) {
      print_float(&integer);
      print_int(&integer);
    } else
      break;
    printf("Float: ");
    if (scanf("%f", &decimal) > 0) {
      print_float(&decimal);
      print_int(&decimal);
    } else
      break;
  }
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
cmp    $0x0,%eax
jle    11a3 <main+0x53>
lea    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1070 <print_float@plt>
lea    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <print_int@plt>
jmp    11a8 <main+0x58>
jmp    11f6 <main+0xa6>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe58(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
cmp    $0x0,%eax
jle    11ec <main+0x9c>
lea    -0xc(%rbp),%rdi
mov    $0x0,%al
call   1070 <print_float@plt>
lea    -0xc(%rbp),%rdi
mov    $0x0,%al
call   1050 <print_int@plt>
jmp    11f1 <main+0xa1>
jmp    11f6 <main+0xa6>
jmp    115f <main+0xf>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
test   %eax,%eax
jle    120e <main+0xbe>
mov    %rsp,%r12
lea    0xe81(%rip),%r14
lea    0xe82(%rip),%r15
lea    0x4(%rsp),%rbx
lea    0xe61(%rip),%r13
lea    0xe64(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <print_float@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <print_int@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
test   %eax,%eax
jle    120e <main+0xbe>
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <print_float@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <print_int@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
test   %eax,%eax
jg     11b0 <main+0x60>
mov    $0xa,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"Float: \00"
@.str.3 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
br label %4
4: ; preds = %20, %0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 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 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = call i32 (i32*, ...) bitcast (i32 (...)* @print_float to i32 (i32*, ...)*)(i32* %2)
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @print_int to i32 (i32*, ...)*)(i32* %2)
br label %12
11: ; preds = %4
br label %21
12: ; preds = %8
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = call i32 (float*, ...) bitcast (i32 (...)* @print_float to i32 (float*, ...)*)(float* %3)
%18 = call i32 (float*, ...) bitcast (i32 (...)* @print_int to i32 (float*, ...)*)(float* %3)
br label %20
19: ; preds = %12
br label %21
20: ; preds = %16
br label %4
21: ; preds = %19, %11
%22 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [8 x i8] c"Float: \00"
@.str.3 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 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* %1)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %0, %14
%9 = call i32 (i32*, ...) bitcast (i32 (...)* @print_float to i32 (i32*, ...)*)(i32* %1)
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @print_int to i32 (i32*, ...)*)(i32* %1)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = call i32 (float*, ...) bitcast (i32 (...)* @print_float to i32 (float*, ...)*)(float* %2)
%16 = call i32 (float*, ...) bitcast (i32 (...)* @print_int to i32 (float*, ...)*)(float* %2)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%19 = icmp sgt i32 %18, 0
br i1 %19, label %8, label %20
20: ; preds = %14, %8, %0
%21 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
ret i32 0
}