#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 A(int);
int B(int);
int C(int);
int D(int);
int /*<<< orphan*/ assert(int);
int main(int argc, char *argv[]) {
  int x = 0x87654321;
  assert(A(x) == 17 * x);
  assert(B(x) == -7 * x);
  assert(C(x) == 60 * x);
  assert(D(x) == -112 * x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x87654321,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1070 <A@plt>
imul   $0x11,-0x14(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x14(%rbp),%edi
call   1040 <B@plt>
imul   $0xfffffff9,-0x14(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x14(%rbp),%edi
call   1060 <C@plt>
imul   $0x3c,-0x14(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x14(%rbp),%edi
call   1030 <D@plt>
imul   $0xffffff90,-0x14(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x87654321,%edi
call   1070 <A@plt>
xor    %edi,%edi
cmp    $0xfdb97531,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x87654321,%edi
call   1040 <B@plt>
xor    %edi,%edi
cmp    $0x4c3b2a19,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x87654321,%edi
call   1060 <C@plt>
xor    %edi,%edi
cmp    $0xbbbbbbbc,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x87654321,%edi
call   1030 <D@plt>
xor    %edi,%edi
cmp    $0xc3b2a190,%eax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -2023406815, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @A(i32 %7)
%9 = load i32, i32* %6
%10 = mul nsw i32 17, %9
%11 = icmp eq i32 %8, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %6
%15 = call i32 @B(i32 %14)
%16 = load i32, i32* %6
%17 = mul nsw i32 -7, %16
%18 = icmp eq i32 %15, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32, i32* %6
%22 = call i32 @C(i32 %21)
%23 = load i32, i32* %6
%24 = mul nsw i32 60, %23
%25 = icmp eq i32 %22, %24
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = load i32, i32* %6
%29 = call i32 @D(i32 %28)
%30 = load i32, i32* %6
%31 = mul nsw i32 -112, %30
%32 = icmp eq i32 %29, %31
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @A(i32 -2023406815)
%4 = icmp eq i32 %3, -38177487
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @B(i32 -2023406815)
%8 = icmp eq i32 %7, 1278945817
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @C(i32 -2023406815)
%12 = icmp eq i32 %11, -1145324612
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 @D(i32 -2023406815)
%16 = icmp eq i32 %15, -1011703408
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
ret i32 0
}