#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 rand();
int main(int argc, char **argv) {
  int v1 = rand();
  int v2 = rand();
  int v3 = v1 * v2;
  int v4 = rand();
  int v5 = rand();
  int v6 = v4 + v5;
  int v7 = rand();
  int v8 = v1 + v7;
  int v9 = v6 * v8;
  int v10 = v3 + v9;
  return v10;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%eax
imul   -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebp
imul   %r14d,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
add    %r15d,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
add    %r14d,%eax
imul   %ebx,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = call i32 (...) @rand()
store i32 %16, i32* %6
%17 = call i32 (...) @rand()
store i32 %17, i32* %7
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = mul nsw i32 %18, %19
store i32 %20, i32* %8
%21 = call i32 (...) @rand()
store i32 %21, i32* %9
%22 = call i32 (...) @rand()
store i32 %22, i32* %10
%23 = load i32, i32* %9
%24 = load i32, i32* %10
%25 = add nsw i32 %23, %24
store i32 %25, i32* %11
%26 = call i32 (...) @rand()
store i32 %26, i32* %12
%27 = load i32, i32* %6
%28 = load i32, i32* %12
%29 = add nsw i32 %27, %28
store i32 %29, i32* %13
%30 = load i32, i32* %11
%31 = load i32, i32* %13
%32 = mul nsw i32 %30, %31
store i32 %32, i32* %14
%33 = load i32, i32* %8
%34 = load i32, i32* %14
%35 = add nsw i32 %33, %34
store i32 %35, i32* %15
%36 = load i32, i32* %15
ret i32 %36
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = tail call i32 (...) @rand()
%5 = mul nsw i32 %4, %3
%6 = tail call i32 (...) @rand()
%7 = tail call i32 (...) @rand()
%8 = add nsw i32 %7, %6
%9 = tail call i32 (...) @rand()
%10 = add nsw i32 %9, %3
%11 = mul nsw i32 %10, %8
%12 = add nsw i32 %11, %5
ret i32 %12
}