#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*/ Q16_16_mul_Q16_16_to_Q16_16(int /*<<< orphan*/,
                                               int /*<<< orphan*/);
int Q16_16_to_int32(int /*<<< orphan*/);
int /*<<< orphan*/ float_to_Q16_16(int);
char *test_Q_mul() {
  do {
    if (!(Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(
              float_to_Q16_16(1), float_to_Q16_16(1))) == 1))
      return "Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(float_to_Q16_16(1), "
             "float_to_Q16_16(1))) == 1";
  } while (0);
  do {
    if (!(Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(
              float_to_Q16_16(-1), float_to_Q16_16(1))) == -1))
      return "Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(float_to_Q16_16(-1), "
             "float_to_Q16_16(1))) == -1";
  } while (0);
  do {
    if (!(Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(
              float_to_Q16_16(1), float_to_Q16_16(-1))) == -1))
      return "Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(float_to_Q16_16(1), "
             "float_to_Q16_16(-1))) == -1";
  } while (0);
  do {
    if (!(Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(
              float_to_Q16_16(-1), float_to_Q16_16(-1))) == 1))
      return "Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(float_to_Q16_16(-1), "
             "float_to_Q16_16(-1))) == 1";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_Q_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
call   1030 <float_to_Q16_16@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <float_to_Q16_16@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1040 <Q16_16_mul_Q16_16_to_Q16_16@plt>
mov    %eax,%edi
call   1050 <Q16_16_to_int32@plt>
cmp    $0x1,%eax
je     1179 <test_Q_mul+0x49>
lea    0xe90(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1267 <test_Q_mul+0x137>
jmp    117e <test_Q_mul+0x4e>
jmp    1183 <test_Q_mul+0x53>
mov    $0xffffffff,%edi
call   1030 <float_to_Q16_16@plt>
mov    %eax,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <float_to_Q16_16@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1040 <Q16_16_mul_Q16_16_to_Q16_16@plt>
mov    %eax,%edi
call   1050 <Q16_16_to_int32@plt>
cmp    $0xffffffff,%eax
je     11c4 <test_Q_mul+0x94>
lea    0xe9f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1267 <test_Q_mul+0x137>
jmp    11c9 <test_Q_mul+0x99>
jmp    11ce <test_Q_mul+0x9e>
mov    $0x1,%edi
call   1030 <float_to_Q16_16@plt>
mov    %eax,-0x14(%rbp)
mov    $0xffffffff,%edi
call   1030 <float_to_Q16_16@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <Q16_16_mul_Q16_16_to_Q16_16@plt>
mov    %eax,%edi
call   1050 <Q16_16_to_int32@plt>
cmp    $0xffffffff,%eax
je     120f <test_Q_mul+0xdf>
lea    0xeb0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1267 <test_Q_mul+0x137>
jmp    1214 <test_Q_mul+0xe4>
jmp    1219 <test_Q_mul+0xe9>
mov    $0xffffffff,%edi
call   1030 <float_to_Q16_16@plt>
mov    %eax,-0x18(%rbp)
mov    $0xffffffff,%edi
call   1030 <float_to_Q16_16@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
call   1040 <Q16_16_mul_Q16_16_to_Q16_16@plt>
mov    %eax,%edi
call   1050 <Q16_16_to_int32@plt>
cmp    $0x1,%eax
je     125a <test_Q_mul+0x12a>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1267 <test_Q_mul+0x137>
jmp    125f <test_Q_mul+0x12f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_Q_mul>:
push   %rbx
mov    $0x1,%edi
call   1030 <float_to_Q16_16@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <float_to_Q16_16@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <Q16_16_mul_Q16_16_to_Q16_16@plt>
mov    %eax,%edi
call   1050 <Q16_16_to_int32@plt>
cmp    $0x1,%eax
jne    1190 <test_Q_mul+0x60>
mov    $0xffffffff,%edi
call   1030 <float_to_Q16_16@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1030 <float_to_Q16_16@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <Q16_16_mul_Q16_16_to_Q16_16@plt>
mov    %eax,%edi
call   1050 <Q16_16_to_int32@plt>
cmp    $0xffffffff,%eax
je     1199 <test_Q_mul+0x69>
lea    0xecc(%rip),%rax
pop    %rbx
ret
lea    0xe69(%rip),%rax
pop    %rbx
ret
mov    $0x1,%edi
call   1030 <float_to_Q16_16@plt>
mov    %eax,%ebx
mov    $0xffffffff,%edi
call   1030 <float_to_Q16_16@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <Q16_16_mul_Q16_16_to_Q16_16@plt>
mov    %eax,%edi
call   1050 <Q16_16_to_int32@plt>
cmp    $0xffffffff,%eax
je     11cd <test_Q_mul+0x9d>
lea    0xeeb(%rip),%rax
pop    %rbx
ret
mov    $0xffffffff,%edi
call   1030 <float_to_Q16_16@plt>
mov    %eax,%ebx
mov    $0xffffffff,%edi
call   1030 <float_to_Q16_16@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <Q16_16_mul_Q16_16_to_Q16_16@plt>
mov    %eax,%edi
call   1050 <Q16_16_to_int32@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
lea    0xf11(%rip),%rcx
cmovne %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [90 x i8] c"Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(float_to_Q16_16(1), float_to_Q16_16(1))) == 1\00"
@.str.1 = [92 x i8] c"Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(float_to_Q16_16(-1), float_to_Q16_16(1))) == -1\00"
@.str.2 = [92 x i8] c"Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(float_to_Q16_16(1), float_to_Q16_16(-1))) == -1\00"
@.str.3 = [92 x i8] c"Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(float_to_Q16_16(-1), float_to_Q16_16(-1))) == 1\00"
define i8* @test_Q_mul() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i32 @float_to_Q16_16(i32 1)
%4 = call i32 @float_to_Q16_16(i32 1)
%5 = call i32 @Q16_16_mul_Q16_16_to_Q16_16(i32 %3, i32 %4)
%6 = call i32 @Q16_16_to_int32(i32 %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %9, label %8
8: ; preds = %2
store i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0), i8** %1
br label %38
9: ; preds = %2
br label %10
10: ; preds = %9
br label %11
11: ; preds = %10
%12 = call i32 @float_to_Q16_16(i32 -1)
%13 = call i32 @float_to_Q16_16(i32 1)
%14 = call i32 @Q16_16_mul_Q16_16_to_Q16_16(i32 %12, i32 %13)
%15 = call i32 @Q16_16_to_int32(i32 %14)
%16 = icmp eq i32 %15, -1
br i1 %16, label %18, label %17
17: ; preds = %11
store i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %38
18: ; preds = %11
br label %19
19: ; preds = %18
br label %20
20: ; preds = %19
%21 = call i32 @float_to_Q16_16(i32 1)
%22 = call i32 @float_to_Q16_16(i32 -1)
%23 = call i32 @Q16_16_mul_Q16_16_to_Q16_16(i32 %21, i32 %22)
%24 = call i32 @Q16_16_to_int32(i32 %23)
%25 = icmp eq i32 %24, -1
br i1 %25, label %27, label %26
26: ; preds = %20
store i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.2, i64 0, i64 0), i8** %1
br label %38
27: ; preds = %20
br label %28
28: ; preds = %27
br label %29
29: ; preds = %28
%30 = call i32 @float_to_Q16_16(i32 -1)
%31 = call i32 @float_to_Q16_16(i32 -1)
%32 = call i32 @Q16_16_mul_Q16_16_to_Q16_16(i32 %30, i32 %31)
%33 = call i32 @Q16_16_to_int32(i32 %32)
%34 = icmp eq i32 %33, 1
br i1 %34, label %36, label %35
35: ; preds = %29
store i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.3, i64 0, i64 0), i8** %1
br label %38
36: ; preds = %29
br label %37
37: ; preds = %36
store i8* null, i8** %1
br label %38
38: ; preds = %37, %35, %26, %17, %8
%39 = load i8*, i8** %1
ret i8* %39
}

LLVM IR (-O2):
@.str = [90 x i8] c"Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(float_to_Q16_16(1), float_to_Q16_16(1))) == 1\00"
@.str.1 = [92 x i8] c"Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(float_to_Q16_16(-1), float_to_Q16_16(1))) == -1\00"
@.str.2 = [92 x i8] c"Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(float_to_Q16_16(1), float_to_Q16_16(-1))) == -1\00"
@.str.3 = [92 x i8] c"Q16_16_to_int32(Q16_16_mul_Q16_16_to_Q16_16(float_to_Q16_16(-1), float_to_Q16_16(-1))) == 1\00"
define i8* @test_Q_mul() {
%1 = tail call i32 @float_to_Q16_16(i32 1)
%2 = tail call i32 @float_to_Q16_16(i32 1)
%3 = tail call i32 @Q16_16_mul_Q16_16_to_Q16_16(i32 %1, i32 %2)
%4 = tail call i32 @Q16_16_to_int32(i32 %3)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %25
6: ; preds = %0
%7 = tail call i32 @float_to_Q16_16(i32 -1)
%8 = tail call i32 @float_to_Q16_16(i32 1)
%9 = tail call i32 @Q16_16_mul_Q16_16_to_Q16_16(i32 %7, i32 %8)
%10 = tail call i32 @Q16_16_to_int32(i32 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %25
12: ; preds = %6
%13 = tail call i32 @float_to_Q16_16(i32 1)
%14 = tail call i32 @float_to_Q16_16(i32 -1)
%15 = tail call i32 @Q16_16_mul_Q16_16_to_Q16_16(i32 %13, i32 %14)
%16 = tail call i32 @Q16_16_to_int32(i32 %15)
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %25
18: ; preds = %12
%19 = tail call i32 @float_to_Q16_16(i32 -1)
%20 = tail call i32 @float_to_Q16_16(i32 -1)
%21 = tail call i32 @Q16_16_mul_Q16_16_to_Q16_16(i32 %19, i32 %20)
%22 = tail call i32 @Q16_16_to_int32(i32 %21)
%23 = icmp eq i32 %22, 1
%24 = select i1 %23, i8* null, i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.3, i64 0, i64 0)
br label %25
25: ; preds = %18, %12, %6, %0
%26 = phi i8* [ getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0), %0 ], [ getelementptr inbounds ([92 x i8], [92 x i8]* @.str.1, i64 0, i64 0), %6 ], [ getelementptr inbounds ([92 x i8], [92 x i8]* @.str.2, i64 0, i64 0), %12 ], [ %24, %18 ]
ret i8* %26
}