xunge/DecIR huggingface dataset:
int clamp(int low, int n, int top) { return n < low ? n : n < top ? n : top; }


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1124 <clamp+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clamp+0x47>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <clamp+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clamp+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
mov    %edx,%eax
cmp    %edx,%esi
cmovl  %esi,%eax
cmp    %edi,%esi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %5
br label %22
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %5
br label %20
18: ; preds = %12
%19 = load i32, i32* %6
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = icmp slt i32 %1, %2
%6 = or i1 %4, %5
%7 = select i1 %6, i32 %1, i32 %2
ret i32 %7
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int32_t prv_gt_str_fn(const char *a, const char *b) {
  return strcmp(a, b) > 0 ? -1 : 0;
}


x86 assembly (clang, -O0):
<prv_gt_str_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%rdx
cmovg  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_gt_str_fn>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @prv_gt_str_fn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp sgt i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @prv_gt_str_fn(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp sgt i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __get_unaligned_le32(int /*<<< orphan*/ const *);
uint32_t get_unaligned_le32(const void *p) {
  return __get_unaligned_le32((const uint8_t *)p);
}


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

x86 assembly (clang, -O2):
<get_unaligned_le32>:
jmp    1030 <__get_unaligned_le32@plt>

LLVM IR (-O0):
define i32 @get_unaligned_le32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @__get_unaligned_le32(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_unaligned_le32(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @__get_unaligned_le32(i32* %2)
ret i32 %3
}
int param_is_mask(int p) { return (p >= 0) && (p <= 2); }


x86 assembly (clang, -O0):
<param_is_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <param_is_mask+0x20>
cmpl   $0x2,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<param_is_mask>:
xor    %eax,%eax
cmp    $0x3,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @param_is_mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 2
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @param_is_mask(i32 %0) {
%2 = icmp ult i32 %0, 3
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dtrsv_(char *, char *, char *, int *, double const *, int *,
                          double *, int *);
int call_dtrsv(char uplo, char trans, char diag, int n, const double *a,
               int lda, double *x, int incx) {
  dtrsv_(&uplo, &trans, &diag, &n, a, &lda, x, &incx);
  return 0;
}


x86 assembly (clang, -O0):
<call_dtrsv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dl,%al
mov    %sil,%dl
mov    %dil,%sil
mov    0x18(%rbp),%edi
mov    0x10(%rbp),%rdi
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    %ecx,-0x8(%rbp)
mov    %r8,-0x10(%rbp)
mov    %r9d,-0x14(%rbp)
mov    -0x10(%rbp),%r8
mov    0x10(%rbp),%r10
lea    -0x1(%rbp),%rdi
lea    -0x2(%rbp),%rsi
lea    -0x3(%rbp),%rdx
lea    -0x8(%rbp),%rcx
lea    -0x14(%rbp),%r9
lea    0x18(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <dtrsv_@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_dtrsv>:
sub    $0x18,%rsp
mov    0x20(%rsp),%r10
mov    %dil,0xf(%rsp)
mov    %sil,0xe(%rsp)
mov    %dl,0xd(%rsp)
mov    %ecx,0x14(%rsp)
mov    %r9d,0x10(%rsp)
lea    0x28(%rsp),%rax
lea    0xf(%rsp),%rdi
lea    0xe(%rsp),%rsi
lea    0xd(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0x10(%rsp),%r9
push   %rax
push   %r10
call   1030 <dtrsv_@plt>
add    $0x10,%rsp
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @call_dtrsv(i8 signext %0, i8 signext %1, i8 signext %2, i32 %3, double* %4, i32 %5, double* %6, i32 %7) {
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i32
%13 = alloca double*
%14 = alloca i32
%15 = alloca double*
%16 = alloca i32
store i8 %0, i8* %9
store i8 %1, i8* %10
store i8 %2, i8* %11
store i32 %3, i32* %12
store double* %4, double** %13
store i32 %5, i32* %14
store double* %6, double** %15
store i32 %7, i32* %16
%17 = load double*, double** %13
%18 = load double*, double** %15
%19 = call i32 @dtrsv_(i8* %9, i8* %10, i8* %11, i32* %12, double* %17, i32* %14, double* %18, i32* %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @call_dtrsv(i8 signext %0, i8 signext %1, i8 signext %2, i32 %3, double* %4, i32 %5, double* %6, i32 %7) {
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i8 %0, i8* %9
store i8 %1, i8* %10
store i8 %2, i8* %11
store i32 %3, i32* %12
store i32 %5, i32* %13
store i32 %7, i32* %14
%15 = call i32 @dtrsv_(i8* %9, i8* %10, i8* %11, i32* %12, double* %4, i32* %13, double* %6, i32* %14)
ret i32 0
}
/* Type definitions */
struct node_args_info {
  int dummy;
};

/* Variables and functions */
int node_cmdline_parser2(int, char **, struct node_args_info *,
                         int /*<<< orphan*/, int, int);
int node_cmdline_parser(int argc, char **argv,
                        struct node_args_info *args_info) {
  return node_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<node_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <node_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<node_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <node_cmdline_parser2@plt>

LLVM IR (-O0):
%struct.node_args_info = type { i32 }
define i32 @node_cmdline_parser(i32 %0, i8** %1, %struct.node_args_info* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.node_args_info*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.node_args_info* %2, %struct.node_args_info** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load %struct.node_args_info*, %struct.node_args_info** %6
%10 = call i32 @node_cmdline_parser2(i32 %7, i8** %8, %struct.node_args_info* %9, i32 0, i32 1, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.node_args_info = type { i32 }
define i32 @node_cmdline_parser(i32 %0, i8** %1, %struct.node_args_info* %2) {
%4 = tail call i32 @node_cmdline_parser2(i32 %0, i8** %1, %struct.node_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ tcp_compound_unregister();
void module_unregister_fake(void) {
  if (0)
    tcp_compound_unregister();
}


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

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

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

LLVM IR (-O2):
define void @module_unregister_fake() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int i;
  for (i = 0; i < 1000; i++) {
    printf("Hello World\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    114d <main+0x3d>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3e8,%ebp
lea    0xee1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebp
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1000
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1000
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, int);
int /*<<< orphan*/ stdout;
void version(void) {
  fprintf(stdout, "\nkopou v%s %d bits, -cluster[%d vnodes]\n\n", ".09",
          ((sizeof(long) == 8) ? 64 : 32), 0x080);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xeef(%rip),%rdx
mov    $0x40,%ecx
mov    $0x80,%r8d
call   1030 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef2(%rip),%rdx
mov    $0x40,%ecx
mov    $0x80,%r8d
call   1030 <fprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [42 x i8] c"\0Akopou v%s %d bits, -cluster[%d vnodes]\0A\0A\00"
@.str.1 = [4 x i8] c".09\00"
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 64, i32 128)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [42 x i8] c"\0Akopou v%s %d bits, -cluster[%d vnodes]\0A\0A\00"
@.str.1 = [4 x i8] c".09\00"
@EXIT_SUCCESS = global i32 0
define void @version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 64, i32 128)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void print(char *buff, unsigned width, unsigned height) {
  char *it = buff;
  while (it < buff + height * width + height) {
    puts(it);
    it += width + 1;
  }
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%edx
imul   -0xc(%rbp),%edx
mov    %edx,%edx
add    %rdx,%rcx
mov    -0x10(%rbp),%edx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1170 <print+0x60>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    112a <print+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%r15d
imul   %esi,%edx
add    %rdi,%rdx
add    %rdx,%r15
cmp    %rdi,%r15
jbe    1142 <print+0x32>
mov    %esi,%r14d
mov    %rdi,%rbx
add    $0x1,%r14d
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
add    %r14,%rbx
cmp    %r15,%rbx
jb     1130 <print+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @print(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
store i8* %8, i8** %7
br label %9
9: ; preds = %21, %3
%10 = load i8*, i8** %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = mul i32 %12, %13
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %11, i64 %15
%17 = load i32, i32* %6
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = icmp ult i8* %10, %19
br i1 %20, label %21, label %29
21: ; preds = %9
%22 = load i8*, i8** %7
%23 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %22)
%24 = load i32, i32* %5
%25 = add i32 %24, 1
%26 = load i8*, i8** %7
%27 = zext i32 %25 to i64
%28 = getelementptr inbounds i8, i8* %26, i64 %27
store i8* %28, i8** %7
br label %9
29: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @print(i8* %0, i32 %1, i32 %2) {
%4 = mul i32 %2, %1
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = zext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = icmp ugt i8* %8, %0
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = add i32 %1, 1
%12 = zext i32 %11 to i64
br label %13
13: ; preds = %10, %13
%14 = phi i8* [ %0, %10 ], [ %16, %13 ]
%15 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %14)
%16 = getelementptr inbounds i8, i8* %14, i64 %12
%17 = icmp ult i8* %16, %8
br i1 %17, label %13, label %18
18: ; preds = %13, %3
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sendto(int, char *, int, int /*<<< orphan*/,
                          struct sockaddr_in *, int);
void send_log(int soc, char *str, int len, struct sockaddr_in *serv_addr) {
  sendto(soc, str, len, 0, serv_addr, sizeof(struct sockaddr_in));
}


x86 assembly (clang, -O0):
<send_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%r8
xor    %ecx,%ecx
mov    $0x4,%r9d
call   1030 <sendto@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_log>:
mov    %rcx,%r8
xor    %ecx,%ecx
mov    $0x4,%r9d
jmp    1030 <sendto@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
define void @send_log(i32 %0, i8* %1, i32 %2, %struct.sockaddr_in* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.sockaddr_in*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store %struct.sockaddr_in* %3, %struct.sockaddr_in** %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load %struct.sockaddr_in*, %struct.sockaddr_in** %8
%13 = call i32 @sendto(i32 %9, i8* %10, i32 %11, i32 0, %struct.sockaddr_in* %12, i32 4)
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
define void @send_log(i32 %0, i8* %1, i32 %2, %struct.sockaddr_in* %3) {
%5 = tail call i32 @sendto(i32 %0, i8* %1, i32 %2, i32 0, %struct.sockaddr_in* %3, i32 4)
ret void
}
/* Variables and functions */
char *strncpy(char *, char *, int);
char *timlib_strncpy(char *s1, char *s2, int count) {
  char *results;
  results = strncpy(s1, s2, count);
  *(s1 + count) = '\0';
  return results;
}


x86 assembly (clang, -O0):
<timlib_strncpy>:
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),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_strncpy>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movslq %ebp,%rcx
movb   $0x0,(%rbx,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @timlib_strncpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i8* @strncpy(i8* %8, i8* %9, i32 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %7
ret i8* %16
}

LLVM IR (-O2):
define i8* @timlib_strncpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @strncpy(i8* %0, i8* %1, i32 %2)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ prtimes();
int /*<<< orphan*/ stderr;
void um_halt(void) {
  fprintf(stderr, "UMX"
                  "/"
                  "i386"
                  ": HALT after ");
  prtimes();
  exit(0);
}


x86 assembly (clang, -O0):
<um_halt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <prtimes@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<um_halt>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <prtimes@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"UMX/i386: HALT after \00"
define void @um_halt() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @prtimes()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"UMX/i386: HALT after \00"
define void @um_halt() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @prtimes()
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ write_instr(int);
void eval_sqrt(void) { write_instr(0x26); }


x86 assembly (clang, -O0):
<eval_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x26,%edi
call   1030 <write_instr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_sqrt>:
mov    $0x26,%edi
jmp    1030 <write_instr@plt>

LLVM IR (-O0):
define void @eval_sqrt() {
%1 = call i32 @write_instr(i32 38)
ret void
}

LLVM IR (-O2):
define void @eval_sqrt() {
%1 = tail call i32 @write_instr(i32 38)
ret void
}
void gtk_tree_get_row_drag_data() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_get_row_drag_data() {
ret void
}
void ncsi_stop_dev(struct ncsi_dev *nd) {}


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

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

LLVM IR (-O0):
%struct.ncsi_dev = type opaque
define void @ncsi_stop_dev(%struct.ncsi_dev* %0) {
%2 = alloca %struct.ncsi_dev*
store %struct.ncsi_dev* %0, %struct.ncsi_dev** %2
ret void
}

LLVM IR (-O2):
%struct.ncsi_dev = type opaque
define void @ncsi_stop_dev(%struct.ncsi_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void err(char *s) {
  printf("? %s\n", s);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"? %s\0A\00"
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"? %s\0A\00"
define void @err(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int main() {
  int x1, y1, z1, z2, z3;
  int p1, p2;
  int x2, y2, z4, z5;
  {
    if (p1)
      x1 = 2;
    else
      x1 = 3;
  };
  {
    if (p2)
      y1 = 9;
    else
      y1 = 10;
  };
  z1 = x1 | y1;
  z2 = x1 & y1;
  z3 = x1 ^ y1;
  {
    if (p1)
      x2 = -2;
    else
      x2 = 3;
  };
  {
    if (p2)
      y2 = 9;
    else
      y2 = 10;
  };
  z4 = x2 | y2;
  z5 = x2 & y2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1121 <main+0x21>
movl   $0x2,-0x8(%rbp)
jmp    1128 <main+0x28>
movl   $0x3,-0x8(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     113e <main+0x3e>
movl   $0x9,-0xc(%rbp)
jmp    1145 <main+0x45>
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1176 <main+0x76>
movl   $0xfffffffe,-0x24(%rbp)
jmp    117d <main+0x7d>
movl   $0x3,-0x24(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1193 <main+0x93>
movl   $0x9,-0x28(%rbp)
jmp    119a <main+0x9a>
movl   $0xa,-0x28(%rbp)
mov    -0x24(%rbp),%eax
or     -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
and    -0x28(%rbp),%eax
mov    %eax,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
%13 = load i32, i32* %7
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %0
store i32 2, i32* %2
br label %17
16: ; preds = %0
store i32 3, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %8
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 9, i32* %3
br label %22
21: ; preds = %17
store i32 10, i32* %3
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = or i32 %23, %24
store i32 %25, i32* %4
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = and i32 %26, %27
store i32 %28, i32* %5
%29 = load i32, i32* %2
%30 = load i32, i32* %3
%31 = xor i32 %29, %30
store i32 %31, i32* %6
%32 = load i32, i32* %7
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %22
store i32 -2, i32* %9
br label %36
35: ; preds = %22
store i32 3, i32* %9
br label %36
36: ; preds = %35, %34
%37 = load i32, i32* %8
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %36
store i32 9, i32* %10
br label %41
40: ; preds = %36
store i32 10, i32* %10
br label %41
41: ; preds = %40, %39
%42 = load i32, i32* %9
%43 = load i32, i32* %10
%44 = or i32 %42, %43
store i32 %44, i32* %11
%45 = load i32, i32* %9
%46 = load i32, i32* %10
%47 = and i32 %45, %46
store i32 %47, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char);
int supprEnter(char *chaine) {
  char *positionEntree = NULL;
  positionEntree = strchr(chaine, '\n');
  if (positionEntree != NULL) {
    *positionEntree = '\0';
  }
  return 1;
}


x86 assembly (clang, -O0):
<supprEnter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1148 <supprEnter+0x38>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<supprEnter>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <supprEnter+0x13>
movb   $0x0,(%rax)
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @supprEnter(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret i32 1
}
void mdp4_dmae_done_dtv(void) {}


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

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

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

LLVM IR (-O2):
define void @mdp4_dmae_done_dtv() {
ret void
}
double OP_BitInv(double op1, double op2) { return (double)~((long int)op1); }


x86 assembly (clang, -O0):
<OP_BitInv>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
cvttsd2si -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP_BitInv>:
cvttsd2si %xmm0,%rax
not    %rax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
ret

LLVM IR (-O0):
define double @OP_BitInv(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 = fptosi double %5 to i64
%7 = xor i64 %6, -1
%8 = sitofp i64 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @OP_BitInv(double %0, double %1) {
%3 = fptosi double %0 to i64
%4 = xor i64 %3, -1
%5 = sitofp i64 %4 to double
ret double %5
}
void ctl_sustain(int channel, int val) {}


x86 assembly (clang, -O0):
<ctl_sustain>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ctl_sustain(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @ctl_sustain(i32 %0, i32 %1) {
ret void
}
void mxm_8x10_mmc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @mxm_8x10_mmc_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CRL_INFO;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_CRL_INFO_it;
int i2d_X509_CRL_INFO(X509_CRL_INFO *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CRL_INFO_it);
}


x86 assembly (clang, -O0):
<i2d_X509_CRL_INFO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb9(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_X509_CRL_INFO>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@X509_CRL_INFO_it = global i32 0
define i32 @i2d_X509_CRL_INFO(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @X509_CRL_INFO_it)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  extern int a;
  printf("%d\n", a);
  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)
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@a = external global i32
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @a
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
struct timeval {
  int dummy;
};
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC_RAW;
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ timespec_to_timeval(struct timeval *, struct timespec *);
int timeval_now_monotonic_raw(struct timeval *tv) {
  struct timespec ts;
  int rc;
  rc = clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
  timespec_to_timeval(tv, &ts);
  return rc;
}


x86 assembly (clang, -O0):
<timeval_now_monotonic_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <timespec_to_timeval@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_now_monotonic_raw>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%r14
mov    %r14,%rsi
call   1030 <clock_gettime@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <timespec_to_timeval@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC_RAW = global i32 0
define i32 @timeval_now_monotonic_raw(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca %struct.timespec
%4 = alloca i32
store %struct.timeval* %0, %struct.timeval** %2
%5 = load i32, i32* @CLOCK_MONOTONIC_RAW
%6 = call i32 @clock_gettime(i32 %5, %struct.timespec* %3)
store i32 %6, i32* %4
%7 = load %struct.timeval*, %struct.timeval** %2
%8 = call i32 @timespec_to_timeval(%struct.timeval* %7, %struct.timespec* %3)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC_RAW = global i32 0
define i32 @timeval_now_monotonic_raw(%struct.timeval* %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = load i32, i32* @CLOCK_MONOTONIC_RAW
%5 = call i32 @clock_gettime(i32 %4, %struct.timespec* %2)
%6 = call i32 @timespec_to_timeval(%struct.timeval* %0, %struct.timespec* %2)
ret i32 %5
}
int f9(int f(int), int i) { return f(i); }


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f9>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @f9(i32 (i32)* nocapture %0, i32 %1) {
%3 = tail call i32 %0(i32 %1)
ret i32 %3
}
int verify16(const char *y, const char *x) {
  int res = 0;
  for (int i = 0; i < 16; i++)
    res |= (y[i] ^ x[i]);
  return res;
}


x86 assembly (clang, -O0):
<verify16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x10,-0x18(%rbp)
jge    1152 <verify16+0x52>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
xor    %ecx,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111a <verify16+0x1a>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify16>:
movdqu (%rdi),%xmm0
movdqu (%rsi),%xmm1
pxor   %xmm0,%xmm1
pshufd $0xee,%xmm1,%xmm0
por    %xmm1,%xmm0
pshufd $0x55,%xmm0,%xmm1
por    %xmm0,%xmm1
movdqa %xmm1,%xmm0
psrld  $0x10,%xmm0
por    %xmm1,%xmm0
movdqa %xmm0,%xmm1
psrlw  $0x8,%xmm1
por    %xmm0,%xmm1
movd   %xmm1,%eax
movsbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @verify16(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to <16 x i8>*
%4 = load <16 x i8>, <16 x i8>* %3
%5 = bitcast i8* %1 to <16 x i8>*
%6 = load <16 x i8>, <16 x i8>* %5
%7 = xor <16 x i8> %6, %4
%8 = call i8 @llvm.vector.reduce.or.v16i8(<16 x i8> %7)
%9 = sext i8 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t value_barrier_u32(uint32_t a) {
  __asm__("" : "+r"(a) :);
  return a;
}


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

x86 assembly (clang, -O2):
<value_barrier_u32>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @value_barrier_u32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @value_barrier_u32(i8* readnone %0) {
%2 = tail call i8* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
int t(int a, int b, int c, int d) {
  int r;
  if (a > 0) {
    r = a + b;
    r += 0x456;
    r *= 0x1234567;
  } else {
    r = b - a;
    r -= 0x123;
    r *= 0x12387;
    r += d;
  }
  return r;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113d <t+0x3d>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x456,%eax
mov    %eax,-0x14(%rbp)
imul   $0x1234567,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <t+0x64>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x123,%eax
mov    %eax,-0x14(%rbp)
imul   $0x12387,-0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
test   %edi,%edi
jle    1112 <t+0x12>
add    %edi,%esi
imul   $0x1234567,%esi,%eax
add    $0xeeeeec9a,%eax
ret
sub    %edi,%esi
imul   $0x12387,%esi,%eax
add    %ecx,%eax
add    $0xfeb49d8b,%eax
ret

LLVM IR (-O0):
define i32 @t(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
store i32 %15, i32* %9
%16 = load i32, i32* %9
%17 = add nsw i32 %16, 1110
store i32 %17, i32* %9
%18 = load i32, i32* %9
%19 = mul nsw i32 %18, 19088743
store i32 %19, i32* %9
br label %31
20: ; preds = %4
%21 = load i32, i32* %6
%22 = load i32, i32* %5
%23 = sub nsw i32 %21, %22
store i32 %23, i32* %9
%24 = load i32, i32* %9
%25 = sub nsw i32 %24, 291
store i32 %25, i32* %9
%26 = load i32, i32* %9
%27 = mul nsw i32 %26, 74631
store i32 %27, i32* %9
%28 = load i32, i32* %8
%29 = load i32, i32* %9
%30 = add nsw i32 %29, %28
store i32 %30, i32* %9
br label %31
31: ; preds = %20, %12
%32 = load i32, i32* %9
ret i32 %32
}

LLVM IR (-O2):
define i32 @t(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = add nsw i32 %1, %0
%8 = mul i32 %7, 19088743
%9 = add i32 %8, -286331750
br label %15
10: ; preds = %4
%11 = sub nsw i32 %1, %0
%12 = mul i32 %11, 74631
%13 = add i32 %12, -21717621
%14 = add nsw i32 %13, %3
br label %15
15: ; preds = %10, %6
%16 = phi i32 [ %9, %6 ], [ %14, %10 ]
ret i32 %16
}
int g_is_notequal_f(float s, float d) { return (s >= d); }


x86 assembly (clang, -O0):
<g_is_notequal_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_is_notequal_f>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @g_is_notequal_f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp oge float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @g_is_notequal_f(float %0, float %1) {
%3 = fcmp oge float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void mystrncpy(char *dest, char *src, int len) { memcpy(dest, src, len + 1); }


x86 assembly (clang, -O0):
<mystrncpy>:
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),%rsi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrncpy>:
add    $0x1,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @mystrncpy(i8* %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %4)
ret void
}
void RTTestISub(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestISub() {
ret void
}
char *ChkAlloc(size, name)
int size;
char *name;
{
  register char *cp;
  if (!(cp = malloc((unsigned int)size)))
    error("Can't allocate %d bytes for %s", size, name);
  return (cp);
}


x86 assembly (clang, -O0):
<ChkAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115c <ChkAlloc+0x3c>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChkAlloc>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    %edi,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <ChkAlloc+0x2b>
lea    0xec1(%rip),%rdi
mov    %ebp,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Can't allocate %d bytes for %s\00"
define i8* @ChkAlloc(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i8*, i8** %4
%13 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %12)
br label %14
14: ; preds = %10, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [31 x i8] c"Can't allocate %d bytes for %s\00"
define i8* @ChkAlloc(i32 %0, i8* %1) {
%3 = zext i32 %0 to i64
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i32, i8*, ...)*)(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
const char *I_NoAppServicesGetLocalUserName(void) { return ""; }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @I_NoAppServicesGetLocalUserName() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @I_NoAppServicesGetLocalUserName() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, double);
int /*<<< orphan*/ sscanf(char *, char *, double *);
double parseNum(char *a, int radix) {
  double d;
  sscanf(a, "%lf", &d);
  printf("\nConverted string %s to double %lf", a, d);
  return d;
}


x86 assembly (clang, -O0):
<parseNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xee5(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0x8(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseNum>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xef0(%rip),%rsi
lea    0x8(%rsp),%rdx
call   1040 <sscanf@plt>
movsd  0x8(%rsp),%xmm0
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [35 x i8] c"\0AConverted string %s to double %lf\00"
define double @parseNum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca double
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @sscanf(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %5)
%8 = load i8*, i8** %3
%9 = load double, double* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %8, double %9)
%11 = load double, double* %5
ret double %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [35 x i8] c"\0AConverted string %s to double %lf\00"
define double @parseNum(i8* %0, i32 %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
%6 = load double, double* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %0, double %6)
%8 = load double, double* %3
ret double %8
}