#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 scalar_t__ u_int8_t;

/* Variables and functions */
scalar_t__ blend_2(int, int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int,
                           scalar_t__, scalar_t__);
scalar_t__ reference_blend(int, int, int);
int /*<<< orphan*/ stderr;
main() {
  int a, s, d;
  u_int8_t r0;
  u_int8_t r1;
  r0 = reference_blend(15, 100, 200);
  r1 = blend_2(15, 100, 200);
  for (a = 0; a < 256; a++) {
    for (s = 0; s < 256; s++) {
      for (d = 0; d < 256; d++) {
        r0 = reference_blend(a, s, d);
        r1 = blend_2(a, s, d);
        if (r1 != r0) {
          fprintf(stderr, "blend(s=%d,d=%d,a=%d)  r=%d  [r'=%d]\n", s, d, a, r0,
                  r1);
        }
      }
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf,%edi
mov    $0x64,%esi
mov    $0xc8,%edx
call   1050 <reference_blend@plt>
mov    %rax,-0x18(%rbp)
mov    $0xf,%edi
mov    $0x64,%esi
mov    $0xc8,%edx
call   1040 <blend_2@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1251 <main+0x111>
movl   $0x0,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jge    123e <main+0xfe>
movl   $0x0,-0x10(%rbp)
cmpl   $0x100,-0x10(%rbp)
jge    122b <main+0xeb>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <reference_blend@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <blend_2@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1218 <main+0xd8>
mov    0x2dec(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%rax
lea    0xdf1(%rip),%rsi
mov    %rax,(%rsp)
call   1030 <fprintf@plt>
jmp    121d <main+0xdd>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ae <main+0x6e>
jmp    1230 <main+0xf0>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    119a <main+0x5a>
jmp    1243 <main+0x103>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1186 <main+0x46>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0xf,%edi
mov    $0x64,%esi
mov    $0xc8,%edx
call   1050 <reference_blend@plt>
mov    $0xf,%edi
mov    $0x64,%esi
mov    $0xc8,%edx
call   1040 <blend_2@plt>
xor    %r15d,%r15d
mov    0x2e63(%rip),%r13
lea    0xe7c(%rip),%r14
jmp    119d <main+0x5d>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r15d
cmp    $0x100,%r15d
je     121a <main+0xda>
xor    %r12d,%r12d
jmp    11bd <main+0x7d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%r12d
cmp    $0x100,%r12d
je     1190 <main+0x50>
xor    %ebx,%ebx
jmp    11db <main+0x9b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x100,%ebx
je     11b0 <main+0x70>
mov    %r15d,%edi
mov    %r12d,%esi
mov    %ebx,%edx
call   1050 <reference_blend@plt>
mov    %rax,%rbp
mov    %r15d,%edi
mov    %r12d,%esi
mov    %ebx,%edx
call   1040 <blend_2@plt>
cmp    %rbp,%rax
je     11d0 <main+0x90>
mov    0x0(%r13),%edi
mov    %rax,(%rsp)
mov    %r14,%rsi
mov    %r12d,%edx
mov    %ebx,%ecx
mov    %r15d,%r8d
mov    %rbp,%r9
call   1030 <fprintf@plt>
jmp    11d0 <main+0x90>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"blend(s=%d,d=%d,a=%d) r=%d [r'=%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
%7 = call i64 @reference_blend(i32 15, i32 100, i32 200)
store i64 %7, i64* %5
%8 = call i64 @blend_2(i32 15, i32 100, i32 200)
store i64 %8, i64* %6
store i32 0, i32* %2
br label %9
9: ; preds = %49, %0
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 256
br i1 %11, label %12, label %52
12: ; preds = %9
store i32 0, i32* %3
br label %13
13: ; preds = %45, %12
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 256
br i1 %15, label %16, label %48
16: ; preds = %13
store i32 0, i32* %4
br label %17
17: ; preds = %41, %16
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 256
br i1 %19, label %20, label %44
20: ; preds = %17
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = call i64 @reference_blend(i32 %21, i32 %22, i32 %23)
store i64 %24, i64* %5
%25 = load i32, i32* %2
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = call i64 @blend_2(i32 %25, i32 %26, i32 %27)
store i64 %28, i64* %6
%29 = load i64, i64* %6
%30 = load i64, i64* %5
%31 = icmp ne i64 %29, %30
br i1 %31, label %32, label %40
32: ; preds = %20
%33 = load i32, i32* @stderr
%34 = load i32, i32* %3
%35 = load i32, i32* %4
%36 = load i32, i32* %2
%37 = load i64, i64* %5
%38 = load i64, i64* %6
%39 = call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %34, i32 %35, i32 %36, i64 %37, i64 %38)
br label %40
40: ; preds = %32, %20
br label %41
41: ; preds = %40
%42 = load i32, i32* %4
%43 = add nsw i32 %42, 1
store i32 %43, i32* %4
br label %17
44: ; preds = %17
br label %45
45: ; preds = %44
%46 = load i32, i32* %3
%47 = add nsw i32 %46, 1
store i32 %47, i32* %3
br label %13
48: ; preds = %13
br label %49
49: ; preds = %48
%50 = load i32, i32* %2
%51 = add nsw i32 %50, 1
store i32 %51, i32* %2
br label %9
52: ; preds = %9
%53 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"blend(s=%d,d=%d,a=%d) r=%d [r'=%d]\0A\00"
define i32 @main() {
%1 = tail call i64 @reference_blend(i32 15, i32 100, i32 200)
%2 = tail call i64 @blend_2(i32 15, i32 100, i32 200)
br label %3
3: ; preds = %0, %21
%4 = phi i32 [ 0, %0 ], [ %22, %21 ]
br label %5
5: ; preds = %3, %18
%6 = phi i32 [ 0, %3 ], [ %19, %18 ]
br label %7
7: ; preds = %5, %15
%8 = phi i32 [ 0, %5 ], [ %16, %15 ]
%9 = tail call i64 @reference_blend(i32 %4, i32 %6, i32 %8)
%10 = tail call i64 @blend_2(i32 %4, i32 %6, i32 %8)
%11 = icmp eq i64 %10, %9
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8, i32 %4, i64 %9, i64 %10)
br label %15
15: ; preds = %7, %12
%16 = add nuw nsw i32 %8, 1
%17 = icmp eq i32 %16, 256
br i1 %17, label %18, label %7
18: ; preds = %15
%19 = add nuw nsw i32 %6, 1
%20 = icmp eq i32 %19, 256
br i1 %20, label %21, label %5
21: ; preds = %18
%22 = add nuw nsw i32 %4, 1
%23 = icmp eq i32 %22, 256
br i1 %23, label %24, label %3
24: ; preds = %21
%25 = tail call i32 @exit(i32 0)
unreachable
}