#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 *, ...);
float Ires(float Vin, float Rin) {
  float Ibk = 0.00f;
  if (Vin > 0 && Rin > 0) {
    Ibk = (Vin / Rin);
    printf("%0.2fA %0.0fmA\n", Ibk, Ibk * 1000);
  } else {
    printf("Error: non-zero values only\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<Ires>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1188 <Ires+0x78>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1188 <Ires+0x78>
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  0xe94(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe88(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    1196 <Ires+0x86>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ires>:
push   %rax
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jbe    115b <Ires+0x3b>
ucomiss %xmm2,%xmm1
jbe    115b <Ires+0x3b>
divss  %xmm1,%xmm0
xorps  %xmm2,%xmm2
cvtss2sd %xmm0,%xmm2
mulss  0xebf(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
lea    0xeb5(%rip),%rdi
movaps %xmm2,%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
jmp    1167 <Ires+0x47>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%0.2fA %0.0fmA\0A\00"
@.str.1 = [29 x i8] c"Error: non-zero values only\0A\00"
define float @Ires(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
store float 0.000000e+00, float* %5
%6 = load float, float* %3
%7 = fcmp ogt float %6, 0.000000e+00
br i1 %7, label %8, label %21
8: ; preds = %2
%9 = load float, float* %4
%10 = fcmp ogt float %9, 0.000000e+00
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load float, float* %3
%13 = load float, float* %4
%14 = fdiv float %12, %13
store float %14, float* %5
%15 = load float, float* %5
%16 = fpext float %15 to double
%17 = load float, float* %5
%18 = fmul float %17, 1.000000e+03
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %16, double %19)
br label %23
21: ; preds = %8, %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21, %11
ret float 0.000000e+00
}

LLVM IR (-O2):
@.str = [16 x i8] c"%0.2fA %0.0fmA\0A\00"
@str = [28 x i8] c"Error: non-zero values only\00"
define float @Ires(float %0, float %1) {
%3 = fcmp ogt float %0, 0.000000e+00
%4 = fcmp ogt float %1, 0.000000e+00
%5 = and i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = fdiv float %0, %1
%8 = fpext float %7 to double
%9 = fmul float %7, 1.000000e+03
%10 = fpext float %9 to double
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %8, double %10)
br label %14
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %12, %6
ret float 0.000000e+00
}