xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int get_random_number(int, int);
int /*<<< orphan*/ printf(char *, int, int, int *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
void resource_user_wait(uint8_t id, uint8_t *wait_kind) {
  uint8_t random = get_random_number(3, 5);
  printf("Resource user %d waiting %u seconds for %s.\n", id, random,
         wait_kind);
  fflush(stdout);
  sleep(random);
}


x86 assembly (clang, -O0):
<resource_user_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3,%edi
mov    $0x5,%esi
call   1050 <get_random_number@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x14(%rbp),%edi
call   1060 <sleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resource_user_wait>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    $0x3,%edi
mov    $0x5,%esi
call   1050 <get_random_number@plt>
mov    %eax,%ebx
lea    0xe9f(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
mov    %r14,%rcx
call   1030 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <sleep@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Resource user %d waiting %u seconds for %s.\0A\00"
@stdout = global i32 0
define void @resource_user_wait(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = call i32 @get_random_number(i32 3, i32 5)
store i32 %6, i32* %5
%7 = load i32, i32* %3
%8 = load i32, i32* %5
%9 = load i32*, i32** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32* %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
%13 = load i32, i32* %5
%14 = call i32 @sleep(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"Resource user %d waiting %u seconds for %s.\0A\00"
@stdout = global i32 0
define void @resource_user_wait(i32 %0, i32* %1) {
%3 = tail call i32 @get_random_number(i32 3, i32 5)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %3, i32* %1)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
%7 = tail call i32 @sleep(i32 %3)
ret void
}
/* Type definitions */
typedef scalar_t__ const int32_t;

/* Variables and functions */
int32_t add(const int32_t a, const int32_t b) { return a + b; }


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @add(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @add(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
size_t strcspn(char *, char *);
void chomp(char *line) { line[strcspn(line, "\r\n")] = '\0'; }


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strcspn@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcspn@plt>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @chomp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strcspn(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8, i8* %3, i64 %5
store i8 0, i8* %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @chomp(i8* nocapture %0) {
%2 = tail call i64 @strcspn(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds i8, i8* %0, i64 %2
store i8 0, i8* %3
ret void
}
int sum_divisible_by(int n) {
  int p = 999 / n;
  return n * (p * (p + 1)) / 2;
}


x86 assembly (clang, -O0):
<sum_divisible_by>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x3e7,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    -0x8(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_divisible_by>:
mov    $0x3e7,%eax
xor    %edx,%edx
idiv   %edi
lea    0x1(%rax),%ecx
imul   %edi,%eax
imul   %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @sum_divisible_by(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 999, %4
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = mul nsw i32 %7, %9
%11 = mul nsw i32 %6, %10
%12 = sdiv i32 %11, 2
ret i32 %12
}

LLVM IR (-O2):
define i32 @sum_divisible_by(i32 %0) {
%2 = sdiv i32 999, %0
%3 = add nsw i32 %2, 1
%4 = mul i32 %2, %0
%5 = mul i32 %4, %3
%6 = sdiv i32 %5, 2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ utilBinToHex(unsigned char *, char *, int);
void utilWordToHex(unsigned short w, char *hexOut) {
  unsigned char bin[2];
  bin[0] = w / 256;
  bin[1] = w;
  utilBinToHex(bin, hexOut, 2);
}


x86 assembly (clang, -O0):
<utilWordToHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %al,-0x12(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,-0x11(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <utilBinToHex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utilWordToHex>:
push   %rax
rol    $0x8,%di
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%edx
call   1030 <utilBinToHex@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @utilWordToHex(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
%5 = alloca [2 x i8]
store i16 %0, i16* %3
store i8* %1, i8** %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = sdiv i32 %7, 256
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %9, i8* %10
%11 = load i16, i16* %3
%12 = trunc i16 %11 to i8
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 %12, i8* %13
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%15 = load i8*, i8** %4
%16 = call i32 @utilBinToHex(i8* %14, i8* %15, i32 2)
ret void
}

LLVM IR (-O2):
define void @utilWordToHex(i16 zeroext %0, i8* %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = lshr i16 %0, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %4
%7 = trunc i16 %0 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @utilBinToHex(i8* %4, i8* %1, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void show_usage(char *cmd) {
  printf("usage: %s [num_frames]\n", cmd);
  printf("  where num_frames can be a number or 'forever'\n");
  exit(1);
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"usage: %s [num_frames]\0A\00"
@.str.1 = [49 x i8] c" where num_frames can be a number or 'forever'\0A\00"
define void @show_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"usage: %s [num_frames]\0A\00"
@str = [48 x i8] c" where num_frames can be a number or 'forever'\00"
define void @show_usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double pow(double, double);
double tritave_itor(double interval) { return pow(3.0, interval / 19.0); }


x86 assembly (clang, -O0):
<tritave_itor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xede(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tritave_itor>:
movapd %xmm0,%xmm1
divsd  0xee4(%rip),%xmm1
movsd  0xee4(%rip),%xmm0
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @tritave_itor(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.900000e+01
%5 = call double @pow(double 3.000000e+00, double %4)
ret double %5
}

LLVM IR (-O2):
define double @tritave_itor(double %0) {
%2 = fdiv double %0, 1.900000e+01
%3 = tail call double @pow(double 3.000000e+00, double %2)
ret double %3
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
unsigned long fGetSize(const char *filename) {
  struct stat buf;
  if (stat(filename, &buf) < 0) {
    return 0;
  }
  return (unsigned long)buf.st_size;
}


x86 assembly (clang, -O0):
<fGetSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    1140 <fGetSize+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1148 <fGetSize+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fGetSize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     1124 <fGetSize+0x14>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @fGetSize(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i64 0, i64* %2
br label %12
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i64, i64* %10
store i64 %11, i64* %2
br label %12
12: ; preds = %9, %8
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @fGetSize(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = select i1 %5, i64 0, i64 %7
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ u8_strlen(int /*<<< orphan*/ const *);
scalar_t__ u8_strncmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
                      int /*<<< orphan*/);
int u8_starts_with(const u_int32_t *s1, const u_int32_t *s2) {
  return (u8_strncmp(s1, s2, u8_strlen(s2)) == 0);
}


x86 assembly (clang, -O0):
<u8_starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <u8_strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <u8_strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8_starts_with>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <u8_strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <u8_strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @u8_starts_with(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = load i32*, i32** %4
%8 = call i32 @u8_strlen(i32* %7)
%9 = call i64 @u8_strncmp(i32* %5, i32* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @u8_starts_with(i32* %0, i32* %1) {
%3 = tail call i32 @u8_strlen(i32* %1)
%4 = tail call i64 @u8_strncmp(i32* %0, i32* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ try_read_some(int, void **, unsigned int *);
int try_read(int fd, void *data, unsigned size) {
  while (size)
    if (!try_read_some(fd, &data, &size))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<try_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1156 <try_read+0x46>
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <try_read_some@plt>
cmp    $0x0,%eax
jne    1151 <try_read+0x41>
movl   $0x0,-0x4(%rbp)
jmp    115d <try_read+0x4d>
jmp    1122 <try_read+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_read>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,0x10(%rsp)
mov    %edx,0xc(%rsp)
mov    $0x1,%r14d
test   %edx,%edx
je     115d <try_read+0x4d>
mov    %edi,%ebp
lea    0x10(%rsp),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <try_read_some@plt>
test   %eax,%eax
je     115a <try_read+0x4a>
cmpl   $0x0,0xc(%rsp)
jne    1140 <try_read+0x30>
jmp    115d <try_read+0x4d>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @try_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
br label %8
8: ; preds = %16, %3
%9 = load i32, i32* %7
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %5
%13 = call i32 @try_read_some(i32 %12, i8** %6, i32* %7)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %11
store i32 0, i32* %4
br label %18
16: ; preds = %11
br label %8
17: ; preds = %8
store i32 1, i32* %4
br label %18
18: ; preds = %17, %15
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @try_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
store i8* %1, i8** %4
store i32 %2, i32* %5
%6 = icmp eq i32 %2, 0
br i1 %6, label %13, label %10
7: ; preds = %10
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %3, %7
%11 = call i32 @try_read_some(i32 %0, i8** %4, i32* %5)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %7
13: ; preds = %10, %7, %3
%14 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %10 ]
ret i32 %14
}
/* Variables and functions */
int putenv(char *);
int c_putenv(char *arg0) { return putenv(arg0); }


x86 assembly (clang, -O0):
<c_putenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <putenv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_putenv>:
jmp    1030 <putenv@plt>

LLVM IR (-O0):
define i32 @c_putenv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @putenv(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @c_putenv(i8* %0) {
%2 = tail call i32 @putenv(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite_unlocked(unsigned char const *, int, int, int /*<<< orphan*/ *);
int stub1(unsigned char const *, int, int, int /*<<< orphan*/ *);
int fputc_unlocked(int chr, FILE *stream) {
  const unsigned char c = (unsigned char)chr;
  return (*fwrite_unlocked)(&c, 1, 1, stream);
}


x86 assembly (clang, -O0):
<fputc_unlocked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x11(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite_unlocked@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputc_unlocked>:
push   %rax
mov    %rsi,%rcx
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fwrite_unlocked@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fputc_unlocked(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = load i32*, i32** %4
%9 = call i32 @fwrite_unlocked(i8* %5, i32 1, i32 1, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @fputc_unlocked(i32 %0, i32* nocapture %1) {
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = call i32 @fwrite_unlocked(i8* %3, i32 1, i32 1, i32* %1)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ copro_opc5ls_write(int /*<<< orphan*/, int /*<<< orphan*/);
void dbg_write(uint32_t addr, uint32_t value) {
  copro_opc5ls_write(addr, value);
}


x86 assembly (clang, -O0):
<dbg_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <copro_opc5ls_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_write>:
jmp    1030 <copro_opc5ls_write@plt>

LLVM IR (-O0):
define void @dbg_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @copro_opc5ls_write(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @dbg_write(i32 %0, i32 %1) {
%3 = tail call i32 @copro_opc5ls_write(i32 %0, i32 %1)
ret void
}
OP(dd, f0) { op_f0(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_f0@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <op_f0@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @op_f0()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_f0()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int write(int, char *, int);
void pingProfiledProcess(int gogoFD) {
  char buf = 1;
  if (write(gogoFD, &buf, 1) == -1) {
    perror("Can't write to pipe in parent");
    exit(EXIT_FAILURE);
  }
  close(gogoFD);
}


x86 assembly (clang, -O0):
<pingProfiledProcess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    1183 <pingProfiledProcess+0x43>
lea    0xe90(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pingProfiledProcess>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movb   $0x1,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     116c <pingProfiledProcess+0x2c>
mov    %ebx,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <close@plt>
lea    0xe8d(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Can't write to pipe in parent\00"
@EXIT_FAILURE = global i32 0
define void @pingProfiledProcess(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 1, i8* %3
%4 = load i32, i32* %2
%5 = call i32 @write(i32 %4, i8* %3, i32 1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = load i32, i32* %2
%13 = call i32 @close(i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Can't write to pipe in parent\00"
@EXIT_FAILURE = global i32 0
define void @pingProfiledProcess(i32 %0) {
%2 = alloca i8
store i8 1, i8* %2
%3 = call i32 @write(i32 %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
%10 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *v) {
  if (v)
    free(v);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     111a <xfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void __attribute__((visibility("protected"))) lib2_protected(void) {}


x86 assembly (clang, -O0):
<lib2_protected>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib2_protected>:
ret

LLVM IR (-O0):
define protected void @lib2_protected() {
ret void
}

LLVM IR (-O2):
define protected void @lib2_protected() {
ret void
}
/* Variables and functions */
scalar_t__ memcmp(void *, void *, int);
int vectors_equal(void *x, void *y, int elements, int elementSize) {
  return memcmp(x, y, elements * elementSize) == 0;
}


x86 assembly (clang, -O0):
<vectors_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
imul   -0x18(%rbp),%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vectors_equal>:
push   %rax
imul   %ecx,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @vectors_equal(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = mul nsw i32 %11, %12
%14 = call i64 @memcmp(i8* %9, i8* %10, i32 %13)
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @vectors_equal(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %2
%6 = tail call i64 @memcmp(i8* %0, i8* %1, i32 %5)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printver();
void cmd_ver(char *arg) { printver(); }


x86 assembly (clang, -O0):
<cmd_ver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <printver@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_ver>:
xor    %eax,%eax
jmp    1030 <printver@plt>

LLVM IR (-O0):
define void @cmd_ver(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @printver()
ret void
}

LLVM IR (-O2):
define void @cmd_ver(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @printver()
ret void
}
/* Type definitions */
struct collection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ collection_delete(struct collection *);
int /*<<< orphan*/ ctest_assert_pass(char *);
int test_collection_02() {
  struct collection *col = NULL;
  collection_delete(col);
  char *assert_message = "Testing collection for delete NULL..";
  ctest_assert_pass(assert_message);
  return 0;
}


x86 assembly (clang, -O0):
<test_collection_02>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <collection_delete@plt>
lea    0xec0(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ctest_assert_pass@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_collection_02>:
push   %rax
xor    %edi,%edi
call   1040 <collection_delete@plt>
lea    0xed1(%rip),%rdi
call   1030 <ctest_assert_pass@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.collection = type { i32 }
@.str = [37 x i8] c"Testing collection for delete NULL..\00"
define i32 @test_collection_02() {
%1 = alloca %struct.collection*
%2 = alloca i8*
store %struct.collection* null, %struct.collection** %1
%3 = load %struct.collection*, %struct.collection** %1
%4 = call i32 @collection_delete(%struct.collection* %3)
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @ctest_assert_pass(i8* %5)
ret i32 0
}

LLVM IR (-O2):
%struct.collection = type { i32 }
@.str = [37 x i8] c"Testing collection for delete NULL..\00"
define i32 @test_collection_02() {
%1 = tail call i32 @collection_delete(%struct.collection* null)
%2 = tail call i32 @ctest_assert_pass(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ mkfifo(char *, int /*<<< orphan*/);
void c_mkfifo_(char *path, mode_t *mode, int plen) { mkfifo(path, *mode); }


x86 assembly (clang, -O0):
<c_mkfifo_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <mkfifo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_mkfifo_>:
mov    (%rsi),%esi
jmp    1030 <mkfifo@plt>

LLVM IR (-O0):
define void @c_mkfifo_(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = call i32 @mkfifo(i8* %7, i32 %9)
ret void
}

LLVM IR (-O2):
define void @c_mkfifo_(i8* %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @mkfifo(i8* %0, i32 %4)
ret void
}
struct desc_track *call_desc_alloc() {}


x86 assembly (clang, -O0):
<call_desc_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_desc_alloc>:
ret

LLVM IR (-O0):
%struct.desc_track = type opaque
define %struct.desc_track* @call_desc_alloc() {
%1 = alloca %struct.desc_track*
%2 = load %struct.desc_track*, %struct.desc_track** %1
ret %struct.desc_track* %2
}

LLVM IR (-O2):
%struct.desc_track = type opaque
define noalias %struct.desc_track* @call_desc_alloc() {
ret %struct.desc_track* undef
}
double f4_sum_two_int(int v1, int v2) {
  return ((double)(v1)) + ((double)(v2));
}


x86 assembly (clang, -O0):
<f4_sum_two_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_two_int>:
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_two_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = fadd double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @f4_sum_two_int(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = fadd double %3, %4
ret double %5
}
/* Variables and functions */
int execlp(char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int r = execlp("ls", "ls", "-l", NULL);
  printf("::%d\n", r);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rsi
lea    0xec6(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1040 <execlp@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed4(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
call   1040 <execlp@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [6 x i8] c"::%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
@.str.2 = [6 x i8] c"::%d\0A\00"
define i32 @main() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PoiLearnSettingsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void PoiLearnSettingsLogging() { UAVObjLogging(PoiLearnSettingsHandle()); }


x86 assembly (clang, -O0):
<PoiLearnSettingsLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <PoiLearnSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PoiLearnSettingsLogging>:
push   %rax
xor    %eax,%eax
call   1040 <PoiLearnSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @PoiLearnSettingsLogging() {
%1 = call i32 (...) @PoiLearnSettingsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @PoiLearnSettingsLogging() {
%1 = tail call i32 (...) @PoiLearnSettingsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Type definitions */
struct snmp_pdu {
  int dummy;
};

/* Variables and functions */
struct snmp_pdu *_clone_pdu_header(struct snmp_pdu *);
struct snmp_pdu *_copy_pdu_vars(struct snmp_pdu *, struct snmp_pdu *,
                                int /*<<< orphan*/, int, int);
struct snmp_pdu *snmp_split_pdu(struct snmp_pdu *pdu, int skip_count,
                                int copy_count) {
  struct snmp_pdu *newpdu;
  newpdu = _clone_pdu_header(pdu);
  newpdu = _copy_pdu_vars(pdu, newpdu, 0, skip_count, copy_count);
  return newpdu;
}


x86 assembly (clang, -O0):
<snmp_split_pdu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_clone_pdu_header@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
xor    %edx,%edx
call   1030 <_copy_pdu_vars@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snmp_split_pdu>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <_clone_pdu_header@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
xor    %edx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <_copy_pdu_vars@plt>

LLVM IR (-O0):
%struct.snmp_pdu = type { i32 }
define %struct.snmp_pdu* @snmp_split_pdu(%struct.snmp_pdu* %0, i32 %1, i32 %2) {
%4 = alloca %struct.snmp_pdu*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.snmp_pdu*
store %struct.snmp_pdu* %0, %struct.snmp_pdu** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load %struct.snmp_pdu*, %struct.snmp_pdu** %4
%9 = call %struct.snmp_pdu* @_clone_pdu_header(%struct.snmp_pdu* %8)
store %struct.snmp_pdu* %9, %struct.snmp_pdu** %7
%10 = load %struct.snmp_pdu*, %struct.snmp_pdu** %4
%11 = load %struct.snmp_pdu*, %struct.snmp_pdu** %7
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call %struct.snmp_pdu* @_copy_pdu_vars(%struct.snmp_pdu* %10, %struct.snmp_pdu* %11, i32 0, i32 %12, i32 %13)
store %struct.snmp_pdu* %14, %struct.snmp_pdu** %7
%15 = load %struct.snmp_pdu*, %struct.snmp_pdu** %7
ret %struct.snmp_pdu* %15
}

LLVM IR (-O2):
%struct.snmp_pdu = type { i32 }
define %struct.snmp_pdu* @snmp_split_pdu(%struct.snmp_pdu* %0, i32 %1, i32 %2) {
%4 = tail call %struct.snmp_pdu* @_clone_pdu_header(%struct.snmp_pdu* %0)
%5 = tail call %struct.snmp_pdu* @_copy_pdu_vars(%struct.snmp_pdu* %0, %struct.snmp_pdu* %4, i32 0, i32 %1, i32 %2)
ret %struct.snmp_pdu* %5
}
/* Variables and functions */
int gprc_get_actuators(int, int);
int gprcm_get_actuators(int ADF_module, int actuators) {
  return gprc_get_actuators(ADF_module, actuators);
}


x86 assembly (clang, -O0):
<gprcm_get_actuators>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gprc_get_actuators@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gprcm_get_actuators>:
jmp    1030 <gprc_get_actuators@plt>

LLVM IR (-O0):
define i32 @gprcm_get_actuators(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @gprc_get_actuators(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @gprcm_get_actuators(i32 %0, i32 %1) {
%3 = tail call i32 @gprc_get_actuators(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(scalar_t__);
void error(const char *e) {
  fprintf(stderr, "error: %s %s\n", e, errno ? strerror(errno) : "");
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
cmpq   $0x0,(%rax)
je     1179 <error+0x49>
mov    0x2e70(%rip),%rax
mov    (%rax),%rdi
call   1050 <strerror@plt>
mov    %rax,-0x20(%rbp)
jmp    1189 <error+0x59>
lea    0xe8d(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    1189 <error+0x59>
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rcx
lea    0xe65(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%ebp
mov    0x2e92(%rip),%rax
mov    (%rax),%rdi
test   %rdi,%rdi
jne    1157 <error+0x27>
lea    0xeb8(%rip),%rcx
jmp    115f <error+0x2f>
call   1050 <strerror@plt>
mov    %rax,%rcx
lea    0xe9a(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"error: %s %s\0A\00"
@errno = global i64 0
@.str.1 = [1 x i8] zeroinitializer
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i64, i64* @errno
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* @errno
%9 = call i8* @strerror(i64 %8)
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %7
%12 = phi i8* [ %9, %7 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %10 ]
%13 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"error: %s %s\0A\00"
@errno = global i64 0
@.str.1 = [1 x i8] zeroinitializer
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i64, i64* @errno
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i8* @strerror(i64 %3)
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %1 ]
%9 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
}
int(isgraph)(int c) { return isgraph(c); }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isgraph@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
ret

LLVM IR (-O0):
define i32 @isgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isgraph(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_channel_map_can_balance() {
  printf("NOT IMPLEMENTED:"
         "pa_channel_map_can_balance"
         "\n");
}


x86 assembly (clang, -O0):
<pa_channel_map_can_balance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_channel_map_can_balance>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"NOT IMPLEMENTED:pa_channel_map_can_balance\0A\00"
define i32 @pa_channel_map_can_balance() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [43 x i8] c"NOT IMPLEMENTED:pa_channel_map_can_balance\00"
define i32 @pa_channel_map_can_balance() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
double foo1(double a, double b, double c) { return a - b - c; }


x86 assembly (clang, -O0):
<foo1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo1>:
subsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @foo1(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = load double, double* %6
%11 = fsub double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @foo1(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fsub double %4, %2
ret double %5
}
/* Variables and functions */
unsigned char *blake512_buffer(unsigned char *, unsigned char const *, size_t);
unsigned char *hash_buffer_blake512(unsigned char *out, const unsigned char *in,
                                    size_t in_len) {
  return blake512_buffer(out, in, in_len);
}


x86 assembly (clang, -O0):
<hash_buffer_blake512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <blake512_buffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_buffer_blake512>:
jmp    1030 <blake512_buffer@plt>

LLVM IR (-O0):
define i8* @hash_buffer_blake512(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i8* @blake512_buffer(i8* %7, i8* %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @hash_buffer_blake512(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @blake512_buffer(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ CreateFile(char *);
int /*<<< orphan*/ ReadWriteFile(char *);
int main(int argc, char **argv) {
  if (argc > 1) {
    CreateFile(argv[1]);
    ReadWriteFile(argv[1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    115a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <CreateFile@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <ReadWriteFile@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x2,%edi
jl     113c <main+0x1c>
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <CreateFile@plt>
mov    0x8(%rbx),%rdi
call   1030 <ReadWriteFile@plt>
pop    %rbx
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @CreateFile(i8* %11)
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @ReadWriteFile(i8* %15)
br label %17
17: ; preds = %8, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @CreateFile(i8* %6)
%8 = load i8*, i8** %5
%9 = tail call i32 @ReadWriteFile(i8* %8)
br label %10
10: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void myprint_char(char *message) { puts(message); }


x86 assembly (clang, -O0):
<myprint_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myprint_char>:
jmp    1030 <puts@plt>

LLVM IR (-O0):
define void @myprint_char(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
ret void
}

LLVM IR (-O2):
define void @myprint_char(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
void hisfc350_get_best_clock(unsigned int *clock) {
  int ix;
  int clk_reg;
  unsigned int sysclk[] = {
      (((24) + 1) >> 1),
      (0 << 2),
      (((83) + 1) >> 1),
      ((0 << 3) | (1 << 2)),
      (((125) + 1) >> 1),
      ((1 << 3) | (1 << 2)),
      0,
      0,
  };
  clk_reg = (0 << 2);
  for (ix = 0; sysclk[ix]; ix += 2) {
    if (*clock < sysclk[ix])
      break;
    clk_reg = sysclk[ix + 1];
  }
  *clock = clk_reg;
}


x86 assembly (clang, -O0):
<hisfc350_get_best_clock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0xef1(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmpl   $0x0,-0x30(%rbp,%rax,4)
je     1187 <hisfc350_get_best_clock+0x87>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
movslq -0xc(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jae    116a <hisfc350_get_best_clock+0x6a>
jmp    1187 <hisfc350_get_best_clock+0x87>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <hisfc350_get_best_clock+0x42>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<hisfc350_get_best_clock>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    $0x3f,%eax
setae  %cl
xor    %edx,%edx
cmp    $0x2a,%eax
lea    0x4(,%rcx,8),%eax
cmovb  %edx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
@__const.hisfc350_get_best_clock.sysclk = [8 x i32] [i32 12, i32 0, i32 42, i32 4, i32 63, i32 12, i32 0, i32 0]
define void @hisfc350_get_best_clock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [8 x i32]
store i32* %0, i32** %2
%6 = bitcast [8 x i32]* %5 to i8*
store i32 0, i32* %4
store i32 0, i32* %3
br label %7
7: ; preds = %28, %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %31
13: ; preds = %7
%14 = load i32*, i32** %2
%15 = load i32, i32* %14
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = icmp ult i32 %15, %19
br i1 %20, label %21, label %22
21: ; preds = %13
br label %31
22: ; preds = %13
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 %25
%27 = load i32, i32* %26
store i32 %27, i32* %4
br label %28
28: ; preds = %22
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 2
store i32 %30, i32* %3
br label %7
31: ; preds = %21, %7
%32 = load i32, i32* %4
%33 = load i32*, i32** %2
store i32 %32, i32* %33
ret void
}

LLVM IR (-O2):
define void @hisfc350_get_best_clock(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ult i32 %2, 42
%4 = icmp ult i32 %2, 63
%5 = select i1 %4, i32 4, i32 12
%6 = select i1 %3, i32 0, i32 %5
store i32 %6, i32* %0
ret void
}