#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*/ addmul1_nc_1(unsigned long *, unsigned long *,
                                unsigned long);
unsigned long rand();
int main() {
  unsigned long z[2] = {0, 0};
  unsigned long x[1] = {0};
  unsigned long c = 0;
  x[0] = rand();
  c = rand();
  addmul1_nc_1(z, x, c);
  x[0] = rand();
  c = rand();
  addmul1_nc_1(z, x, c);
  x[0] = rand();
  c = rand();
  addmul1_nc_1(z, x, c);
  x[0] = rand();
  c = rand();
  addmul1_nc_1(z, x, c);
  return z[0];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x28(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
movq   $0x0,-0x30(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1040 <addmul1_nc_1@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1040 <addmul1_nc_1@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1040 <addmul1_nc_1@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1040 <addmul1_nc_1@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
mov    %rax,0x8(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <addmul1_nc_1@plt>
xor    %eax,%eax
call   1040 <rand@plt>
mov    %rax,0x8(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <addmul1_nc_1@plt>
xor    %eax,%eax
call   1040 <rand@plt>
mov    %rax,0x8(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <addmul1_nc_1@plt>
xor    %eax,%eax
call   1040 <rand@plt>
mov    %rax,0x8(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1030 <addmul1_nc_1@plt>
mov    0x10(%rsp),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i64]
%2 = alloca [1 x i64]
%3 = bitcast [2 x i64]* %1 to i8*
%4 = bitcast [1 x i64]* %2 to i8*
%5 = getelementptr inbounds [1 x i64], [1 x i64]* %2, i64 0, i64 0
%6 = tail call i64 (...) @rand()
store i64 %6, i64* %5
%7 = tail call i64 (...) @rand()
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %1, i64 0, i64 0
%9 = call i32 @addmul1_nc_1(i64* %8, i64* %5, i64 %7)
%10 = call i64 (...) @rand()
store i64 %10, i64* %5
%11 = call i64 (...) @rand()
%12 = call i32 @addmul1_nc_1(i64* %8, i64* %5, i64 %11)
%13 = call i64 (...) @rand()
store i64 %13, i64* %5
%14 = call i64 (...) @rand()
%15 = call i32 @addmul1_nc_1(i64* %8, i64* %5, i64 %14)
%16 = call i64 (...) @rand()
store i64 %16, i64* %5
%17 = call i64 (...) @rand()
%18 = call i32 @addmul1_nc_1(i64* %8, i64* %5, i64 %17)
%19 = load i64, i64* %8
%20 = trunc i64 %19 to i32
ret i32 %20
}