void more_irreducible(char *a, int b, int c) {
  if (b == 0) {
    goto L0;
  }
  if (b == 1) {
    goto L1;
  }
  while (*a) {
    if (c) {
    L0:
      a++;
    } else {
    L1:
      a--;
    }
    a++;
  }
}


x86 assembly (clang, -O0):
<more_irreducible>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111d <more_irreducible+0x1d>
jmp    114d <more_irreducible+0x4d>
cmpl   $0x1,-0xc(%rbp)
jne    112c <more_irreducible+0x2c>
jmp    1163 <more_irreducible+0x63>
jmp    1131 <more_irreducible+0x31>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1180 <more_irreducible+0x80>
cmpl   $0x0,-0x10(%rbp)
je     115e <more_irreducible+0x5e>
jmp    114d <more_irreducible+0x4d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116f <more_irreducible+0x6f>
jmp    1163 <more_irreducible+0x63>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1131 <more_irreducible+0x31>
pop    %rbp
ret

x86 assembly (clang, -O2):
<more_irreducible>:
test   %esi,%esi
je     1112 <more_irreducible+0x12>
cmp    $0x1,%esi
je     111c <more_irreducible+0x1c>
cmpb   $0x0,(%rdi)
je     1126 <more_irreducible+0x26>
test   %edx,%edx
je     111c <more_irreducible+0x1c>
add    $0x1,%rdi
add    $0x1,%rdi
jmp    1109 <more_irreducible+0x9>
add    $0xffffffffffffffff,%rdi
add    $0x1,%rdi
jmp    1109 <more_irreducible+0x9>
ret

LLVM IR (-O0):
define void @more_irreducible(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
br label %23
10: ; preds = %3
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %10
br label %27
14: ; preds = %10
br label %15
15: ; preds = %30, %14
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = icmp ne i8 %17, 0
br i1 %18, label %19, label %33
19: ; preds = %15
%20 = load i32, i32* %6
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %19
br label %23
23: ; preds = %22, %9
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %4
br label %30
26: ; preds = %19
br label %27
27: ; preds = %26, %13
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i32 -1
store i8* %29, i8** %4
br label %30
30: ; preds = %27, %23
%31 = load i8*, i8** %4
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %4
br label %15
33: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @more_irreducible(i8* nocapture %0, i32 %1, i32 %2) {
switch i32 %1, label %4 [
i32 0, label %10
i32 1, label %13
]
4: ; preds = %3, %16
%5 = phi i8* [ %18, %16 ], [ %0, %3 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %19, label %8
8: ; preds = %4
%9 = icmp eq i32 %2, 0
br i1 %9, label %13, label %10
10: ; preds = %3, %8
%11 = phi i8* [ %0, %3 ], [ %5, %8 ]
%12 = getelementptr inbounds i8, i8* %11, i64 1
br label %16
13: ; preds = %3, %8
%14 = phi i8* [ %5, %8 ], [ %0, %3 ]
%15 = getelementptr inbounds i8, i8* %14, i64 -1
br label %16
16: ; preds = %13, %10
%17 = phi i8* [ %12, %10 ], [ %15, %13 ]
%18 = getelementptr inbounds i8, i8* %17, i64 1
br label %4
19: ; preds = %4
ret void
}