#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 */
struct clad_test {
  int dummy;
};

/* Variables and functions */
struct clad_test *clad_test_assert(struct clad_test *, int, char *, char *,
                                   char *, char const *);
scalar_t__ strcmp(char *, char *);
struct clad_test *clad_test_streq(struct clad_test *test, char *s1, char *s2,
                                  const char *explain) {
  return clad_test_assert(test, strcmp(s1, s2) == 0,
                          "Strings should be equal: >%s< >%s<; %s ", s1, s2,
                          explain);
}


x86 assembly (clang, -O0):
<clad_test_streq>:
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    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    -0x28(%rbp),%rdi
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xe90(%rip),%rdx
call   1040 <clad_test_assert@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_test_streq>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r12
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <strcmp@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
lea    0xeb1(%rip),%rdx
mov    %r12,%rdi
mov    %rbx,%rcx
mov    %r15,%r8
mov    %r14,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <clad_test_assert@plt>

LLVM IR (-O0):
%struct.clad_test = type { i32 }
@.str = [40 x i8] c"Strings should be equal: >%s< >%s<; %s \00"
define %struct.clad_test* @clad_test_streq(%struct.clad_test* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.clad_test*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.clad_test* %0, %struct.clad_test** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load %struct.clad_test*, %struct.clad_test** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = call i64 @strcmp(i8* %10, i8* %11)
%13 = icmp eq i64 %12, 0
%14 = zext i1 %13 to i32
%15 = load i8*, i8** %6
%16 = load i8*, i8** %7
%17 = load i8*, i8** %8
%18 = call %struct.clad_test* @clad_test_assert(%struct.clad_test* %9, i32 %14, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16, i8* %17)
ret %struct.clad_test* %18
}

LLVM IR (-O2):
%struct.clad_test = type { i32 }
@.str = [40 x i8] c"Strings should be equal: >%s< >%s<; %s \00"
define %struct.clad_test* @clad_test_streq(%struct.clad_test* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i64 @strcmp(i8* %1, i8* %2)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call %struct.clad_test* @clad_test_assert(%struct.clad_test* %0, i32 %7, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret %struct.clad_test* %8
}