val_opt(b1, c1, b2, nn, cc) int *b1, *c1, *b2, *nn, cc;
{
  int bb;
  def_gen_by(&bb, cc);
  *b1 = bb;
  if (bb == 1) {
    val_gen_by(c1, cc);
  } else {
    *c1 = cc;
  }
  def_prf_level(&bb, cc);
  *b2 = bb;
  if (bb == 1) {
    val_prf_level(nn, cc);
  } else {
    *nn = 0;
  }
}


x86 assembly (clang, -O0):
<val_opt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1050 <def_gen_by@plt>
mov    -0x30(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x1,-0x30(%rbp)
jne    1190 <val_opt+0x50>
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    $0x0,%al
call   1060 <val_gen_by@plt>
jmp    1199 <val_opt+0x59>
mov    -0x2c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x2c(%rbp),%esi
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1040 <def_prf_level@plt>
mov    -0x30(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
cmpl   $0x1,-0x30(%rbp)
jne    11cd <val_opt+0x8d>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    $0x0,%al
call   1030 <val_prf_level@plt>
jmp    11d7 <val_opt+0x97>
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_opt>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %r8d,%ebx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
lea    0xc(%rsp),%rdi
mov    %r8d,%esi
xor    %eax,%eax
call   1050 <def_gen_by@plt>
mov    0xc(%rsp),%eax
mov    %eax,0x0(%r13)
cmp    $0x1,%eax
jne    1186 <val_opt+0x46>
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1060 <val_gen_by@plt>
jmp    118a <val_opt+0x4a>
mov    %ebx,(%r12)
lea    0xc(%rsp),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <def_prf_level@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%r15)
cmp    $0x1,%eax
jne    11b2 <val_opt+0x72>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <val_prf_level@plt>
jmp    11b9 <val_opt+0x79>
movl   $0x0,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @val_opt(i32* %0, i32* %1, i32* %2, i32* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32 %4, i32* %11
%13 = load i32, i32* %11
%14 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @def_gen_by to i32 (i32*, i32, ...)*)(i32* %12, i32 %13)
%15 = load i32, i32* %12
%16 = load i32*, i32** %7
store i32 %15, i32* %16
%17 = load i32, i32* %12
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %23
19: ; preds = %5
%20 = load i32*, i32** %8
%21 = load i32, i32* %11
%22 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_gen_by to i32 (i32*, i32, ...)*)(i32* %20, i32 %21)
br label %26
23: ; preds = %5
%24 = load i32, i32* %11
%25 = load i32*, i32** %8
store i32 %24, i32* %25
br label %26
26: ; preds = %23, %19
%27 = load i32, i32* %11
%28 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @def_prf_level to i32 (i32*, i32, ...)*)(i32* %12, i32 %27)
%29 = load i32, i32* %12
%30 = load i32*, i32** %9
store i32 %29, i32* %30
%31 = load i32, i32* %12
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %37
33: ; preds = %26
%34 = load i32*, i32** %10
%35 = load i32, i32* %11
%36 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_prf_level to i32 (i32*, i32, ...)*)(i32* %34, i32 %35)
br label %39
37: ; preds = %26
%38 = load i32*, i32** %10
store i32 0, i32* %38
br label %39
39: ; preds = %37, %33
%40 = load i32, i32* %6
ret i32 %40
}

LLVM IR (-O2):
define i32 @val_opt(i32* nocapture writeonly %0, i32* %1, i32* nocapture writeonly %2, i32* %3, i32 %4) {
%6 = alloca i32
%7 = bitcast i32* %6 to i8*
%8 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @def_gen_by to i32 (i32*, i32, ...)*)(i32* %6, i32 %4)
%9 = load i32, i32* %6
store i32 %9, i32* %0
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_gen_by to i32 (i32*, i32, ...)*)(i32* %1, i32 %4)
br label %14
13: ; preds = %5
store i32 %4, i32* %1
br label %14
14: ; preds = %13, %11
%15 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @def_prf_level to i32 (i32*, i32, ...)*)(i32* %6, i32 %4)
%16 = load i32, i32* %6
store i32 %16, i32* %2
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @val_prf_level to i32 (i32*, i32, ...)*)(i32* %3, i32 %4)
br label %21
20: ; preds = %14
store i32 0, i32* %3
br label %21
21: ; preds = %20, %18
ret i32 undef
}