#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*/ foo(int);
int main(void) {
  struct a {
    int e;
    int f;
    int g;
  } a;
  struct a b;
  int x, c;
  a.e = 50;
  a.f = 9;
  a.g = a.e * a.f;
  foo(a.f);
  foo(a.g);
  x = a.f;
  c = a.e;
  foo(x);
  foo(c);
  a.e = 5;
  a.f = 40;
  a.g = 90;
  foo(a.e);
  foo(a.f);
  foo(a.g);
  c = a.f;
  foo(c);
  b.e = 9;
  a.e = b.e + 1 * c;
  a.f = 30;
  foo(a.e);
  foo(a.f);
  x = a.e * a.f;
  foo(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x32,-0x10(%rbp)
movl   $0x9,-0xc(%rbp)
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
call   1030 <foo@plt>
mov    -0x28(%rbp),%edi
call   1030 <foo@plt>
movl   $0x5,-0x10(%rbp)
movl   $0x28,-0xc(%rbp)
movl   $0x5a,-0x8(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <foo@plt>
mov    -0xc(%rbp),%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
call   1030 <foo@plt>
movl   $0x9,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x28(%rbp),%ecx
shl    $0x0,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
movl   $0x1e,-0xc(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <foo@plt>
mov    -0xc(%rbp),%edi
call   1030 <foo@plt>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9,%edi
call   1030 <foo@plt>
mov    $0x1c2,%edi
call   1030 <foo@plt>
mov    $0x9,%edi
call   1030 <foo@plt>
mov    $0x32,%edi
call   1030 <foo@plt>
mov    $0x5,%edi
call   1030 <foo@plt>
mov    $0x28,%edi
call   1030 <foo@plt>
mov    $0x5a,%edi
call   1030 <foo@plt>
mov    $0x28,%edi
call   1030 <foo@plt>
mov    $0x31,%edi
call   1030 <foo@plt>
mov    $0x1e,%edi
call   1030 <foo@plt>
mov    $0x5be,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.a = type { i32, i32, i32 }
define i32 @main() {
%1 = alloca %struct.a
%2 = alloca %struct.a
%3 = alloca i32
%4 = alloca i32
%5 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 0
store i32 50, i32* %5
%6 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 1
store i32 9, i32* %6
%7 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 1
%10 = load i32, i32* %9
%11 = mul nsw i32 %8, %10
%12 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 2
store i32 %11, i32* %12
%13 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 1
%14 = load i32, i32* %13
%15 = call i32 @foo(i32 %14)
%16 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 2
%17 = load i32, i32* %16
%18 = call i32 @foo(i32 %17)
%19 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 1
%20 = load i32, i32* %19
store i32 %20, i32* %3
%21 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 0
%22 = load i32, i32* %21
store i32 %22, i32* %4
%23 = load i32, i32* %3
%24 = call i32 @foo(i32 %23)
%25 = load i32, i32* %4
%26 = call i32 @foo(i32 %25)
%27 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 0
store i32 5, i32* %27
%28 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 1
store i32 40, i32* %28
%29 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 2
store i32 90, i32* %29
%30 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 0
%31 = load i32, i32* %30
%32 = call i32 @foo(i32 %31)
%33 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 1
%34 = load i32, i32* %33
%35 = call i32 @foo(i32 %34)
%36 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 2
%37 = load i32, i32* %36
%38 = call i32 @foo(i32 %37)
%39 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 1
%40 = load i32, i32* %39
store i32 %40, i32* %4
%41 = load i32, i32* %4
%42 = call i32 @foo(i32 %41)
%43 = getelementptr inbounds %struct.a, %struct.a* %2, i32 0, i32 0
store i32 9, i32* %43
%44 = getelementptr inbounds %struct.a, %struct.a* %2, i32 0, i32 0
%45 = load i32, i32* %44
%46 = load i32, i32* %4
%47 = mul nsw i32 1, %46
%48 = add nsw i32 %45, %47
%49 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 0
store i32 %48, i32* %49
%50 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 1
store i32 30, i32* %50
%51 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 0
%52 = load i32, i32* %51
%53 = call i32 @foo(i32 %52)
%54 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 1
%55 = load i32, i32* %54
%56 = call i32 @foo(i32 %55)
%57 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 0
%58 = load i32, i32* %57
%59 = getelementptr inbounds %struct.a, %struct.a* %1, i32 0, i32 1
%60 = load i32, i32* %59
%61 = mul nsw i32 %58, %60
store i32 %61, i32* %3
%62 = load i32, i32* %3
%63 = call i32 @foo(i32 %62)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 9)
%2 = tail call i32 @foo(i32 450)
%3 = tail call i32 @foo(i32 9)
%4 = tail call i32 @foo(i32 50)
%5 = tail call i32 @foo(i32 5)
%6 = tail call i32 @foo(i32 40)
%7 = tail call i32 @foo(i32 90)
%8 = tail call i32 @foo(i32 40)
%9 = tail call i32 @foo(i32 49)
%10 = tail call i32 @foo(i32 30)
%11 = tail call i32 @foo(i32 1470)
ret i32 0
}