#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*/ printf(char *, char const *, char const *);
int /*<<< orphan*/ s_test_ng_(char const *, char const *, int);
int /*<<< orphan*/ s_test_ok_(char const *, char const *, int);
scalar_t__ strcmp(char const *, char const *);
void s_test_str_eq_(const char *a, const char *b, const char *msg,
                    const char *file, int lineno) {
  if (strcmp(a, b) == 0) {
    s_test_ok_(msg, file, lineno);
  } else {
    s_test_ng_(msg, file, lineno);
    printf("\t\t[%s]!=[%s]\n", a, b);
  }
}


x86 assembly (clang, -O0):
<s_test_str_eq_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1188 <s_test_str_eq_+0x48>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1050 <s_test_ok_@plt>
jmp    11ac <s_test_str_eq_+0x6c>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1060 <s_test_ng_@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe59(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_test_str_eq_>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <strcmp@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
test   %rax,%rax
je     1189 <s_test_str_eq_+0x49>
call   1060 <s_test_ng_@plt>
lea    0xe8a(%rip),%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <s_test_ok_@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"\09\09[%s]!=[%s]\0A\00"
define void @s_test_str_eq_(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = tail call i64 @strcmp(i8* %0, i8* %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @s_test_ok_(i8* %2, i8* %3, i32 %4)
br label %13
10: ; preds = %5
%11 = tail call i32 @s_test_ng_(i8* %2, i8* %3, i32 %4)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %13
13: ; preds = %10, %8
ret void
}