#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*/ fmod(float, float);
int /*<<< orphan*/ printf(char *, float, float, int /*<<< orphan*/);
int main() {
  float a, b;
  int c;
  a = 9.2;
  b = 3.7;
  c = 2;
  printf("Remainder of %f / %d is %lf\n", a, c, fmod(a, c));
  printf("Remainder of %f / %f is %lf\n", a, b, fmod(a, b));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xecd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
cvtsi2ssl -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
call   1040 <fmod@plt>
movss  -0x20(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
mov    %eax,%esi
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1040 <fmod@plt>
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
mov    %eax,%esi
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
movss  0xed3(%rip),%xmm1
call   1040 <fmod@plt>
lea    0xecf(%rip),%rdi
movss  0xebb(%rip),%xmm0
movss  0xeb7(%rip),%xmm1
mov    %eax,%esi
call   1030 <printf@plt>
movss  0xeac(%rip),%xmm1
movss  0xe9c(%rip),%xmm0
call   1040 <fmod@plt>
lea    0xeb9(%rip),%rdi
movss  0xe88(%rip),%xmm0
movss  0xe88(%rip),%xmm1
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Remainder of %f / %d is %lf\0A\00"
@.str.1 = [29 x i8] c"Remainder of %f / %f is %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store i32 0, i32* %1
store float 0x4022666660000000, float* %2
store float 0x400D9999A0000000, float* %3
store i32 2, i32* %4
%5 = load float, float* %2
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to float
%8 = load float, float* %2
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to float
%11 = call i32 @fmod(float %8, float %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float %5, float %7, i32 %11)
%13 = load float, float* %2
%14 = load float, float* %3
%15 = load float, float* %2
%16 = load float, float* %3
%17 = call i32 @fmod(float %15, float %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), float %13, float %14, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Remainder of %f / %d is %lf\0A\00"
@.str.1 = [29 x i8] c"Remainder of %f / %f is %lf\0A\00"
define i32 @main() {
%1 = tail call i32 @fmod(float 0x4022666660000000, float 2.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float 0x4022666660000000, float 2.000000e+00, i32 %1)
%3 = tail call i32 @fmod(float 0x4022666660000000, float 0x400D9999A0000000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), float 0x4022666660000000, float 0x400D9999A0000000, i32 %3)
ret i32 0
}