xunge/DecIR huggingface dataset:
void strcpy3(char *s, char *t) {
  int i;
  i = 0;
  while ((s[i] = t[i]) != '\0')
    i++;
}


x86 assembly (clang, -O0):
<strcpy3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1143 <strcpy3+0x43>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy3+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy3>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy3+0x10>
ret

LLVM IR (-O0):
define void @strcpy3(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = load i8, i8* %10
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 %11, i8* %15
%16 = sext i8 %11 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %6
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @strcpy3(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int queue_repair_with_options(char const *, int /*<<< orphan*/ *);
int queue_repair(const char *path) {
  return queue_repair_with_options(path, NULL);
}


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

x86 assembly (clang, -O2):
<queue_repair>:
xor    %esi,%esi
jmp    1030 <queue_repair_with_options@plt>

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

LLVM IR (-O2):
define i32 @queue_repair(i8* %0) {
%2 = tail call i32 @queue_repair_with_options(i8* %0, i32* null)
ret i32 %2
}
f() {
  const int int_t(void);
  int const int_t(void);
  const int(int_t)(void);
  int const(int_t)(void);
  return int_t();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
call   1030 <int_t@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
jmp    1030 <int_t@plt>

LLVM IR (-O0):
define i32 @f() {
%1 = call i32 @int_t()
ret i32 %1
}

LLVM IR (-O2):
define i32 @f() {
%1 = tail call i32 @int_t()
ret i32 %1
}
/* Variables and functions */
int fifo_byte_length();
int fifo_byte_available() { return 256 - 1 - fifo_byte_length(); }


x86 assembly (clang, -O0):
<fifo_byte_available>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <fifo_byte_length@plt>
mov    %eax,%ecx
mov    $0xff,%eax
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifo_byte_available>:
push   %rax
xor    %eax,%eax
call   1030 <fifo_byte_length@plt>
mov    $0xff,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fifo_byte_available() {
%1 = call i32 (...) @fifo_byte_length()
%2 = sub nsw i32 255, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @fifo_byte_available() {
%1 = tail call i32 (...) @fifo_byte_length()
%2 = sub nsw i32 255, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void myprint(int a, int b) { printf("a=%d,b=%d\n", a, b); }


x86 assembly (clang, -O0):
<myprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myprint>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"a=%d,b=%d\0A\00"
define void @myprint(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 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"a=%d,b=%d\0A\00"
define void @myprint(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
void clear_display() { return; }


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

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

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

LLVM IR (-O2):
define void @clear_display() {
ret void
}
/* Variables and functions */
double bot_vector_magnitude_3d(double *);
int /*<<< orphan*/ bot_vector_subtract_3d(double const *, double const *,
                                          double *);
double bot_vector_dist_3d(const double v1[3], const double v2[3]) {
  double v[3];
  bot_vector_subtract_3d(v1, v2, v);
  return bot_vector_magnitude_3d(v);
}


x86 assembly (clang, -O0):
<bot_vector_dist_3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1040 <bot_vector_subtract_3d@plt>
lea    -0x30(%rbp),%rdi
call   1030 <bot_vector_magnitude_3d@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_vector_dist_3d>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1040 <bot_vector_subtract_3d@plt>
mov    %rbx,%rdi
call   1030 <bot_vector_magnitude_3d@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @bot_vector_dist_3d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [3 x double]
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double*, double** %4
%8 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%9 = call i32 @bot_vector_subtract_3d(double* %6, double* %7, double* %8)
%10 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%11 = call double @bot_vector_magnitude_3d(double* %10)
ret double %11
}

LLVM IR (-O2):
define double @bot_vector_dist_3d(double* %0, double* %1) {
%3 = alloca [3 x double]
%4 = bitcast [3 x double]* %3 to i8*
%5 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%6 = call i32 @bot_vector_subtract_3d(double* %0, double* %1, double* %5)
%7 = call double @bot_vector_magnitude_3d(double* %5)
ret double %7
}
/* Variables and functions */
scalar_t__ memcmp(char const *, char const *, int);
bool soundio_streql(const char *str1, int str1_len, const char *str2,
                    int str2_len) {
  if (str1_len != str2_len)
    return false;
  return memcmp(str1, str2, str1_len) == 0;
}


x86 assembly (clang, -O0):
<soundio_streql>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     113e <soundio_streql+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    115d <soundio_streql+0x4d>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soundio_streql>:
xor    %eax,%eax
cmp    %ecx,%esi
jne    1134 <soundio_streql+0x24>
push   %rax
mov    %esi,%r8d
mov    %rdx,%rsi
mov    %r8d,%edx
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @soundio_streql(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, %3
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = tail call i64 @memcmp(i8* %0, i8* %2, i32 %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %4, %6
%11 = phi i32 [ %9, %6 ], [ 0, %4 ]
ret i32 %11
}
/* Variables and functions */
char *make_return_packet(int /*<<< orphan*/);
char *gdb_extended() { return (make_return_packet(0)); }


x86 assembly (clang, -O0):
<gdb_extended>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <make_return_packet@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdb_extended>:
xor    %edi,%edi
jmp    1030 <make_return_packet@plt>

LLVM IR (-O0):
define i8* @gdb_extended() {
%1 = call i8* @make_return_packet(i32 0)
ret i8* %1
}

LLVM IR (-O2):
define i8* @gdb_extended() {
%1 = tail call i8* @make_return_packet(i32 0)
ret i8* %1
}
double opMinus(double lhs, double rhs) { return lhs - rhs; }


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

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

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

LLVM IR (-O2):
define double @opMinus(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ SET_ERRNO(int /*<<< orphan*/);
int /*<<< orphan*/ *stdio_file_alloc(int);
FILE *fdopen(int fd, const char *mode) {
  FILE *file;
  file = stdio_file_alloc(fd);
  if (file == NULL) {
    SET_ERRNO(ENOMEM);
    return NULL;
  }
  return file;
}


x86 assembly (clang, -O0):
<fdopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <stdio_file_alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1161 <fdopen+0x41>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1030 <SET_ERRNO@plt>
movq   $0x0,-0x8(%rbp)
jmp    1169 <fdopen+0x49>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdopen>:
push   %rbx
call   1040 <stdio_file_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <fdopen+0x1c>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <SET_ERRNO@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
define i32* @fdopen(i32 %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
store i32 %0, i32* %4
store i8* %1, i8** %5
%7 = load i32, i32* %4
%8 = call i32* @stdio_file_alloc(i32 %7)
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* @ENOMEM
%13 = call i32 @SET_ERRNO(i32 %12)
store i32* null, i32** %3
br label %16
14: ; preds = %2
%15 = load i32*, i32** %6
store i32* %15, i32** %3
br label %16
16: ; preds = %14, %11
%17 = load i32*, i32** %3
ret i32* %17
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define i32* @fdopen(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32* @stdio_file_alloc(i32 %0)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @ENOMEM
%7 = tail call i32 @SET_ERRNO(i32 %6)
br label %8
8: ; preds = %2, %5
ret i32* %3
}
unsigned short mksym_u16() { return 0; }


x86 assembly (clang, -O0):
<mksym_u16>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mksym_u16>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i16 @mksym_u16() {
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @mksym_u16() {
ret i16 0
}
/* Variables and functions */
int /*<<< orphan*/ show_mouse_tracking(char const *, char *);
int test_mouse_normal(const char *the_title) {
  show_mouse_tracking(the_title, "?1000");
  return 1;
}


x86 assembly (clang, -O0):
<test_mouse_normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <show_mouse_tracking@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mouse_normal>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <show_mouse_tracking@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"?1000\00"
define i32 @test_mouse_normal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @show_mouse_tracking(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [6 x i8] c"?1000\00"
define i32 @test_mouse_normal(i8* %0) {
%2 = tail call i32 @show_mouse_tracking(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main() {
  char x[] = "\377";
  if (x[0] > 0) {
    printf("char is unsigned type\n");
    exit(0);
  } else {
    printf("char is signed type\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%ax
mov    %ax,-0x6(%rbp)
movsbl -0x6(%rbp),%eax
cmp    $0x0,%eax
jle    115a <main+0x3a>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@__const.main.x = [2 x i8] c"\FF\00"
@.str = [23 x i8] c"char is unsigned type\0A\00"
@.str.1 = [21 x i8] c"char is signed type\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8]
store i32 0, i32* %1
%3 = bitcast [2 x i8]* %2 to i8*
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [20 x i8] c"char is signed type\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ rand();
void generate_random_data(void *buf, size_t sz) {
  size_t i = 0;
  unsigned char *p = (unsigned char *)buf;
  while (i++ < sz)
    *p++ = rand();
}


x86 assembly (clang, -O0):
<generate_random_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
cmp    -0x10(%rbp),%rax
jae    1168 <generate_random_data+0x58>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1130 <generate_random_data+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_random_data>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1147 <generate_random_data+0x37>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rbx),%r12
xor    %eax,%eax
call   1030 <rand@plt>
mov    %al,(%r14,%rbx,1)
mov    %r12,%rbx
cmp    %r12,%r15
jne    1130 <generate_random_data+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @generate_random_data(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
%7 = load i8*, i8** %3
store i8* %7, i8** %6
br label %8
8: ; preds = %13, %2
%9 = load i64, i64* %5
%10 = add i64 %9, 1
store i64 %10, i64* %5
%11 = load i64, i64* %4
%12 = icmp ult i64 %9, %11
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = call i32 (...) @rand()
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %6
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %6
store i8 %15, i8* %16
br label %8
18: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @generate_random_data(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i8* [ %10, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ 0, %2 ]
%7 = add nuw i64 %6, 1
%8 = tail call i32 (...) @rand()
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %9, i8* %5
%11 = icmp eq i64 %7, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t __fpending(FILE *stream) { return 1; }


x86 assembly (clang, -O0):
<__fpending>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fpending>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @__fpending(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret i64 1
}

LLVM IR (-O2):
define i64 @__fpending(i32* nocapture readnone %0) {
ret i64 1
}
const char *mb_ver_string(void) { return "1.0.0040"; }


x86 assembly (clang, -O0):
<mb_ver_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mb_ver_string>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"1.0.0040\00"
define i8* @mb_ver_string() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"1.0.0040\00"
define i8* @mb_ver_string() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
void display_version(void) {
  printf("mkpasswd %s\n\n", "5.0.26");
  puts("Copyright (C) 2001-2008 Marco d'Itri\n"
       "This is free software; see the source for copying conditions.  There "
       "is NO\n"
       "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
       "PURPOSE.");
}


x86 assembly (clang, -O0):
<display_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"mkpasswd %s\0A\0A\00"
@.str.1 = [7 x i8] c"5.0.26\00"
@.str.2 = [188 x i8] c"Copyright (C) 2001-2008 Marco d'Itri\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\00"
define void @display_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([188 x i8], [188 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"mkpasswd %s\0A\0A\00"
@.str.1 = [7 x i8] c"5.0.26\00"
@.str.2 = [188 x i8] c"Copyright (C) 2001-2008 Marco d'Itri\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\00"
define void @display_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([188 x i8], [188 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
float pow(float, int);
float inQuint(float t, float b, float c, float d) {
  return c * pow(t / d, 5) + b;
}


x86 assembly (clang, -O0):
<inQuint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
mov    $0x5,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm2
movss  -0x14(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inQuint>:
push   %rax
movss  %xmm2,(%rsp)
movss  %xmm1,0x4(%rsp)
divss  %xmm3,%xmm0
mov    $0x5,%edi
call   1030 <pow@plt>
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @inQuint(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load float, float* %5
%11 = load float, float* %8
%12 = fdiv float %10, %11
%13 = call float @pow(float %12, i32 5)
%14 = load float, float* %6
%15 = call float @llvm.fmuladd.f32(float %9, float %13, float %14)
ret float %15
}

LLVM IR (-O2):
define float @inQuint(float %0, float %1, float %2, float %3) {
%5 = fdiv float %0, %3
%6 = tail call float @pow(float %5, i32 5)
%7 = tail call float @llvm.fmuladd.f32(float %2, float %6, float %1)
ret float %7
}
int seqSearch(int *prim, int *res, int *ult) {
  int iteracoes;
  while (prim != ult) {
    if (*prim == *res)
      return iteracoes;
    iteracoes++;
    prim++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<seqSearch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     1155 <seqSearch+0x55>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    113b <seqSearch+0x3b>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <seqSearch+0x5c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <seqSearch+0x10>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seqSearch>:
mov    $0xffffffff,%eax
cmp    %rdx,%rdi
je     1120 <seqSearch+0x20>
mov    (%rsi),%esi
nopl   0x0(%rax)
cmp    %esi,(%rdi)
je     1121 <seqSearch+0x21>
add    $0x1,%ecx
add    $0x4,%rdi
cmp    %rdx,%rdi
jne    1110 <seqSearch+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @seqSearch(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
br label %9
9: ; preds = %21, %3
%10 = load i32*, i32** %5
%11 = load i32*, i32** %7
%12 = icmp ne i32* %10, %11
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
%16 = load i32*, i32** %6
%17 = load i32, i32* %16
%18 = icmp eq i32 %15, %17
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = load i32, i32* %8
store i32 %20, i32* %4
br label %27
21: ; preds = %13
%22 = load i32, i32* %8
%23 = add nsw i32 %22, 1
store i32 %23, i32* %8
%24 = load i32*, i32** %5
%25 = getelementptr inbounds i32, i32* %24, i32 1
store i32* %25, i32** %5
br label %9
26: ; preds = %9
store i32 -1, i32* %4
br label %27
27: ; preds = %26, %19
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @seqSearch(i32* %0, i32* nocapture %1, i32* readnone %2) {
%4 = icmp eq i32* %0, %2
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = load i32, i32* %1
br label %7
7: ; preds = %5, %12
%8 = phi i32 [ undef, %5 ], [ %13, %12 ]
%9 = phi i32* [ %0, %5 ], [ %14, %12 ]
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %6
br i1 %11, label %16, label %12
12: ; preds = %7
%13 = add nsw i32 %8, 1
%14 = getelementptr inbounds i32, i32* %9, i64 1
%15 = icmp eq i32* %14, %2
br i1 %15, label %16, label %7
16: ; preds = %7, %12, %3
%17 = phi i32 [ -1, %3 ], [ -1, %12 ], [ %8, %7 ]
ret i32 %17
}
/* Type definitions */
typedef scalar_t__ const wchar_t;

/* Variables and functions */
wchar_t *wcschr(const wchar_t *haystack, wchar_t needle) {
  while (*haystack) {
    if (*haystack == needle)
      return (wchar_t *)haystack;
    haystack++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<wcschr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1149 <wcschr+0x49>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jne    1138 <wcschr+0x38>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1151 <wcschr+0x51>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <wcschr+0xc>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcschr>:
mov    (%rdi),%rcx
test   %rcx,%rcx
je     1122 <wcschr+0x22>
mov    %rdi,%rax
nopl   0x0(%rax,%rax,1)
cmp    %rsi,%rcx
je     1124 <wcschr+0x24>
mov    0x8(%rax),%rcx
add    $0x8,%rax
test   %rcx,%rcx
jne    1110 <wcschr+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64* @wcschr(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
br label %6
6: ; preds = %17, %2
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i64*, i64** %4
%12 = load i64, i64* %11
%13 = load i64, i64* %5
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i64*, i64** %4
store i64* %16, i64** %3
br label %21
17: ; preds = %10
%18 = load i64*, i64** %4
%19 = getelementptr inbounds i64, i64* %18, i32 1
store i64* %19, i64** %4
br label %6
20: ; preds = %6
store i64* null, i64** %3
br label %21
21: ; preds = %20, %15
%22 = load i64*, i64** %3
ret i64* %22
}

LLVM IR (-O2):
define i64* @wcschr(i64* %0, i64 %1) {
%3 = load i64, i64* %0
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %9
%6 = phi i64 [ %11, %9 ], [ %3, %2 ]
%7 = phi i64* [ %10, %9 ], [ %0, %2 ]
%8 = icmp eq i64 %6, %1
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = getelementptr inbounds i64, i64* %7, i64 1
%11 = load i64, i64* %10
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %9, %2
%14 = phi i64* [ null, %2 ], [ null, %9 ], [ %7, %5 ]
ret i64* %14
}
unsigned long getsrvadr(char *host, int *port, unsigned int *transport) {
  unsigned long adr = 0;
  return adr;
}


x86 assembly (clang, -O0):
<getsrvadr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsrvadr>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @getsrvadr(i8* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
ret i64 0
}
int build_header(unsigned char *message) {
  message[0] = 2;
  message[1] = 98;
  message[2] = 0;
  message[3] = 0;
  return 4;
}


x86 assembly (clang, -O0):
<build_header>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x62,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x2(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x3(%rax)
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_header>:
movl   $0x6202,(%rdi)
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @build_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 2, i8* %4
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 98, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8 0, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 3
store i8 0, i8* %10
ret i32 4
}

LLVM IR (-O2):
define i32 @build_header(i8* nocapture writeonly %0) {
store i8 2, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 98, i8* %2
%3 = getelementptr inbounds i8, i8* %0, i64 2
store i8 0, i8* %3
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 0, i8* %4
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ inc_only(unsigned char);
int /*<<< orphan*/ write_only(unsigned char);
void inc_write(unsigned char what) {
  ;
  inc_only(what);
  write_only(what);
}


x86 assembly (clang, -O0):
<inc_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <inc_only@plt>
movzbl -0x1(%rbp),%edi
call   1040 <write_only@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_write>:
push   %rbx
mov    %edi,%ebx
call   1030 <inc_only@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <write_only@plt>

LLVM IR (-O0):
define void @inc_write(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @inc_only(i8 zeroext %3)
%5 = load i8, i8* %2
%6 = call i32 @write_only(i8 zeroext %5)
ret void
}

LLVM IR (-O2):
define void @inc_write(i8 zeroext %0) {
%2 = tail call i32 @inc_only(i8 zeroext %0)
%3 = tail call i32 @write_only(i8 zeroext %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ UI;

/* Variables and functions */
int /*<<< orphan*/ UIT_VERIFY;
int general_allocate_string(int /*<<< orphan*/ *, char const *,
                            int /*<<< orphan*/, int /*<<< orphan*/, int, char *,
                            int, int, char const *);
int UI_add_verify_string(UI *ui, const char *prompt, int flags,
                         char *result_buf, int minsize, int maxsize,
                         const char *test_buf) {
  return general_allocate_string(ui, prompt, 0, UIT_VERIFY, flags, result_buf,
                                 minsize, maxsize, test_buf);
}


x86 assembly (clang, -O0):
<UI_add_verify_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e9e(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%r11d
mov    -0x28(%rbp),%r10d
mov    0x10(%rbp),%rax
xor    %edx,%edx
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <general_allocate_string@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_add_verify_string>:
push   %rax
mov    %r9d,%eax
mov    %r8d,%r10d
mov    %rcx,%r9
mov    %edx,%r8d
mov    0x2ebc(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x8,%rsp
xor    %edx,%edx
push   0x18(%rsp)
push   %rax
push   %r10
call   1030 <general_allocate_string@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
@UIT_VERIFY = global i32 0
define i32 @UI_add_verify_string(i32* %0, i8* %1, i32 %2, i8* %3, i32 %4, i32 %5, i8* %6) {
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i8*
store i32* %0, i32** %8
store i8* %1, i8** %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i8* %6, i8** %14
%15 = load i32*, i32** %8
%16 = load i8*, i8** %9
%17 = load i32, i32* @UIT_VERIFY
%18 = load i32, i32* %10
%19 = load i8*, i8** %11
%20 = load i32, i32* %12
%21 = load i32, i32* %13
%22 = load i8*, i8** %14
%23 = call i32 @general_allocate_string(i32* %15, i8* %16, i32 0, i32 %17, i32 %18, i8* %19, i32 %20, i32 %21, i8* %22)
ret i32 %23
}

LLVM IR (-O2):
@UIT_VERIFY = global i32 0
define i32 @UI_add_verify_string(i32* %0, i8* %1, i32 %2, i8* %3, i32 %4, i32 %5, i8* %6) {
%8 = load i32, i32* @UIT_VERIFY
%9 = tail call i32 @general_allocate_string(i32* %0, i8* %1, i32 0, i32 %8, i32 %2, i8* %3, i32 %4, i32 %5, i8* %6)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_is_path_absolute() {
  printf("NOT IMPLEMENTED:"
         "pa_is_path_absolute"
         "\n");
}


x86 assembly (clang, -O0):
<pa_is_path_absolute>:
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_is_path_absolute>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_is_path_absolute\00"
define i32 @pa_is_path_absolute() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
char *get_password_if_match(char *, char *);
int /*<<< orphan*/ printf(char *);
char *get_password_for_key(void) {
  char *password;
  password = get_password_if_match("Enter password to encrypt DSA key: ",
                                   "Re-enter password (verification): ");
  if (!password) {
    printf("Passwords do NOT match\n");
    return NULL;
  } else {
    return password;
  }
}


x86 assembly (clang, -O0):
<get_password_for_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xeee(%rip),%rsi
call   1040 <get_password_if_match@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1163 <get_password_for_key+0x43>
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
movq   $0x0,-0x8(%rbp)
jmp    116b <get_password_for_key+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_password_for_key>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xef5(%rip),%rsi
call   1040 <get_password_if_match@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <get_password_for_key+0x28>
lea    0xf04(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Enter password to encrypt DSA key: \00"
@.str.1 = [35 x i8] c"Re-enter password (verification): \00"
@.str.2 = [24 x i8] c"Passwords do NOT match\0A\00"
define i8* @get_password_for_key() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @get_password_if_match(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
store i8* null, i8** %1
br label %10
8: ; preds = %0
%9 = load i8*, i8** %2
store i8* %9, i8** %1
br label %10
10: ; preds = %8, %6
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [36 x i8] c"Enter password to encrypt DSA key: \00"
@.str.1 = [35 x i8] c"Re-enter password (verification): \00"
@str = [23 x i8] c"Passwords do NOT match\00"
define i8* @get_password_for_key() {
%1 = tail call i8* @get_password_if_match(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ init_table();
int yyparse();
int main(void) {
  init_table();
  return yyparse();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <init_table@plt>
mov    $0x0,%al
call   1030 <yyparse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init_table@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <yyparse@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init_table()
%3 = call i32 (...) @yyparse()
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init_table()
%2 = tail call i32 (...) @yyparse()
ret i32 %2
}
double cc_barometer_to_pressure(double count) {
  return ((count / 16.0) / 2047.0 + 0.095) / 0.009 * 1000.0;
}


x86 assembly (clang, -O0):
<cc_barometer_to_pressure>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xf0a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xef6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xee2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeba(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_barometer_to_pressure>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @cc_barometer_to_pressure(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.600000e+01
%5 = fdiv double %4, 2.047000e+03
%6 = fadd double %5, 9.500000e-02
%7 = fdiv double %6, 0x3F826E978D4FDF3B
%8 = fmul double %7, 1.000000e+03
ret double %8
}

LLVM IR (-O2):
define double @cc_barometer_to_pressure(double %0) {
%2 = fmul double %0, 6.250000e-02
%3 = fdiv double %2, 2.047000e+03
%4 = fadd double %3, 9.500000e-02
%5 = fdiv double %4, 0x3F826E978D4FDF3B
%6 = fmul double %5, 1.000000e+03
ret double %6
}
int acc_downsize(char ch) {
  int size;
  switch (ch) {
  case '=':
    size = 8;
    break;
  case '^':
    size = 9;
    break;
  case '_':
    size = 4;
    break;
  default:
    size = 0;
    break;
  };
  return (size);
}


x86 assembly (clang, -O0):
<acc_downsize>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x3d,%eax
je     1141 <acc_downsize+0x41>
jmp    111f <acc_downsize+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x5e,%eax
je     114d <acc_downsize+0x4d>
jmp    1130 <acc_downsize+0x30>
mov    -0xc(%rbp),%eax
sub    $0x5f,%eax
je     1159 <acc_downsize+0x59>
jmp    1165 <acc_downsize+0x65>
movl   $0x8,-0x8(%rbp)
jmp    116c <acc_downsize+0x6c>
movl   $0x9,-0x8(%rbp)
jmp    116c <acc_downsize+0x6c>
movl   $0x4,-0x8(%rbp)
jmp    116c <acc_downsize+0x6c>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<acc_downsize>:
cmp    $0x3d,%edi
je     1115 <acc_downsize+0x15>
cmp    $0x5f,%edi
je     111b <acc_downsize+0x1b>
cmp    $0x5e,%edi
jne    1121 <acc_downsize+0x21>
mov    $0x9,%eax
ret
mov    $0x8,%eax
ret
mov    $0x4,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @acc_downsize(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 61, label %6
i32 94, label %7
i32 95, label %8
]
6: ; preds = %1
store i32 8, i32* %3
br label %10
7: ; preds = %1
store i32 9, i32* %3
br label %10
8: ; preds = %1
store i32 4, i32* %3
br label %10
9: ; preds = %1
store i32 0, i32* %3
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @acc_downsize(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %5 [
i32 61, label %6
i32 94, label %3
i32 95, label %4
]
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3
%7 = phi i32 [ 0, %5 ], [ 4, %4 ], [ 9, %3 ], [ 8, %1 ]
ret i32 %7
}
void wpas_dbus_signal_p2p_wps_failed(struct wpa_supplicant *wpa_s,
                                     struct wps_event_fail *fail) {}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.wps_event_fail = type opaque
define void @wpas_dbus_signal_p2p_wps_failed(%struct.wpa_supplicant* %0, %struct.wps_event_fail* %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca %struct.wps_event_fail*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store %struct.wps_event_fail* %1, %struct.wps_event_fail** %4
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wps_event_fail = type opaque
define void @wpas_dbus_signal_p2p_wps_failed(%struct.wpa_supplicant* nocapture %0, %struct.wps_event_fail* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ send_raw_value(int /*<<< orphan*/, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ usleep(int);
void *enableTimeLimitFog(void *threadid) {
  send_raw_value(0, 0x100);
  usleep(10000);
  printf("Fog engaged\n");
  sleep(5);
  send_raw_value(0, 0x200);
  usleep(10000);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<enableTimeLimitFog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x100,%esi
call   1040 <send_raw_value@plt>
mov    $0x2710,%edi
call   1070 <usleep@plt>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
xor    %edi,%edi
mov    $0x200,%esi
call   1040 <send_raw_value@plt>
mov    $0x2710,%edi
call   1070 <usleep@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enableTimeLimitFog>:
push   %rax
xor    %edi,%edi
mov    $0x100,%esi
call   1040 <send_raw_value@plt>
mov    $0x2710,%edi
call   1070 <usleep@plt>
lea    0xe92(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
xor    %edi,%edi
mov    $0x200,%esi
call   1040 <send_raw_value@plt>
mov    $0x2710,%edi
call   1070 <usleep@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Fog engaged\0A\00"
define i8* @enableTimeLimitFog(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @send_raw_value(i32 0, i32 256)
%5 = call i32 @usleep(i32 10000)
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @sleep(i32 5)
%8 = call i32 @send_raw_value(i32 0, i32 512)
%9 = call i32 @usleep(i32 10000)
%10 = call i32 @pthread_exit(i32* null)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@str = [12 x i8] c"Fog engaged\00"
define noalias i8* @enableTimeLimitFog(i8* nocapture readnone %0) {
%2 = tail call i32 @send_raw_value(i32 0, i32 256)
%3 = tail call i32 @usleep(i32 10000)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 5)
%6 = tail call i32 @send_raw_value(i32 0, i32 512)
%7 = tail call i32 @usleep(i32 10000)
%8 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
void chomp(char *str) {
  while (*str++)
    if (*str == '\r' || *str == '\n')
      *str = 0;
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     114c <chomp+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     1140 <chomp+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1147 <chomp+0x47>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1108 <chomp+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
cmpb   $0x0,(%rdi)
je     1127 <chomp+0x27>
add    $0x1,%rdi
nopl   0x0(%rax)
movzbl (%rdi),%eax
test   %al,%al
je     1127 <chomp+0x27>
add    $0x1,%rdi
cmp    $0xd,%al
je     1123 <chomp+0x23>
cmp    $0xa,%al
jne    1110 <chomp+0x10>
movb   $0x0,-0x1(%rdi)
ret

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

LLVM IR (-O2):
define void @chomp(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
switch i8 %7, label %4 [
i8 13, label %8
i8 10, label %8
i8 0, label %9
]
8: ; preds = %4, %4
store i8 0, i8* %6
br label %9
9: ; preds = %4, %8, %1
ret void
}
/* Variables and functions */
int FLT_EPSILON;
int fabs(double);
int is_almost_zero(double x) { return (fabs(x) < 2 * FLT_EPSILON); }


x86 assembly (clang, -O0):
<is_almost_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_almost_zero>:
push   %rax
call   1030 <fabs@plt>
mov    0x2ec3(%rip),%rcx
mov    (%rcx),%edx
add    %edx,%edx
xor    %ecx,%ecx
cmp    %edx,%eax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FLT_EPSILON = global i32 0
define i32 @is_almost_zero(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @fabs(double %3)
%5 = load i32, i32* @FLT_EPSILON
%6 = mul nsw i32 2, %5
%7 = icmp slt i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@FLT_EPSILON = global i32 0
define i32 @is_almost_zero(double %0) {
%2 = tail call i32 @fabs(double %0)
%3 = load i32, i32* @FLT_EPSILON
%4 = shl nsw i32 %3, 1
%5 = icmp slt i32 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ identity(int);
void half_test(void) {
  identity(1);
  identity(42);
}


x86 assembly (clang, -O0):
<half_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <identity@plt>
mov    $0x2a,%edi
call   1030 <identity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<half_test>:
push   %rax
mov    $0x1,%edi
call   1030 <identity@plt>
mov    $0x2a,%edi
pop    %rax
jmp    1030 <identity@plt>

LLVM IR (-O0):
define void @half_test() {
%1 = call i32 @identity(i32 1)
%2 = call i32 @identity(i32 42)
ret void
}

LLVM IR (-O2):
define void @half_test() {
%1 = tail call i32 @identity(i32 1)
%2 = tail call i32 @identity(i32 42)
ret void
}