#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*/ DEBUG(char *);
int /*<<< orphan*/ get_string(char *, char *, int);
int /*<<< orphan*/ locate_room(char *, int, char *);
scalar_t__ strncmp(char *, char *, int);
char *strstr(char *, char *);
void parse_window(char *line) {
  char name[256];
  DEBUG("parse_window");
  if (strncmp(line, "You see that ", 12))
    return;
  get_string(line + 12, name, 256);
  line = strstr(line, " is at ");
  if (!line)
    return;
  line += 7;
  locate_room(line, 1, name);
}


x86 assembly (clang, -O0):
<parse_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xe9a(%rip),%rdi
call   1030 <DEBUG@plt>
mov    -0x8(%rbp),%rdi
lea    0xe97(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     118f <parse_window+0x3f>
jmp    11ed <parse_window+0x9d>
mov    -0x8(%rbp),%rdi
add    $0xc,%rdi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1050 <get_string@plt>
mov    -0x8(%rbp),%rdi
lea    0xe68(%rip),%rsi
call   1070 <strstr@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    11cc <parse_window+0x7c>
jmp    11ed <parse_window+0x9d>
mov    -0x8(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x110(%rbp),%rdx
mov    $0x1,%esi
call   1060 <locate_room@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_window>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rbx
lea    0xe9e(%rip),%rdi
call   1030 <DEBUG@plt>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
mov    $0xc,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    11b9 <parse_window+0x69>
lea    0xc(%rbx),%rdi
mov    %rsp,%rsi
mov    $0x100,%edx
call   1050 <get_string@plt>
lea    0xe83(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strstr@plt>
test   %rax,%rax
je     11b9 <parse_window+0x69>
add    $0x7,%rax
mov    %rsp,%rdx
mov    %rax,%rdi
mov    $0x1,%esi
call   1060 <locate_room@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"parse_window\00"
@.str.1 = [14 x i8] c"You see that \00"
@.str.2 = [8 x i8] c" is at \00"
define void @parse_window(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = call i32 @DEBUG(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i64 @strncmp(i8* %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 12)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %25
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 12
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%13 = call i32 @get_string(i8* %11, i8* %12, i32 256)
%14 = load i8*, i8** %2
%15 = call i8* @strstr(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
store i8* %15, i8** %2
%16 = load i8*, i8** %2
%17 = icmp ne i8* %16, null
br i1 %17, label %19, label %18
18: ; preds = %9
br label %25
19: ; preds = %9
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 7
store i8* %21, i8** %2
%22 = load i8*, i8** %2
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%24 = call i32 @locate_room(i8* %22, i32 1, i8* %23)
br label %25
25: ; preds = %19, %18, %8
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"parse_window\00"
@.str.1 = [14 x i8] c"You see that \00"
@.str.2 = [8 x i8] c" is at \00"
define void @parse_window(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @DEBUG(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 12)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = getelementptr inbounds i8, i8* %0, i64 12
%9 = call i32 @get_string(i8* %8, i8* %3, i32 256)
%10 = call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i8* %10, null
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = getelementptr inbounds i8, i8* %10, i64 7
%14 = call i32 @locate_room(i8* %13, i32 1, i8* %3)
br label %15
15: ; preds = %7, %1, %12
ret void
}