#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 multiply(int, int);
int test_multiply() {
  return 10 == multiply(5, 2) && -10 == multiply(5, -2) &&
         -10 == multiply(-5, 2) && 10 == multiply(-5, -2) &&
         0 == multiply(5, 0) && 0 == multiply(0, 5);
}


x86 assembly (clang, -O0):
<test_multiply>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
mov    $0x2,%esi
call   1030 <multiply@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xa,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    11d9 <test_multiply+0xc9>
mov    $0x5,%edi
mov    $0xfffffffe,%esi
call   1030 <multiply@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xfffffff6,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    11d9 <test_multiply+0xc9>
mov    $0xfffffffb,%edi
mov    $0x2,%esi
call   1030 <multiply@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xfffffff6,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    11d9 <test_multiply+0xc9>
mov    $0xfffffffb,%edi
mov    $0xfffffffe,%esi
call   1030 <multiply@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xa,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    11d9 <test_multiply+0xc9>
mov    $0x5,%edi
xor    %esi,%esi
call   1030 <multiply@plt>
mov    %eax,%edx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    11d9 <test_multiply+0xc9>
xor    %edi,%edi
mov    $0x5,%esi
call   1030 <multiply@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_multiply>:
push   %rbx
mov    $0x5,%edi
mov    $0x2,%esi
call   1030 <multiply@plt>
xor    %ebx,%ebx
cmp    $0xa,%eax
jne    1188 <test_multiply+0x78>
mov    $0x5,%edi
mov    $0xfffffffe,%esi
call   1030 <multiply@plt>
cmp    $0xfffffff6,%eax
jne    1188 <test_multiply+0x78>
mov    $0xfffffffb,%edi
mov    $0x2,%esi
call   1030 <multiply@plt>
cmp    $0xfffffff6,%eax
jne    1188 <test_multiply+0x78>
mov    $0xfffffffb,%edi
mov    $0xfffffffe,%esi
call   1030 <multiply@plt>
cmp    $0xa,%eax
jne    1188 <test_multiply+0x78>
xor    %ebx,%ebx
mov    $0x5,%edi
xor    %esi,%esi
call   1030 <multiply@plt>
test   %eax,%eax
jne    1188 <test_multiply+0x78>
xor    %edi,%edi
mov    $0x5,%esi
call   1030 <multiply@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test_multiply() {
%1 = call i32 @multiply(i32 5, i32 2)
%2 = icmp eq i32 10, %1
br i1 %2, label %3, label %18
3: ; preds = %0
%4 = call i32 @multiply(i32 5, i32 -2)
%5 = icmp eq i32 -10, %4
br i1 %5, label %6, label %18
6: ; preds = %3
%7 = call i32 @multiply(i32 -5, i32 2)
%8 = icmp eq i32 -10, %7
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = call i32 @multiply(i32 -5, i32 -2)
%11 = icmp eq i32 10, %10
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = call i32 @multiply(i32 5, i32 0)
%14 = icmp eq i32 0, %13
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = call i32 @multiply(i32 0, i32 5)
%17 = icmp eq i32 0, %16
br label %18
18: ; preds = %15, %12, %9, %6, %3, %0
%19 = phi i1 [ false, %12 ], [ false, %9 ], [ false, %6 ], [ false, %3 ], [ false, %0 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @test_multiply() {
%1 = tail call i32 @multiply(i32 5, i32 2)
%2 = icmp eq i32 %1, 10
br i1 %2, label %3, label %19
3: ; preds = %0
%4 = tail call i32 @multiply(i32 5, i32 -2)
%5 = icmp eq i32 %4, -10
br i1 %5, label %6, label %19
6: ; preds = %3
%7 = tail call i32 @multiply(i32 -5, i32 2)
%8 = icmp eq i32 %7, -10
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = tail call i32 @multiply(i32 -5, i32 -2)
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = tail call i32 @multiply(i32 5, i32 0)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = tail call i32 @multiply(i32 0, i32 5)
%17 = icmp eq i32 %16, 0
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %15, %12, %9, %6, %3, %0
%20 = phi i32 [ 0, %12 ], [ 0, %9 ], [ 0, %6 ], [ 0, %3 ], [ 0, %0 ], [ %18, %15 ]
ret i32 %20
}