#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *, char *);
scalar_t__ strcmp(char *, char const *);
bool response_check_moved_object(char *target, const char *objname) {
  char origin[2048];
  FILE *db_moved = fopen("default/.moved", "r");
  while (!feof(db_moved)) {
    fscanf(db_moved, "%s %s ", origin, target);
    if (strcmp(origin, objname) == 0)
      return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<response_check_moved_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x830,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    0xea6(%rip),%rdi
lea    0xeae(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x828(%rbp)
mov    -0x828(%rbp),%rdi
call   1050 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    118e <response_check_moved_object+0x4e>
jmp    11d7 <response_check_moved_object+0x97>
mov    -0x828(%rbp),%rdi
lea    -0x820(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe6a(%rip),%rsi
call   1030 <fscanf@plt>
lea    -0x820(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11d2 <response_check_moved_object+0x92>
movl   $0x1,-0x4(%rbp)
jmp    11de <response_check_moved_object+0x9e>
jmp    116d <response_check_moved_object+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x830,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<response_check_moved_object>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xea3(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xe9e(%rip),%r12
mov    %rsp,%r13
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <feof@plt>
test   %eax,%eax
jne    11b4 <response_check_moved_object+0x74>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %r15,%rcx
call   1030 <fscanf@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1180 <response_check_moved_object+0x40>
mov    $0x1,%eax
jmp    11b6 <response_check_moved_object+0x76>
xor    %eax,%eax
add    $0x800,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"default/.moved\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [7 x i8] c"%s %s \00"
define i32 @response_check_moved_object(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [2048 x i8]
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %7
br label %9
9: ; preds = %24, %2
%10 = load i32*, i32** %7
%11 = call i32 @feof(i32* %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %25
14: ; preds = %9
%15 = load i32*, i32** %7
%16 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%17 = load i8*, i8** %4
%18 = call i32 @fscanf(i32* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %16, i8* %17)
%19 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%20 = load i8*, i8** %5
%21 = call i64 @strcmp(i8* %19, i8* %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %14
store i32 1, i32* %3
br label %26
24: ; preds = %14
br label %9
25: ; preds = %9
store i32 0, i32* %3
br label %26
26: ; preds = %25, %23
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@.str = [15 x i8] c"default/.moved\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [7 x i8] c"%s %s \00"
define i32 @response_check_moved_object(i8* %0, i8* %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %9, %2
%7 = call i32 @feof(i32* %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = call i32 @fscanf(i32* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %4, i8* %0)
%11 = call i64 @strcmp(i8* %4, i8* %1)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %9
%14 = phi i32 [ 1, %9 ], [ 0, %6 ]
ret i32 %14
}