#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*/ cmp_str(char *, char *, int);
char nondet_char();
int main() {
  char a[3];
  char b[3];
  a[0] = 2;
  b[0] = 2;
  for (int i = 1; i < 3; i++) {
    a[i] = nondet_char();
    b[i] = nondet_char();
  }
  cmp_str(a, b, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x2,-0x7(%rbp)
movb   $0x2,-0xa(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1178 <main+0x58>
mov    $0x0,%al
call   1030 <nondet_char@plt>
mov    %al,%cl
movslq -0x10(%rbp),%rax
mov    %cl,-0x7(%rbp,%rax,1)
mov    $0x0,%al
call   1030 <nondet_char@plt>
mov    %al,%cl
movslq -0x10(%rbp),%rax
mov    %cl,-0xa(%rbp,%rax,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113e <main+0x1e>
lea    -0x7(%rbp),%rdi
lea    -0xa(%rbp),%rsi
mov    $0x3,%edx
call   1040 <cmp_str@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x2,0x5(%rsp)
movb   $0x2,0x2(%rsp)
xor    %eax,%eax
call   1030 <nondet_char@plt>
mov    %al,0x6(%rsp)
xor    %eax,%eax
call   1030 <nondet_char@plt>
mov    %al,0x3(%rsp)
xor    %eax,%eax
call   1030 <nondet_char@plt>
mov    %al,0x7(%rsp)
xor    %eax,%eax
call   1030 <nondet_char@plt>
mov    %al,0x4(%rsp)
lea    0x5(%rsp),%rdi
lea    0x2(%rsp),%rsi
mov    $0x3,%edx
call   1040 <cmp_str@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = alloca [3 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
store i8 2, i8* %5
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
store i8 2, i8* %6
store i32 1, i32* %4
br label %7
7: ; preds = %19, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = call signext i8 (...) @nondet_char()
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 %13
store i8 %11, i8* %14
%15 = call signext i8 (...) @nondet_char()
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 %17
store i8 %15, i8* %18
br label %19
19: ; preds = %10
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %7
22: ; preds = %7
%23 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%24 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%25 = call i32 @cmp_str(i8* %23, i8* %24, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
store i8 2, i8* %3
store i8 2, i8* %4
%5 = tail call signext i8 (...) @nondet_char()
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 1
store i8 %5, i8* %6
%7 = tail call signext i8 (...) @nondet_char()
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
store i8 %7, i8* %8
%9 = tail call signext i8 (...) @nondet_char()
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 2
store i8 %9, i8* %10
%11 = tail call signext i8 (...) @nondet_char()
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
store i8 %11, i8* %12
%13 = call i32 @cmp_str(i8* %3, i8* %4, i32 3)
ret i32 0
}