#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 */
scalar_t__ strcmp(char const *, char *);
int /*<<< orphan*/ testerror(char *);
char *testmsg(char *);
void multi() {
  const char *p, *q;
  p = testmsg("message 1st");
  q = testmsg("message 2nd");
  do {
    if (!(strcmp(p, "message 1st") == 0)) {
      testerror("x");
    }
  } while (0);
  do {
    if (!(strcmp(q, "message 2nd") == 0)) {
      testerror("x");
    }
  } while (0);
}


x86 assembly (clang, -O0):
<multi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <testmsg@plt>
mov    %rax,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <testmsg@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9d(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     117e <multi+0x4e>
lea    0xe9f(%rip),%rdi
call   1040 <testerror@plt>
jmp    1183 <multi+0x53>
jmp    1188 <multi+0x58>
mov    -0x10(%rbp),%rdi
lea    0xe79(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     11ae <multi+0x7e>
lea    0xe6f(%rip),%rdi
call   1040 <testerror@plt>
jmp    11b3 <multi+0x83>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multi>:
push   %r15
push   %r14
push   %rbx
lea    0xec4(%rip),%r14
mov    %r14,%rdi
call   1030 <testmsg@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
call   1030 <testmsg@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1172 <multi+0x42>
lea    0xeab(%rip),%rdi
call   1040 <testerror@plt>
lea    0xe93(%rip),%rsi
mov    %r15,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1197 <multi+0x67>
lea    0xe8b(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <testerror@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"message 1st\00"
@.str.1 = [12 x i8] c"message 2nd\00"
@.str.2 = [2 x i8] c"x\00"
define void @multi() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @testmsg(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %1
%4 = call i8* @testmsg(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i8* %4, i8** %2
br label %5
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = call i32 @testerror(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %5
br label %12
12: ; preds = %11
br label %13
13: ; preds = %12
%14 = load i8*, i8** %2
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %13
%18 = call i32 @testerror(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %17, %13
br label %20
20: ; preds = %19
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"message 1st\00"
@.str.1 = [12 x i8] c"message 2nd\00"
@.str.2 = [2 x i8] c"x\00"
define void @multi() {
%1 = tail call i8* @testmsg(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* @testmsg(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @testerror(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %0, %5
%8 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @testerror(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
ret void
}