#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 *, char *, char *, int);
int scanf(char *, float *, float *);
int main(void) {
  float f, ff;
  int i;
  do {
    i = scanf("%f%f", &f, &ff);
    if (i == 2)
      printf("%s mod %s = %d\n", "f", "ff", (int)(f) % (int)(ff));
  } while (i == 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jne    1179 <main+0x59>
cvttss2si -0x8(%rbp),%eax
cvttss2si -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
lea    0xe9f(%rip),%rdi
lea    0xe96(%rip),%rsi
lea    0xea1(%rip),%rdx
call   1030 <printf@plt>
jmp    117e <main+0x5e>
cmpl   $0x2,-0x10(%rbp)
je     112f <main+0xf>
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    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11a1 <main+0x81>
lea    0xeba(%rip),%r14
lea    0xeb1(%rip),%r15
lea    0xebc(%rip),%r12
lea    0xea0(%rip),%r13
lea    0x4(%rsp),%rbx
mov    %rsp,%rbp
nopl   0x0(%rax,%rax,1)
cvttss2si 0x4(%rsp),%eax
cvttss2si (%rsp),%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1030 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1170 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%f%f\00"
@.str.1 = [16 x i8] c"%s mod %s = %d\0A\00"
@.str.2 = [2 x i8] c"f\00"
@.str.3 = [3 x i8] c"ff\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %17, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float* %2, float* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load float, float* %2
%11 = fptosi float %10 to i32
%12 = load float, float* %3
%13 = fptosi float %12 to i32
%14 = srem i32 %11, %13
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %9, %5
br label %17
17: ; preds = %16
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 2
br i1 %19, label %5, label %20
20: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%f%f\00"
@.str.1 = [16 x i8] c"%s mod %s = %d\0A\00"
@.str.2 = [2 x i8] c"f\00"
@.str.3 = [3 x i8] c"ff\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %16
7: ; preds = %0, %7
%8 = load float, float* %1
%9 = fptosi float %8 to i32
%10 = load float, float* %2
%11 = fptosi float %10 to i32
%12 = srem i32 %9, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%15 = icmp eq i32 %14, 2
br i1 %15, label %7, label %16
16: ; preds = %7, %0
ret i32 0
}