#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*/ myputs(char *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puthex32(unsigned int);
void test(char *what, unsigned expected, unsigned got) {
  myputs(what);
  puthex32(expected);
  myputs(got == expected ? " == " : " != ");
  puthex32(got);
  myputs(got == expected ? " OK" : " FAILED!");
  putchar('\n');
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <myputs@plt>
mov    -0xc(%rbp),%edi
call   1050 <puthex32@plt>
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
lea    0xea5(%rip),%rdi
lea    0xe99(%rip),%rax
cmp    %edx,%ecx
cmove  %rax,%rdi
call   1040 <myputs@plt>
mov    -0x10(%rbp),%edi
call   1050 <puthex32@plt>
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
lea    0xe87(%rip),%rdi
lea    0xe7c(%rip),%rax
cmp    %edx,%ecx
cmove  %rax,%rdi
call   1040 <myputs@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1040 <myputs@plt>
mov    %ebp,%edi
call   1050 <puthex32@plt>
cmp    %ebp,%ebx
lea    0xeb4(%rip),%rax
lea    0xeb2(%rip),%rdi
cmove  %rax,%rdi
lea    0xeac(%rip),%rax
lea    0xea9(%rip),%rbp
cmove  %rax,%rbp
call   1040 <myputs@plt>
mov    %ebx,%edi
call   1050 <puthex32@plt>
mov    %rbp,%rdi
call   1040 <myputs@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" == \00"
@.str.1 = [5 x i8] c" != \00"
@.str.2 = [4 x i8] c" OK\00"
@.str.3 = [9 x i8] c" FAILED!\00"
define void @test(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 @myputs(i8* %7)
%9 = load i32, i32* %5
%10 = call i32 @puthex32(i32 %9)
%11 = load i32, i32* %6
%12 = load i32, i32* %5
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%16 = call i32 @myputs(i8* %15)
%17 = load i32, i32* %6
%18 = call i32 @puthex32(i32 %17)
%19 = load i32, i32* %6
%20 = load i32, i32* %5
%21 = icmp eq i32 %19, %20
%22 = zext i1 %21 to i64
%23 = select i1 %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0)
%24 = call i32 @myputs(i8* %23)
%25 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" == \00"
@.str.1 = [5 x i8] c" != \00"
@.str.2 = [4 x i8] c" OK\00"
@.str.3 = [9 x i8] c" FAILED!\00"
define void @test(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @myputs(i8* %0)
%5 = tail call i32 @puthex32(i32 %1)
%6 = icmp eq i32 %2, %1
%7 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @myputs(i8* %7)
%9 = tail call i32 @puthex32(i32 %2)
%10 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0)
%11 = tail call i32 @myputs(i8* %10)
%12 = tail call i32 @putchar(i8 signext 10)
ret void
}