#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 f(int);
int f2(int);
int main() {
  int a = 5;
  a = f(a) +
      (f2(a) * (f(a) - (f2(a) / f(a)) * (f2(a) + f(a)) / f2(a) % f(a) % f2(a)));
  a = f(a) ? (f2(a) &&
              (f(a) > (f2(a) / f(a)) || (f2(a) + f(a)) / f2(a) % f(a) < f2(a)))
           : (f2(5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <f@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f2@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <f@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f2@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <f@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f2@plt>
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <f@plt>
mov    -0x28(%rbp),%ecx
mov    %eax,%edx
mov    -0x24(%rbp),%eax
add    %edx,%ecx
imul   %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f2@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <f@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f2@plt>
mov    -0x18(%rbp),%ecx
mov    %eax,%esi
mov    -0x14(%rbp),%eax
cltd
idiv   %esi
mov    -0x10(%rbp),%eax
mov    %edx,%esi
mov    -0xc(%rbp),%edx
sub    %esi,%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <f@plt>
cmp    $0x0,%eax
je     12b0 <main+0x190>
mov    -0x8(%rbp),%edi
call   1030 <f2@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2d(%rbp)
je     12a0 <main+0x180>
mov    -0x8(%rbp),%edi
call   1040 <f@plt>
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f2@plt>
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <f@plt>
mov    -0x38(%rbp),%ecx
mov    %eax,%esi
mov    -0x34(%rbp),%eax
cltd
idiv   %esi
mov    %eax,%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x2e(%rbp)
jg     129a <main+0x17a>
mov    -0x8(%rbp),%edi
call   1030 <f2@plt>
mov    %eax,-0x48(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <f@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f2@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x40(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <f@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x3c(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f2@plt>
mov    -0x3c(%rbp),%edx
cmp    %eax,%edx
setl   %al
mov    %al,-0x2e(%rbp)
mov    -0x2e(%rbp),%al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4c(%rbp)
jmp    12bd <main+0x19d>
mov    $0x5,%edi
call   1030 <f2@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x5,0x4(%rsp)
mov    $0x5,%edi
call   1040 <f@plt>
mov    %eax,%r15d
mov    $0x5,%edi
call   1030 <f2@plt>
mov    %eax,%r12d
mov    $0x5,%edi
call   1040 <f@plt>
mov    %eax,%ebx
mov    $0x5,%edi
call   1030 <f2@plt>
mov    %eax,%ebp
mov    $0x5,%edi
call   1040 <f@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%r13d
mov    $0x5,%edi
call   1030 <f2@plt>
mov    %eax,%ebp
mov    $0x5,%edi
call   1040 <f@plt>
mov    %eax,%r14d
add    %ebp,%r14d
imul   %r13d,%r14d
mov    $0x5,%edi
call   1030 <f2@plt>
mov    %eax,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
mov    %eax,%ebp
mov    $0x5,%edi
call   1040 <f@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %edx,%ebp
mov    $0x5,%edi
call   1030 <f2@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
sub    %edx,%ebx
imul   %r12d,%ebx
add    %r15d,%ebx
mov    %ebx,%edi
call   1040 <f@plt>
test   %eax,%eax
je     1236 <main+0x116>
mov    %ebx,%edi
call   1030 <f2@plt>
test   %eax,%eax
je     123f <main+0x11f>
mov    %ebx,%edi
call   1040 <f@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <f2@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <f@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
cmp    %eax,%r14d
jg     123f <main+0x11f>
mov    %ebx,%edi
call   1030 <f2@plt>
mov    %ebx,%edi
call   1040 <f@plt>
mov    %ebx,%edi
call   1030 <f2@plt>
mov    %ebx,%edi
call   1040 <f@plt>
mov    %ebx,0x4(%rsp)
mov    0x4(%rsp),%edi
call   1030 <f2@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @f(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @f2(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @f(i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @f2(i32 %9)
%11 = load i32, i32* %2
%12 = call i32 @f(i32 %11)
%13 = sdiv i32 %10, %12
%14 = load i32, i32* %2
%15 = call i32 @f2(i32 %14)
%16 = load i32, i32* %2
%17 = call i32 @f(i32 %16)
%18 = add nsw i32 %15, %17
%19 = mul nsw i32 %13, %18
%20 = load i32, i32* %2
%21 = call i32 @f2(i32 %20)
%22 = sdiv i32 %19, %21
%23 = load i32, i32* %2
%24 = call i32 @f(i32 %23)
%25 = srem i32 %22, %24
%26 = load i32, i32* %2
%27 = call i32 @f2(i32 %26)
%28 = srem i32 %25, %27
%29 = sub nsw i32 %8, %28
%30 = mul nsw i32 %6, %29
%31 = add nsw i32 %4, %30
store i32 %31, i32* %2
%32 = load i32, i32* %2
%33 = call i32 @f(i32 %32)
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %68
35: ; preds = %0
%36 = load i32, i32* %2
%37 = call i32 @f2(i32 %36)
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %65
39: ; preds = %35
%40 = load i32, i32* %2
%41 = call i32 @f(i32 %40)
%42 = load i32, i32* %2
%43 = call i32 @f2(i32 %42)
%44 = load i32, i32* %2
%45 = call i32 @f(i32 %44)
%46 = sdiv i32 %43, %45
%47 = icmp sgt i32 %41, %46
br i1 %47, label %63, label %48
48: ; preds = %39
%49 = load i32, i32* %2
%50 = call i32 @f2(i32 %49)
%51 = load i32, i32* %2
%52 = call i32 @f(i32 %51)
%53 = add nsw i32 %50, %52
%54 = load i32, i32* %2
%55 = call i32 @f2(i32 %54)
%56 = sdiv i32 %53, %55
%57 = load i32, i32* %2
%58 = call i32 @f(i32 %57)
%59 = srem i32 %56, %58
%60 = load i32, i32* %2
%61 = call i32 @f2(i32 %60)
%62 = icmp slt i32 %59, %61
br label %63
63: ; preds = %48, %39
%64 = phi i1 [ true, %39 ], [ %62, %48 ]
br label %65
65: ; preds = %63, %35
%66 = phi i1 [ false, %35 ], [ %64, %63 ]
%67 = zext i1 %66 to i32
br label %70
68: ; preds = %0
%69 = call i32 @f2(i32 5)
br label %70
70: ; preds = %68, %65
%71 = phi i32 [ %67, %65 ], [ %69, %68 ]
store i32 %71, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 5)
%2 = tail call i32 @f2(i32 5)
%3 = tail call i32 @f(i32 5)
%4 = tail call i32 @f2(i32 5)
%5 = tail call i32 @f(i32 5)
%6 = sdiv i32 %4, %5
%7 = tail call i32 @f2(i32 5)
%8 = tail call i32 @f(i32 5)
%9 = add nsw i32 %8, %7
%10 = mul nsw i32 %9, %6
%11 = tail call i32 @f2(i32 5)
%12 = sdiv i32 %10, %11
%13 = tail call i32 @f(i32 5)
%14 = srem i32 %12, %13
%15 = tail call i32 @f2(i32 5)
%16 = srem i32 %14, %15
%17 = sub nsw i32 %3, %16
%18 = mul nsw i32 %17, %2
%19 = add nsw i32 %18, %1
%20 = tail call i32 @f(i32 %19)
%21 = icmp eq i32 %20, 0
br i1 %21, label %36, label %22
22: ; preds = %0
%23 = tail call i32 @f2(i32 %19)
%24 = icmp eq i32 %23, 0
br i1 %24, label %39, label %25
25: ; preds = %22
%26 = tail call i32 @f(i32 %19)
%27 = tail call i32 @f2(i32 %19)
%28 = tail call i32 @f(i32 %19)
%29 = sdiv i32 %27, %28
%30 = icmp sgt i32 %26, %29
br i1 %30, label %39, label %31
31: ; preds = %25
%32 = tail call i32 @f2(i32 %19)
%33 = tail call i32 @f(i32 %19)
%34 = tail call i32 @f2(i32 %19)
%35 = tail call i32 @f(i32 %19)
br label %36
36: ; preds = %0, %31
%37 = phi i32 [ %19, %31 ], [ 5, %0 ]
%38 = tail call i32 @f2(i32 %37)
br label %39
39: ; preds = %36, %22, %25
ret i32 0
}