#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 */
long long pow(int, int);
long long int quotient(long long int a, long long int b) {
  if (b == 0) {
    return -1;
  } else if ((a == (-pow(2, 4 - 1))) & (b == -1)) {
    return a;
  } else {
    return a / b;
  }
}


x86 assembly (clang, -O0):
<quotient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1138 <quotient+0x28>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    119a <quotient+0x8a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <pow@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
sub    %rdx,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmpq   $0xffffffffffffffff,-0x18(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     118c <quotient+0x7c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    119a <quotient+0x8a>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quotient>:
push   %r14
push   %rbx
push   %rax
test   %rsi,%rsi
je     1155 <quotient+0x45>
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <pow@plt>
cmp    $0xffffffffffffffff,%r14
jne    113c <quotient+0x2c>
neg    %rax
cmp    %rbx,%rax
je     1167 <quotient+0x57>
mov    %rbx,%rax
or     %r14,%rax
shr    $0x20,%rax
je     115e <quotient+0x4e>
mov    %rbx,%rax
cqto
idiv   %r14
mov    %rax,%rbx
jmp    1167 <quotient+0x57>
mov    $0xffffffffffffffff,%rbx
jmp    1167 <quotient+0x57>
mov    %ebx,%eax
xor    %edx,%edx
div    %r14d
mov    %eax,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @quotient(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i64 -1, i64* %3
br label %26
9: ; preds = %2
%10 = load i64, i64* %4
%11 = call i64 @pow(i32 2, i32 3)
%12 = sub nsw i64 0, %11
%13 = icmp eq i64 %10, %12
%14 = zext i1 %13 to i32
%15 = load i64, i64* %5
%16 = icmp eq i64 %15, -1
%17 = zext i1 %16 to i32
%18 = and i32 %14, %17
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %9
%21 = load i64, i64* %4
store i64 %21, i64* %3
br label %26
22: ; preds = %9
%23 = load i64, i64* %4
%24 = load i64, i64* %5
%25 = sdiv i64 %23, %24
store i64 %25, i64* %3
br label %26
26: ; preds = %22, %20, %8
%27 = load i64, i64* %3
ret i64 %27
}

LLVM IR (-O2):
define i64 @quotient(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = tail call i64 @pow(i32 2, i32 3)
%6 = sub nsw i64 0, %5
%7 = icmp eq i64 %6, %0
%8 = icmp eq i64 %1, -1
%9 = and i1 %8, %7
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = sdiv i64 %0, %1
br label %12
12: ; preds = %4, %2, %10
%13 = phi i64 [ %11, %10 ], [ -1, %2 ], [ %0, %4 ]
ret i64 %13
}