#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 */
struct taskset {
  int dummy;
};

/* Variables and functions */
int taskset_parse(struct taskset *, char const *);
int taskset_verify(struct taskset *);
int taskset_read(struct taskset *self, const char *name) {
  if (!self || !name)
    return -1;
  if (taskset_parse(self, name) == -1)
    return -1;
  return taskset_verify(self);
}


x86 assembly (clang, -O0):
<taskset_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <taskset_read+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1152 <taskset_read+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <taskset_read+0x60>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <taskset_parse@plt>
cmp    $0xffffffff,%eax
jne    1174 <taskset_read+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <taskset_read+0x60>
mov    -0x10(%rbp),%rdi
call   1040 <taskset_verify@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<taskset_read>:
push   %rbx
test   %rdi,%rdi
je     1141 <taskset_read+0x21>
test   %rsi,%rsi
je     1141 <taskset_read+0x21>
mov    %rdi,%rbx
call   1030 <taskset_parse@plt>
cmp    $0xffffffff,%eax
je     1141 <taskset_read+0x21>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <taskset_verify@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.taskset = type { i32 }
define i32 @taskset_read(%struct.taskset* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.taskset*
%5 = alloca i8*
store %struct.taskset* %0, %struct.taskset** %4
store i8* %1, i8** %5
%6 = load %struct.taskset*, %struct.taskset** %4
%7 = icmp ne %struct.taskset* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %8, %2
store i32 -1, i32* %3
br label %21
12: ; preds = %8
%13 = load %struct.taskset*, %struct.taskset** %4
%14 = load i8*, i8** %5
%15 = call i32 @taskset_parse(%struct.taskset* %13, i8* %14)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 -1, i32* %3
br label %21
18: ; preds = %12
%19 = load %struct.taskset*, %struct.taskset** %4
%20 = call i32 @taskset_verify(%struct.taskset* %19)
store i32 %20, i32* %3
br label %21
21: ; preds = %18, %17, %11
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
%struct.taskset = type { i32 }
define i32 @taskset_read(%struct.taskset* %0, i8* %1) {
%3 = icmp ne %struct.taskset* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = tail call i32 @taskset_parse(%struct.taskset* %0, i8* %1)
%8 = icmp eq i32 %7, -1
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @taskset_verify(%struct.taskset* %0)
br label %11
11: ; preds = %6, %2, %9
%12 = phi i32 [ %10, %9 ], [ -1, %2 ], [ -1, %6 ]
ret i32 %12
}