#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__ loadCharacter(int *, int);
int stringCompare(int *s, int *t) {
  int i;
  i = 0;
  while (1)
    if (loadCharacter(s, i) == 0)
      if (loadCharacter(t, i) == 0)
        return 1;
      else
        return 0;
    else if (loadCharacter(s, i) == loadCharacter(t, i))
      i = i + 1;
    else
      return 0;
}


x86 assembly (clang, -O0):
<stringCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <loadCharacter@plt>
cmp    $0x0,%rax
jne    116b <stringCompare+0x5b>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <loadCharacter@plt>
cmp    $0x0,%rax
jne    115f <stringCompare+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    11bb <stringCompare+0xab>
movl   $0x0,-0x4(%rbp)
jmp    11bb <stringCompare+0xab>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <loadCharacter@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <loadCharacter@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jne    11a5 <stringCompare+0x95>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b1 <stringCompare+0xa1>
movl   $0x0,-0x4(%rbp)
jmp    11bb <stringCompare+0xab>
jmp    11b6 <stringCompare+0xa6>
jmp    1127 <stringCompare+0x17>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringCompare>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r12
xor    %ebp,%ebp
xor    %esi,%esi
call   1030 <loadCharacter@plt>
test   %rax,%rax
je     116e <stringCompare+0x5e>
xor    %r15d,%r15d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %ebp,%esi
call   1030 <loadCharacter@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <loadCharacter@plt>
cmp    %rax,%rbx
jne    1182 <stringCompare+0x72>
add    $0x1,%ebp
mov    %r12,%rdi
mov    %ebp,%esi
call   1030 <loadCharacter@plt>
test   %rax,%rax
jne    1140 <stringCompare+0x30>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <loadCharacter@plt>
xor    %r15d,%r15d
test   %rax,%rax
sete   %r15b
mov    %r15d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @stringCompare(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 0, i32* %6
br label %7
7: ; preds = %2, %32
%8 = load i32*, i32** %4
%9 = load i32, i32* %6
%10 = call i64 @loadCharacter(i32* %8, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %7
%13 = load i32*, i32** %5
%14 = load i32, i32* %6
%15 = call i64 @loadCharacter(i32* %13, i32 %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 1, i32* %3
br label %33
18: ; preds = %12
store i32 0, i32* %3
br label %33
19: ; preds = %7
%20 = load i32*, i32** %4
%21 = load i32, i32* %6
%22 = call i64 @loadCharacter(i32* %20, i32 %21)
%23 = load i32*, i32** %5
%24 = load i32, i32* %6
%25 = call i64 @loadCharacter(i32* %23, i32 %24)
%26 = icmp eq i64 %22, %25
br i1 %26, label %27, label %30
27: ; preds = %19
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %31
30: ; preds = %19
store i32 0, i32* %3
br label %33
31: ; preds = %27
br label %32
32: ; preds = %31
br label %7
33: ; preds = %30, %18, %17
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @stringCompare(i32* %0, i32* %1) {
%3 = tail call i64 @loadCharacter(i32* %0, i32 0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %15, %2
%6 = phi i32 [ 0, %2 ], [ %16, %15 ]
%7 = tail call i64 @loadCharacter(i32* %1, i32 %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %19
10: ; preds = %2, %15
%11 = phi i32 [ %16, %15 ], [ 0, %2 ]
%12 = tail call i64 @loadCharacter(i32* %0, i32 %11)
%13 = tail call i64 @loadCharacter(i32* %1, i32 %11)
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = add nuw nsw i32 %11, 1
%17 = tail call i64 @loadCharacter(i32* %0, i32 %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %5, label %10
19: ; preds = %10, %5
%20 = phi i32 [ %9, %5 ], [ 0, %10 ]
ret i32 %20
}