#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*/ free(int *);
int /*<<< orphan*/ lint_to_binary(long, int *);
int *malloc(int);
int good_pixel(long error_code) {
  int *bin_error;
  bin_error = malloc(32 * sizeof(int));
  lint_to_binary(error_code, bin_error);
  if ((bin_error[27] == 0) && (bin_error[7] == 0)) {
    free(bin_error);
    return 1;
  } else {
    free(bin_error);
    return 0;
  }
}


x86 assembly (clang, -O0):
<good_pixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x80,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <lint_to_binary@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x0,0x6c(%rax)
jne    1188 <good_pixel+0x58>
mov    -0x18(%rbp),%rax
cmpl   $0x0,0x1c(%rax)
jne    1188 <good_pixel+0x58>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    1198 <good_pixel+0x68>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<good_pixel>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbp
mov    $0x80,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
mov    %rax,%rsi
call   1050 <lint_to_binary@plt>
cmpl   $0x0,0x6c(%rbx)
jne    115a <good_pixel+0x2a>
cmpl   $0x0,0x1c(%rbx)
je     116d <good_pixel+0x3d>
xor    %ebp,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x1,%ebp
jmp    115c <good_pixel+0x2c>

LLVM IR (-O0):
define i32 @good_pixel(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
%5 = call i32* @malloc(i32 128)
store i32* %5, i32** %4
%6 = load i64, i64* %3
%7 = load i32*, i32** %4
%8 = call i32 @lint_to_binary(i64 %6, i32* %7)
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 27
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %1
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 7
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i32*, i32** %4
%20 = call i32 @free(i32* %19)
store i32 1, i32* %2
br label %24
21: ; preds = %13, %1
%22 = load i32*, i32** %4
%23 = call i32 @free(i32* %22)
store i32 0, i32* %2
br label %24
24: ; preds = %21, %18
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @good_pixel(i64 %0) {
%2 = tail call i32* @malloc(i32 128)
%3 = tail call i32 @lint_to_binary(i64 %0, i32* %2)
%4 = getelementptr inbounds i32, i32* %2, i64 27
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = getelementptr inbounds i32, i32* %2, i64 7
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %7, %1
br label %12
12: ; preds = %7, %11
%13 = phi i32 [ 0, %11 ], [ 1, %7 ]
%14 = tail call i32 @free(i32* %2)
ret i32 %13
}