#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*/ clearSignflag(char *);
int /*<<< orphan*/ clearZeroflag(char *);
int /*<<< orphan*/ setSignflag(char *);
int /*<<< orphan*/ setZeroflag(char *);
scalar_t__ zero_test(char *);
void zsflagging(char *flags, char *acc) {
  if (zero_test(acc))
    setZeroflag(flags);
  else
    clearZeroflag(flags);
  if (acc[0] == '1')
    setSignflag(flags);
  else
    clearSignflag(flags);
}


x86 assembly (clang, -O0):
<zsflagging>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <zero_test@plt>
cmp    $0x0,%rax
je     1181 <zsflagging+0x31>
mov    -0x8(%rbp),%rdi
call   1060 <setZeroflag@plt>
jmp    118a <zsflagging+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <clearZeroflag@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x31,%eax
jne    11a8 <zsflagging+0x58>
mov    -0x8(%rbp),%rdi
call   1040 <setSignflag@plt>
jmp    11b1 <zsflagging+0x61>
mov    -0x8(%rbp),%rdi
call   1070 <clearSignflag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zsflagging>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <zero_test@plt>
mov    %r14,%rdi
test   %rax,%rax
je     1183 <zsflagging+0x33>
call   1060 <setZeroflag@plt>
cmpb   $0x31,(%rbx)
jne    118d <zsflagging+0x3d>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <setSignflag@plt>
call   1030 <clearZeroflag@plt>
cmpb   $0x31,(%rbx)
je     1174 <zsflagging+0x24>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <clearSignflag@plt>

LLVM IR (-O0):
define void @zsflagging(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i64 @zero_test(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @setZeroflag(i8* %9)
br label %14
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @clearZeroflag(i8* %12)
br label %14
14: ; preds = %11, %8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 49
br i1 %19, label %20, label %23
20: ; preds = %14
%21 = load i8*, i8** %3
%22 = call i32 @setSignflag(i8* %21)
br label %26
23: ; preds = %14
%24 = load i8*, i8** %3
%25 = call i32 @clearSignflag(i8* %24)
br label %26
26: ; preds = %23, %20
ret void
}

LLVM IR (-O2):
define void @zsflagging(i8* %0, i8* %1) {
%3 = tail call i64 @zero_test(i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @setZeroflag(i8* %0)
br label %9
7: ; preds = %2
%8 = tail call i32 @clearZeroflag(i8* %0)
br label %9
9: ; preds = %7, %5
%10 = load i8, i8* %1
%11 = icmp eq i8 %10, 49
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 @setSignflag(i8* %0)
br label %16
14: ; preds = %9
%15 = tail call i32 @clearSignflag(i8* %0)
br label %16
16: ; preds = %14, %12
ret void
}