#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 */
struct set {
  int dummy;
};
struct hash_table {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ dag_to_file_var(char *, struct hash_table *, int,
                                   int /*<<< orphan*/ *, char const *);
int /*<<< orphan*/ set_first_element(struct set *);
char *set_next_element(struct set *);
int dag_to_file_vars(struct set *var_names, struct hash_table *vars, int nodeid,
                     FILE *dag_stream, const char *prefix) {
  char *name;
  set_first_element(var_names);
  while ((name = set_next_element(var_names))) {
    dag_to_file_var(name, vars, nodeid, dag_stream, prefix);
  }
  return 0;
}


x86 assembly (clang, -O0):
<dag_to_file_vars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <set_first_element@plt>
mov    -0x8(%rbp),%rdi
call   1030 <set_next_element@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
je     1188 <dag_to_file_vars+0x58>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1050 <dag_to_file_var@plt>
jmp    1154 <dag_to_file_vars+0x24>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dag_to_file_vars>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %edx,%r12d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <set_first_element@plt>
nopl   0x0(%rax)
mov    %rbp,%rdi
call   1030 <set_next_element@plt>
test   %rax,%rax
je     1173 <dag_to_file_vars+0x43>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r12d,%edx
mov    %r15,%rcx
mov    %r14,%r8
call   1050 <dag_to_file_var@plt>
jmp    1150 <dag_to_file_vars+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.set = type { i32 }
%struct.hash_table = type { i32 }
define i32 @dag_to_file_vars(%struct.set* %0, %struct.hash_table* %1, i32 %2, i32* %3, i8* %4) {
%6 = alloca %struct.set*
%7 = alloca %struct.hash_table*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i8*
store %struct.set* %0, %struct.set** %6
store %struct.hash_table* %1, %struct.hash_table** %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i8* %4, i8** %10
%12 = load %struct.set*, %struct.set** %6
%13 = call i32 @set_first_element(%struct.set* %12)
br label %14
14: ; preds = %18, %5
%15 = load %struct.set*, %struct.set** %6
%16 = call i8* @set_next_element(%struct.set* %15)
store i8* %16, i8** %11
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %25
18: ; preds = %14
%19 = load i8*, i8** %11
%20 = load %struct.hash_table*, %struct.hash_table** %7
%21 = load i32, i32* %8
%22 = load i32*, i32** %9
%23 = load i8*, i8** %10
%24 = call i32 @dag_to_file_var(i8* %19, %struct.hash_table* %20, i32 %21, i32* %22, i8* %23)
br label %14
25: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
%struct.set = type { i32 }
%struct.hash_table = type { i32 }
define i32 @dag_to_file_vars(%struct.set* %0, %struct.hash_table* %1, i32 %2, i32* %3, i8* %4) {
%6 = tail call i32 @set_first_element(%struct.set* %0)
%7 = tail call i8* @set_next_element(%struct.set* %0)
%8 = icmp eq i8* %7, null
br i1 %8, label %14, label %9
9: ; preds = %5, %9
%10 = phi i8* [ %12, %9 ], [ %7, %5 ]
%11 = tail call i32 @dag_to_file_var(i8* %10, %struct.hash_table* %1, i32 %2, i32* %3, i8* %4)
%12 = tail call i8* @set_next_element(%struct.set* %0)
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %9
14: ; preds = %9, %5
ret i32 0
}