#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 */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ ceilf(float);
scalar_t__ is_ambiguous_size(int);
int precoding_bits_f2(int);
float srslte_ra_type0_P(int);
uint32_t dci_format2_sizeof(uint32_t nof_prb, uint32_t nof_ports) {
  uint32_t n = (uint32_t)ceilf((float)nof_prb / srslte_ra_type0_P(nof_prb)) +
               2 + 3 + 1 + 2 * (5 + 1 + 2) + precoding_bits_f2(nof_ports);
  if (nof_prb > 10) {
    n++;
  }
  while (is_ambiguous_size(n)) {
    n++;
  }
  return n;
}


x86 assembly (clang, -O0):
<dci_format2_sizeof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <srslte_ra_type0_P@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
divss  %xmm1,%xmm0
call   1060 <ceilf@plt>
add    $0x2,%eax
add    $0x3,%eax
add    $0x1,%eax
add    $0x10,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <precoding_bits_f2@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0x4(%rbp)
jle    11a5 <dci_format2_sizeof+0x65>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11aa <dci_format2_sizeof+0x6a>
mov    -0xc(%rbp),%edi
call   1050 <is_ambiguous_size@plt>
cmp    $0x0,%rax
je     11ca <dci_format2_sizeof+0x8a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11aa <dci_format2_sizeof+0x6a>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dci_format2_sizeof>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
cvtsi2ss %edi,%xmm0
movss  %xmm0,0xc(%rsp)
call   1040 <srslte_ra_type0_P@plt>
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1060 <ceilf@plt>
mov    %rax,%rbx
mov    %r14d,%edi
call   1030 <precoding_bits_f2@plt>
xor    %ecx,%ecx
cmp    $0xb,%ebp
setge  %cl
add    %ebx,%ecx
lea    (%rax,%rcx,1),%ebx
add    $0x16,%ebx
nopl   0x0(%rax)
mov    %ebx,%edi
call   1050 <is_ambiguous_size@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1190 <dci_format2_sizeof+0x50>
add    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dci_format2_sizeof(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to float
%8 = load i32, i32* %3
%9 = call float @srslte_ra_type0_P(i32 %8)
%10 = fdiv float %7, %9
%11 = call i64 @ceilf(float %10)
%12 = trunc i64 %11 to i32
%13 = add nsw i32 %12, 2
%14 = add nsw i32 %13, 3
%15 = add nsw i32 %14, 1
%16 = add nsw i32 %15, 16
%17 = load i32, i32* %4
%18 = call i32 @precoding_bits_f2(i32 %17)
%19 = add nsw i32 %16, %18
store i32 %19, i32* %5
%20 = load i32, i32* %3
%21 = icmp sgt i32 %20, 10
br i1 %21, label %22, label %25
22: ; preds = %2
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %25
25: ; preds = %22, %2
br label %26
26: ; preds = %30, %25
%27 = load i32, i32* %5
%28 = call i64 @is_ambiguous_size(i32 %27)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
br label %26
33: ; preds = %26
%34 = load i32, i32* %5
ret i32 %34
}

LLVM IR (-O2):
define i32 @dci_format2_sizeof(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to float
%4 = tail call float @srslte_ra_type0_P(i32 %0)
%5 = fdiv float %3, %4
%6 = tail call i64 @ceilf(float %5)
%7 = trunc i64 %6 to i32
%8 = tail call i32 @precoding_bits_f2(i32 %1)
%9 = icmp sgt i32 %0, 10
%10 = select i1 %9, i32 23, i32 22
%11 = add i32 %10, %7
%12 = add i32 %11, %8
br label %13
13: ; preds = %13, %2
%14 = phi i32 [ %12, %2 ], [ %17, %13 ]
%15 = tail call i64 @is_ambiguous_size(i32 %14)
%16 = icmp eq i64 %15, 0
%17 = add nsw i32 %14, 1
br i1 %16, label %18, label %13
18: ; preds = %13
ret i32 %14
}