#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*/ test_str(char const *, char const *, unsigned int);
void test_known_strings2(unsigned hash_id, const char **ptr) {
  for (; ptr[0] && ptr[1]; ptr += 2) {
    test_str(ptr[0], ptr[1], hash_id);
  }
}


x86 assembly (clang, -O0):
<test_known_strings2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0x11(%rbp)
je     1141 <test_known_strings2+0x31>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1151 <test_known_strings2+0x41>
jmp    1179 <test_known_strings2+0x69>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x4(%rbp),%edx
call   1030 <test_str@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
jmp    111f <test_known_strings2+0xf>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_known_strings2>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    (%rsi),%rdi
test   %rdi,%rdi
je     114c <test_known_strings2+0x3c>
mov    %rsi,%rbx
add    $0x10,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    -0x8(%rbx),%rsi
test   %rsi,%rsi
je     114c <test_known_strings2+0x3c>
mov    %ebp,%edx
call   1030 <test_str@plt>
mov    (%rbx),%rdi
add    $0x10,%rbx
test   %rdi,%rdi
jne    1130 <test_known_strings2+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @test_known_strings2(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
br label %5
5: ; preds = %26, %2
%6 = load i8**, i8*** %4
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = icmp ne i8* %13, null
br label %15
15: ; preds = %10, %5
%16 = phi i1 [ false, %5 ], [ %14, %10 ]
br i1 %16, label %17, label %29
17: ; preds = %15
%18 = load i8**, i8*** %4
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = load i8**, i8*** %4
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = load i32, i32* %3
%25 = call i32 @test_str(i8* %20, i8* %23, i32 %24)
br label %26
26: ; preds = %17
%27 = load i8**, i8*** %4
%28 = getelementptr inbounds i8*, i8** %27, i64 2
store i8** %28, i8*** %4
br label %5
29: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @test_known_strings2(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8* [ %14, %11 ], [ %3, %2 ]
%7 = phi i8** [ %13, %11 ], [ %1, %2 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %16, label %11
11: ; preds = %5
%12 = tail call i32 @test_str(i8* %6, i8* %9, i32 %0)
%13 = getelementptr inbounds i8*, i8** %7, i64 2
%14 = load i8*, i8** %13
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
ret void
}