#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 parse(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char a[6] = "12345";
  char b[6] = "32442";
  printf("%d\n", 12345 == parse(a));
  printf("%d\n", 32442 == parse(b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xebd(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xeb7(%rip),%ax
mov    %ax,-0xc(%rbp)
lea    -0xa(%rbp),%rdi
call   1040 <parse@plt>
mov    %eax,%ecx
mov    $0x3039,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1040 <parse@plt>
mov    %eax,%ecx
mov    $0x7eba,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x35,0xc(%rsp)
movl   $0x34333231,0x8(%rsp)
34
movw   $0x32,0x4(%rsp)
movl   $0x34343233,(%rsp)
lea    0x8(%rsp),%rdi
call   1040 <parse@plt>
xor    %esi,%esi
cmp    $0x3039,%eax
sete   %sil
lea    0xeae(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rsp,%rdi
call   1040 <parse@plt>
xor    %esi,%esi
cmp    $0x7eba,%eax
sete   %sil
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [6 x i8] c"12345\00"
@__const.main.b = [6 x i8] c"32442\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca [6 x i8]
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = bitcast [6 x i8]* %3 to i8*
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = call i32 @parse(i8* %6)
%8 = icmp eq i32 12345, %7
%9 = zext i1 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%12 = call i32 @parse(i8* %11)
%13 = icmp eq i32 32442, %12
%14 = zext i1 %13 to i32
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [6 x i8] c"12345\00"
@__const.main.b = [6 x i8] c"32442\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @parse(i8* %3)
%6 = icmp eq i32 %5, 12345
%7 = zext i1 %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @parse(i8* %4)
%10 = icmp eq i32 %9, 32442
%11 = zext i1 %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}