#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*/ t_diag(char *, int, int, int);
int /*<<< orphan*/ t_fail(char *, char const *);
int /*<<< orphan*/ t_pass(char *, char const *);
int ok_int(int a, int b, const char *name) {
  if (a == b) {
    t_pass("%s", name);
    return 1;
  }
  t_fail("%s", name);
  t_diag("%d != %d. delta: %d", a, b, (((a > b ? a : b) - ((a < b ? a : b)))));
  return 0;
}


x86 assembly (clang, -O0):
<ok_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    116a <ok_int+0x3a>
mov    -0x18(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <t_pass@plt>
movl   $0x1,-0x4(%rbp)
jmp    11e7 <ok_int+0xb7>
mov    -0x18(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1050 <t_fail@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    119d <ok_int+0x6d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    11a3 <ok_int+0x73>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c0 <ok_int+0x90>
mov    -0x8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    11c6 <ok_int+0x96>
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%esi
mov    -0x28(%rbp),%ecx
mov    -0x2c(%rbp),%eax
sub    %eax,%ecx
lea    0xe28(%rip),%rdi
call   1040 <t_diag@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ok_int>:
push   %rbp
push   %rbx
push   %rax
cmp    %esi,%edi
jne    114d <ok_int+0x1d>
lea    0xec2(%rip),%rdi
mov    %rdx,%rsi
call   1030 <t_pass@plt>
mov    $0x1,%eax
jmp    1180 <ok_int+0x50>
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xea8(%rip),%rdi
mov    %rdx,%rsi
call   1050 <t_fail@plt>
cmp    %ebx,%ebp
mov    %ebx,%ecx
cmovg  %ebp,%ecx
mov    %ebx,%eax
cmovl  %ebp,%eax
sub    %eax,%ecx
lea    0xe8e(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <t_diag@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [20 x i8] c"%d != %d. delta: %d\00"
define i32 @ok_int(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i8*, i8** %7
%13 = call i32 @t_pass(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 1, i32* %4
br label %39
14: ; preds = %3
%15 = load i8*, i8** %7
%16 = call i32 @t_fail(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = icmp sgt i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %14
%23 = load i32, i32* %5
br label %26
24: ; preds = %14
%25 = load i32, i32* %6
br label %26
26: ; preds = %24, %22
%27 = phi i32 [ %23, %22 ], [ %25, %24 ]
%28 = load i32, i32* %5
%29 = load i32, i32* %6
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %33
31: ; preds = %26
%32 = load i32, i32* %5
br label %35
33: ; preds = %26
%34 = load i32, i32* %6
br label %35
35: ; preds = %33, %31
%36 = phi i32 [ %32, %31 ], [ %34, %33 ]
%37 = sub nsw i32 %27, %36
%38 = call i32 @t_diag(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %17, i32 %18, i32 %37)
store i32 0, i32* %4
br label %39
39: ; preds = %35, %11
%40 = load i32, i32* %4
ret i32 %40
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [20 x i8] c"%d != %d. delta: %d\00"
define i32 @ok_int(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %0, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @t_pass(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %15
7: ; preds = %3
%8 = tail call i32 @t_fail(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = icmp sgt i32 %0, %1
%10 = select i1 %9, i32 %0, i32 %1
%11 = icmp slt i32 %0, %1
%12 = select i1 %11, i32 %0, i32 %1
%13 = sub nsw i32 %10, %12
%14 = tail call i32 @t_diag(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1, i32 %13)
br label %15
15: ; preds = %7, %5
%16 = phi i32 [ 1, %5 ], [ 0, %7 ]
ret i32 %16
}