#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*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int a[4] = {0}, i, n;
  for (i = 0; i < 4; i++) {
    a[i] = 1;
    if (((a[1] + a[3]) == 1) && ((a[1] + a[2]) == 1) && ((a[0] + a[1]) == 1) &&
        (a[3] != 1))
      break;
    else
      a[i] = 0;
  }
  printf("thief is No. %d\n", i + 1);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    11ce <main+0x9e>
movslq -0x24(%rbp),%rax
movl   $0x1,-0x20(%rbp,%rax,4)
mov    -0x1c(%rbp),%eax
add    -0x14(%rbp),%eax
cmp    $0x1,%eax
jne    11af <main+0x7f>
mov    -0x1c(%rbp),%eax
add    -0x18(%rbp),%eax
cmp    $0x1,%eax
jne    11af <main+0x7f>
mov    -0x20(%rbp),%eax
add    -0x1c(%rbp),%eax
cmp    $0x1,%eax
jne    11af <main+0x7f>
cmpl   $0x1,-0x14(%rbp)
je     11af <main+0x7f>
jmp    11ce <main+0x9e>
movslq -0x24(%rbp),%rax
movl   $0x0,-0x20(%rbp,%rax,4)
jmp    11c0 <main+0x90>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115d <main+0x2d>
mov    -0x24(%rbp),%esi
add    $0x1,%esi
lea    0xe25(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"thief is No. %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i32]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [4 x i32]* %6 to i8*
store i32 0, i32* %7
br label %10
10: ; preds = %47, %2
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 4
br i1 %12, label %13, label %50
13: ; preds = %10
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 %15
store i32 1, i32* %16
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 1
%18 = load i32, i32* %17
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 3
%20 = load i32, i32* %19
%21 = add nsw i32 %18, %20
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %42
23: ; preds = %13
%24 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 1
%25 = load i32, i32* %24
%26 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 2
%27 = load i32, i32* %26
%28 = add nsw i32 %25, %27
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %42
30: ; preds = %23
%31 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%32 = load i32, i32* %31
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 1
%34 = load i32, i32* %33
%35 = add nsw i32 %32, %34
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %42
37: ; preds = %30
%38 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 3
%39 = load i32, i32* %38
%40 = icmp ne i32 %39, 1
br i1 %40, label %41, label %42
41: ; preds = %37
br label %50
42: ; preds = %37, %30, %23, %13
%43 = load i32, i32* %7
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 %44
store i32 0, i32* %45
br label %46
46: ; preds = %42
br label %47
47: ; preds = %46
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 1
store i32 %49, i32* %7
br label %10
50: ; preds = %41, %10
%51 = load i32, i32* %7
%52 = add nsw i32 %51, 1
%53 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %52)
%54 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"thief is No. %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 2)
%4 = tail call i32 (...) @getchar()
ret i32 0
}