#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*/ natcmp(char *, char *);
int normalize(int /*<<< orphan*/);
int /*<<< orphan*/ opname(int);
int /*<<< orphan*/ tracef(char *, char *, int, char *, int /*<<< orphan*/,
                          char *, int /*<<< orphan*/);
void test(char *file, int line, char *a, int exp, char *b) {
  int ret = normalize(natcmp(a, b));
  if (ret == exp)
    return;
  tracef("%s:%i: FAIL \"%s\" %s \"%s\" got %s\n", file, line, a, opname(exp), b,
         opname(ret));
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <natcmp@plt>
mov    %eax,%edi
call   1040 <normalize@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1182 <test+0x42>
jmp    11d5 <test+0x95>
mov    -0x8(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x1c(%rbp),%edi
call   1060 <opname@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x2c(%rbp),%edi
call   1060 <opname@plt>
mov    -0x58(%rbp),%rsi
mov    -0x4c(%rbp),%edx
mov    -0x48(%rbp),%rcx
mov    -0x3c(%rbp),%r8d
mov    -0x38(%rbp),%r9
lea    0xe33(%rip),%rdi
mov    %eax,(%rsp)
call   1050 <tracef@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %ecx,%ebp
mov    %rdx,%r13
mov    %esi,%r15d
mov    %rdi,%r12
mov    %rdx,%rdi
mov    %r8,%rsi
call   1030 <natcmp@plt>
mov    %eax,%edi
call   1040 <normalize@plt>
cmp    %ebp,%eax
je     119f <test+0x5f>
mov    %eax,%ebx
mov    %ebp,%edi
call   1060 <opname@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1060 <opname@plt>
mov    %eax,(%rsp)
lea    0xe75(%rip),%rdi
mov    %r12,%rsi
mov    %r15d,%edx
mov    %r13,%rcx
mov    %ebp,%r8d
mov    %r14,%r9
call   1050 <tracef@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"%s:%i: FAIL \22%s\22 %s \22%s\22 got %s\0A\00"
define void @test(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%12 = load i8*, i8** %8
%13 = load i8*, i8** %10
%14 = call i32 @natcmp(i8* %12, i8* %13)
%15 = call i32 @normalize(i32 %14)
store i32 %15, i32* %11
%16 = load i32, i32* %11
%17 = load i32, i32* %9
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %5
br label %30
20: ; preds = %5
%21 = load i8*, i8** %6
%22 = load i32, i32* %7
%23 = load i8*, i8** %8
%24 = load i32, i32* %9
%25 = call i32 @opname(i32 %24)
%26 = load i8*, i8** %10
%27 = load i32, i32* %11
%28 = call i32 @opname(i32 %27)
%29 = call i32 @tracef(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %21, i32 %22, i8* %23, i32 %25, i8* %26, i32 %28)
br label %30
30: ; preds = %20, %19
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"%s:%i: FAIL \22%s\22 %s \22%s\22 got %s\0A\00"
define void @test(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = tail call i32 @natcmp(i8* %2, i8* %4)
%7 = tail call i32 @normalize(i32 %6)
%8 = icmp eq i32 %7, %3
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = tail call i32 @opname(i32 %3)
%11 = tail call i32 @opname(i32 %7)
%12 = tail call i32 @tracef(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i8* %2, i32 %10, i8* %4, i32 %11)
br label %13
13: ; preds = %5, %9
ret void
}