xunge/DecIR huggingface dataset:
int clip(double s) {
  if (s > 255)
    s = 255;
  if (s < 0)
    s = 0;
  if (s >= 0)
    s = s + 0.5;
  else
    s = s - 0.5;
  return ((int)s);
}


x86 assembly (clang, -O0):
<clip>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    112d <clip+0x2d>
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1143 <clip+0x43>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     116c <clip+0x6c>
movsd  0xeab(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1182 <clip+0x82>
movsd  -0x8(%rbp),%xmm0
movsd  0xe8f(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip>:
movsd  0xef8(%rip),%xmm1
minsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
xorpd  %xmm2,%xmm2
maxsd  %xmm1,%xmm2
xor    %eax,%eax
ucomisd %xmm0,%xmm2
setb   %al
lea    0xee0(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm2
cvttsd2si %xmm2,%eax
ret

LLVM IR (-O0):
define i32 @clip(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 2.550000e+02
br i1 %4, label %5, label %6
5: ; preds = %1
store double 2.550000e+02, double* %2
br label %6
6: ; preds = %5, %1
%7 = load double, double* %2
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
store double 0.000000e+00, double* %2
br label %10
10: ; preds = %9, %6
%11 = load double, double* %2
%12 = fcmp oge double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load double, double* %2
%15 = fadd double %14, 5.000000e-01
store double %15, double* %2
br label %19
16: ; preds = %10
%17 = load double, double* %2
%18 = fsub double %17, 5.000000e-01
store double %18, double* %2
br label %19
19: ; preds = %16, %13
%20 = load double, double* %2
%21 = fptosi double %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @clip(double %0) {
%2 = fcmp ogt double %0, 2.550000e+02
%3 = select i1 %2, double 2.550000e+02, double %0
%4 = fcmp olt double %3, 0.000000e+00
%5 = select i1 %4, double 0.000000e+00, double %3
%6 = fcmp ult double %5, 0.000000e+00
%7 = select i1 %6, double -5.000000e-01, double 5.000000e-01
%8 = fadd double %5, %7
%9 = fptosi double %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int funct(int a, int b) {
  printf("a = %d, b = %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<funct>:
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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"a = %d, b = %d\0A\00"
define i32 @funct(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ append_buffer(struct buffer *, int /*<<< orphan*/);
void buffer_write8(struct buffer *b, uint8_t x) { append_buffer(b, x); }


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

x86 assembly (clang, -O2):
<buffer_write8>:
jmp    1030 <append_buffer@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @buffer_write8(%struct.buffer* %0, i32 %1) {
%3 = alloca %struct.buffer*
%4 = alloca i32
store %struct.buffer* %0, %struct.buffer** %3
store i32 %1, i32* %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = load i32, i32* %4
%7 = call i32 @append_buffer(%struct.buffer* %5, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_write8(%struct.buffer* %0, i32 %1) {
%3 = tail call i32 @append_buffer(%struct.buffer* %0, i32 %1)
ret void
}
/* Variables and functions */
int ntohl(int);
void swap_shdr(int *a, int count) {
  int i;
  for (i = 0; i < count; i++) {
    a[i] = ntohl(a[i]);
  }
}


x86 assembly (clang, -O0):
<swap_shdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <swap_shdr+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <ntohl@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <swap_shdr+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_shdr>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <swap_shdr+0x36>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   1030 <ntohl@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <swap_shdr+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @swap_shdr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @ntohl(i32 %9)
store i32 %10, i32* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *DupString(const char *y) {
  char *x;
  x = malloc(strlen(y) + 1);
  assert(x);
  strcpy(x, y);
  return x;
}


x86 assembly (clang, -O0):
<DupString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DupString>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @DupString(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @assert(i8* %8)
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @DupString(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @assert(i8* %4)
%6 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
struct bss_t {
  int dummy;
};

/* Variables and functions */
int client_num(void *);
int GetCurClient(void *pClient) {
  if ((int)(*(struct bss_t **)0x100000e4) != 0x0a000000) {
    int client = client_num(pClient);
    if (client >= 0) {
      return client;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<GetCurClient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x100000e4,%eax
mov    (%rax),%rax
cmp    $0xa000000,%eax
je     1155 <GetCurClient+0x45>
mov    -0x10(%rbp),%rdi
call   1030 <client_num@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1150 <GetCurClient+0x40>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <GetCurClient+0x4c>
jmp    1155 <GetCurClient+0x45>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetCurClient>:
push   %rax
cmpl   $0xa000000,0x100000e4
je     1129 <GetCurClient+0x19>
call   1030 <client_num@plt>
test   %eax,%eax
js     1129 <GetCurClient+0x19>
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.bss_t = type { i32 }
define i32 @GetCurClient(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load %struct.bss_t*, %struct.bss_t** inttoptr (i64 268435684 to %struct.bss_t**)
%6 = ptrtoint %struct.bss_t* %5 to i32
%7 = icmp ne i32 %6, 167772160
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @client_num(i8* %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %17
15: ; preds = %8
br label %16
16: ; preds = %15, %1
store i32 -1, i32* %2
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.bss_t = type { i32 }
define i32 @GetCurClient(i8* %0) {
%2 = load %struct.bss_t*, %struct.bss_t** inttoptr (i64 268435684 to %struct.bss_t**)
%3 = ptrtoint %struct.bss_t* %2 to i64
%4 = trunc i64 %3 to i32
%5 = icmp eq i32 %4, 167772160
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i32 @client_num(i8* %0)
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6, %1
br label %10
10: ; preds = %6, %9
%11 = phi i32 [ %7, %6 ], [ -1, %9 ]
ret i32 %11
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_IFCHR;
__attribute__((__weak__)) int _fstat(int file __attribute__((unused)),
                                     struct stat *st __attribute__((unused))) {
  st->st_mode = S_IFCHR;
  return 0;
}


x86 assembly (clang, -O0):
<_fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fstat>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFCHR = global i32 0
define weak i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @S_IFCHR
%6 = load %struct.stat*, %struct.stat** %4
%7 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
store i32 %5, i32* %7
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFCHR = global i32 0
define weak i32 @_fstat(i32 %0, %struct.stat* %1) {
%3 = load i32, i32* @S_IFCHR
%4 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
store i32 %3, i32* %4
ret i32 0
}
int ft_sqrt(int n) {
  int i;
  i = 0;
  while (i * i < n && i <= 46340)
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<ft_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x9(%rbp)
jge    1130 <ft_sqrt+0x30>
cmpl   $0xb504,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1140 <ft_sqrt+0x40>
jmp    114e <ft_sqrt+0x4e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <ft_sqrt+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sqrt>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmp    $0xb504,%eax
ja     1123 <ft_sqrt+0x23>
mov    %eax,%ecx
imul   %eax,%ecx
cmp    %edi,%ecx
jl     1110 <ft_sqrt+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_sqrt(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = mul nuw nsw i32 %3, %3
%5 = icmp slt i32 %4, %0
%6 = icmp ult i32 %3, 46341
%7 = and i1 %6, %5
%8 = add nuw nsw i32 %3, 1
br i1 %7, label %2, label %9
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void catch_alrm(int sig_num) {
  printf("\nUser taking too long to respond. Exiting...\n");
  fflush(stdout);
  exit(0);
}


x86 assembly (clang, -O0):
<catch_alrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<catch_alrm>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"\0AUser taking too long to respond. Exiting...\0A\00"
@stdout = global i32 0
define void @catch_alrm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [45 x i8] c"\0AUser taking too long to respond. Exiting...\00"
define void @catch_alrm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
foo(int a, int b) {
  if (a == b)
    if (a == b)
      return a + b;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1135 <foo+0x35>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1130 <foo+0x30>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <foo+0x35>
jmp    1135 <foo+0x35>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = add nsw i32 %1, %0
%5 = select i1 %3, i32 %4, i32 undef
ret i32 %5
}
/* Variables and functions */
scalar_t__ Rand();
double log(scalar_t__);
double expran(double avrage) { return -avrage * log(1e-7 + Rand()); }


x86 assembly (clang, -O0):
<expran>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <Rand@plt>
cvtsi2sd %rax,%xmm1
movsd  0xe9e(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expran>:
sub    $0x18,%rsp
xorps  0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <Rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0xeca(%rip),%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <log@plt>
mulsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @expran(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i64 (...) @Rand()
%6 = sitofp i64 %5 to double
%7 = fadd double 0x3E7AD7F29ABCAF48, %6
%8 = fptosi double %7 to i64
%9 = call double @log(i64 %8)
%10 = fmul double %4, %9
ret double %10
}

LLVM IR (-O2):
define double @expran(double %0) {
%2 = fneg double %0
%3 = tail call i64 (...) @Rand()
%4 = sitofp i64 %3 to double
%5 = fadd double %4, 0x3E7AD7F29ABCAF48
%6 = fptosi double %5 to i64
%7 = tail call double @log(i64 %6)
%8 = fmul double %7, %2
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void test_vmvn_u32x4(uint32_t *__restrict__ dest, uint32_t *a) {
  int i;
  for (i = 0; i < 4; i++) {
    dest[i] = ~a[i];
  }
}


x86 assembly (clang, -O0):
<test_vmvn_u32x4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1144 <test_vmvn_u32x4+0x44>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <test_vmvn_u32x4+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vmvn_u32x4>:
movdqu (%rsi),%xmm0
pcmpeqd %xmm1,%xmm1
pxor   %xmm0,%xmm1
movdqu %xmm1,(%rdi)
ret

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

LLVM IR (-O2):
define void @test_vmvn_u32x4(i32* noalias nocapture writeonly %0, i32* nocapture %1) {
%3 = bitcast i32* %1 to <4 x i32>*
%4 = load <4 x i32>, <4 x i32>* %3
%5 = xor <4 x i32> %4, <i32 -1, i32 -1, i32 -1, i32 -1>
%6 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %5, <4 x i32>* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(unsigned char, int);
int /*<<< orphan*/ slow_down_io();
__attribute__((always_)) void outb_p(unsigned char value, int port) {
  outb(value, port);
  slow_down_io();
}


x86 assembly (clang, -O0):
<outb_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
movzbl %al,%edi
call   1030 <outb@plt>
mov    $0x0,%al
call   1040 <slow_down_io@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @outb_p(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = load i32, i32* %4
%7 = call i32 @outb(i8 zeroext %5, i32 %6)
%8 = call i32 (...) @slow_down_io()
ret void
}

LLVM IR (-O2):
define void @outb_p(i8 zeroext %0, i32 %1) {
%3 = tail call i32 @outb(i8 zeroext %0, i32 %1)
%4 = tail call i32 (...) @slow_down_io()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           int /*<<< orphan*/, int, char const *);
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ stderr;
void abend(const char *r, int e, const char *s) {
  fprintf(stderr, "%s (x%08lx): ABEND Reason code %d, %s\n", r, pthread_self(),
          e, s);
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<abend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2e86(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1060 <pthread_self@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
mov    -0xc(%rbp),%r8d
mov    -0x18(%rbp),%r9
lea    0xe7a(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<abend>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbx
mov    0x2e88(%rip),%r12
mov    (%r12),%ebp
xor    %eax,%eax
call   1060 <pthread_self@plt>
lea    0xe96(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r15d,%r8d
mov    %r14,%r9
call   1040 <fprintf@plt>
mov    (%r12),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"%s (x%08lx): ABEND Reason code %d, %s\0A\00"
define void @abend(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = call i32 (...) @pthread_self()
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i32 %10, i8* %11)
%13 = load i32, i32* @stderr
%14 = call i32 @fflush(i32 %13)
%15 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"%s (x%08lx): ABEND Reason code %d, %s\0A\00"
define void @abend(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 (...) @pthread_self()
%6 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %5, i32 %1, i8* %2)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fflush(i32 %7)
%9 = tail call i32 (...) @abort()
unreachable
}
char *norep() {
  static char *buffer = "";
  return buffer;
}


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

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

LLVM IR (-O0):
@norep.buffer = internal global i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0)
@.str = [1 x i8] zeroinitializer
define i8* @norep() {
%1 = load i8*, i8** @norep.buffer
ret i8* %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @norep() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ recFunc(int);
void foo() { recFunc(5); }


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

x86 assembly (clang, -O2):
<foo>:
mov    $0x5,%edi
jmp    1030 <recFunc@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 @recFunc(i32 5)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 @recFunc(i32 5)
ret void
}
/* Variables and functions */
scalar_t__ platform_mem_allocate(int);
int /*<<< orphan*/ strerror_s(char *, int, int);
const char *platform_strerror(int err) {
  char *buffer = (char *)platform_mem_allocate(128);
  strerror_s(buffer, 128, err);
  return buffer;
}


x86 assembly (clang, -O0):
<platform_strerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x80,%edi
call   1030 <platform_mem_allocate@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    $0x80,%esi
call   1040 <strerror_s@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_strerror>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x80,%edi
call   1030 <platform_mem_allocate@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x80,%esi
mov    %ebp,%edx
call   1040 <strerror_s@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @platform_strerror(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i64 @platform_mem_allocate(i32 128)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = call i32 @strerror_s(i8* %6, i32 128, i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @platform_strerror(i32 %0) {
%2 = tail call i64 @platform_mem_allocate(i32 128)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @strerror_s(i8* %3, i32 128, i32 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int open_listenfd(int);
int /*<<< orphan*/ perror(char *);
int Open_listenfd(int port) {
  int rc = open_listenfd(port);
  if (rc < 0) {
    perror("Open_listenfd error");
    exit(EXIT_FAILURE);
  }
  return rc;
}


x86 assembly (clang, -O0):
<Open_listenfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <open_listenfd@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    116a <Open_listenfd+0x3a>
lea    0xea9(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Open_listenfd>:
push   %rax
call   1050 <open_listenfd@plt>
test   %eax,%eax
js     113c <Open_listenfd+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Open_listenfd error\00"
@EXIT_FAILURE = global i32 0
define i32 @Open_listenfd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @open_listenfd(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [20 x i8] c"Open_listenfd error\00"
@EXIT_FAILURE = global i32 0
define i32 @Open_listenfd(i32 %0) {
%2 = tail call i32 @open_listenfd(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i32 %2
}
int __clk_get(struct clk *clk) { return 1; }


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

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

LLVM IR (-O0):
%struct.clk = type opaque
define i32 @__clk_get(%struct.clk* %0) {
%2 = alloca %struct.clk*
store %struct.clk* %0, %struct.clk** %2
ret i32 1
}

LLVM IR (-O2):
%struct.clk = type opaque
define i32 @__clk_get(%struct.clk* nocapture readnone %0) {
ret i32 1
}
void fill_char(char *c, char *buf) { *c = buf[0] & 0xFF; }


x86 assembly (clang, -O0):
<fill_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_char>:
mov    (%rsi),%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @fill_char(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %3
store i8 %10, i8* %11
ret void
}

LLVM IR (-O2):
define void @fill_char(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
ret void
}
void debug_object_free(void *addr, struct debug_obj_descr *descr) {}


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

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

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

LLVM IR (-O2):
%struct.debug_obj_descr = type opaque
define void @debug_object_free(i8* nocapture %0, %struct.debug_obj_descr* nocapture %1) {
ret void
}
/* Variables and functions */
scalar_t__ __atomic_cmpxchg(int, int, int volatile *);
int __atomic_swap(int _new, volatile int *ptr) {
  int oldValue;
  do {
    oldValue = *ptr;
  } while (__atomic_cmpxchg(oldValue, _new, ptr));
  return oldValue;
}


x86 assembly (clang, -O0):
<__atomic_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <__atomic_cmpxchg@plt>
cmp    $0x0,%rax
jne    111f <__atomic_swap+0xf>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_swap>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%ebp
mov    %ebp,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
call   1030 <__atomic_cmpxchg@plt>
test   %rax,%rax
jne    1120 <__atomic_swap+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @__atomic_swap(i32 %0, i32* %1) {
br label %3
3: ; preds = %3, %2
%4 = load volatile i32, i32* %1
%5 = tail call i64 @__atomic_cmpxchg(i32 %4, i32 %0, i32* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void EPIIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(ulBase == 0x400D0000);
  DEBUG_ASSERT(ulIntFlags < 16);
  (*((volatile unsigned long *)(ulBase + 0x00000210))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<EPIIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x400d0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x10,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x210(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x210(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIIntEnable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x400d0000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x10,%r14
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
or     %r14,0x210(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @EPIIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074593792
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = icmp ult i64 %9, 16
%11 = zext i1 %10 to i32
%12 = call i32 @DEBUG_ASSERT(i32 %11)
%13 = load i64, i64* %4
%14 = load i64, i64* %3
%15 = add i64 %14, 528
%16 = inttoptr i64 %15 to i64*
%17 = load volatile i64, i64* %16
%18 = or i64 %17, %13
store volatile i64 %18, i64* %16
ret void
}

LLVM IR (-O2):
define void @EPIIntEnable(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074593792
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = icmp ult i64 %1, 16
%7 = zext i1 %6 to i32
%8 = tail call i32 @DEBUG_ASSERT(i32 %7)
%9 = add i64 %0, 528
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = or i64 %11, %1
store volatile i64 %12, i64* %10
ret void
}
int compare_int(void *ptr1, void *ptr2) {
  if (*(int *)ptr1 >= *(int *)ptr2)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<compare_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jl     112a <compare_int+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <compare_int+0x31>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setge  %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = select i1 %7, i32 -1, i32 1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ UartOutChar(int /*<<< orphan*/, char);
void out_char(char ch) { UartOutChar(0, ch); }


x86 assembly (clang, -O0):
<out_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
movsbl -0x1(%rbp),%esi
call   1030 <UartOutChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_char>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <UartOutChar@plt>

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

LLVM IR (-O2):
define void @out_char(i8 signext %0) {
%2 = tail call i32 @UartOutChar(i32 0, i8 signext %0)
ret void
}
int f() {
  const int *a;
  int *b;
  b = a;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @f() {
ret i32 0
}
/* Variables and functions */
unsigned short atomic_exchange_and_add(unsigned short volatile *, short);
unsigned short atomic_add_short_nv(volatile unsigned short *target,
                                   short delta) {
  return atomic_exchange_and_add(target, delta) + 1;
}


x86 assembly (clang, -O0):
<atomic_add_short_nv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
movswl -0xa(%rbp),%esi
call   1030 <atomic_exchange_and_add@plt>
movzwl %ax,%eax
add    $0x1,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_add_short_nv>:
push   %rax
call   1030 <atomic_exchange_and_add@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @atomic_add_short_nv(i16* %0, i16 signext %1) {
%3 = alloca i16*
%4 = alloca i16
store i16* %0, i16** %3
store i16 %1, i16* %4
%5 = load i16*, i16** %3
%6 = load i16, i16* %4
%7 = call zeroext i16 @atomic_exchange_and_add(i16* %5, i16 signext %6)
%8 = zext i16 %7 to i32
%9 = add nsw i32 %8, 1
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @atomic_add_short_nv(i16* %0, i16 signext %1) {
%3 = tail call zeroext i16 @atomic_exchange_and_add(i16* %0, i16 signext %1)
%4 = add i16 %3, 1
ret i16 %4
}
void exit(int exit_code) {
  asm("movl %0, %%ebx \n\t"
      "movl $1, %%eax \n\t"
      "int $0x80 \n\t"
      "hlt \n\t"
      :
      : "m"(exit_code));
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ebx
mov    $0x1,%eax
int    $0x80
hlt

x86 assembly (clang, -O2):
<exit>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%ebx
mov    $0x1,%eax
int    $0x80
hlt

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
unreachable
}
/* Variables and functions */
float __nv_fminf(float, float);
float fminf(float __a, float __b) { return __nv_fminf(__a, __b); }


x86 assembly (clang, -O0):
<fminf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__nv_fminf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fminf>:
jmp    1030 <__nv_fminf@plt>

LLVM IR (-O0):
define float @fminf(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 = call float @__nv_fminf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @fminf(float %0, float %1) {
%3 = tail call float @__nv_fminf(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int version_main(int argc, char *argv[]) {
  printf("1.0.0\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<version_main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"1.0.0\0A\00"
define i32 @version_main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"1.0.0\00"
define i32 @version_main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void pathconN_nm10_decref(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_add_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
unsigned int _mm_cvtsi128_si32(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_srli_si128(int /*<<< orphan*/, int);
unsigned int add32x4_sse2(__m128i val) {
  val = _mm_add_epi32(val, _mm_srli_si128(val, 8));
  val = _mm_add_epi32(val, _mm_srli_si128(val, 4));
  return _mm_cvtsi128_si32(val);
}


x86 assembly (clang, -O0):
<add32x4_sse2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1050 <_mm_srli_si128@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_add_epi32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1050 <_mm_srli_si128@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_add_epi32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_mm_cvtsi128_si32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add32x4_sse2>:
push   %rbx
mov    %edi,%ebx
mov    $0x8,%esi
call   1050 <_mm_srli_si128@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <_mm_add_epi32@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    $0x4,%esi
call   1050 <_mm_srli_si128@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <_mm_add_epi32@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <_mm_cvtsi128_si32@plt>

LLVM IR (-O0):
define i32 @add32x4_sse2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @_mm_srli_si128(i32 %4, i32 8)
%6 = call i32 @_mm_add_epi32(i32 %3, i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @_mm_srli_si128(i32 %8, i32 4)
%10 = call i32 @_mm_add_epi32(i32 %7, i32 %9)
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @_mm_cvtsi128_si32(i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @add32x4_sse2(i32 %0) {
%2 = tail call i32 @_mm_srli_si128(i32 %0, i32 8)
%3 = tail call i32 @_mm_add_epi32(i32 %0, i32 %2)
%4 = tail call i32 @_mm_srli_si128(i32 %3, i32 4)
%5 = tail call i32 @_mm_add_epi32(i32 %3, i32 %4)
%6 = tail call i32 @_mm_cvtsi128_si32(i32 %5)
ret i32 %6
}
int sample_plugin(int x) { return x * 2; }


x86 assembly (clang, -O0):
<sample_plugin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_plugin>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @sample_plugin(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t rol64(uint64_t data, unsigned int rotation) {
  return ((data << rotation) | (data >> (64 - rotation)));
}


x86 assembly (clang, -O0):
<rol64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol64>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
shr    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rol64(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 64, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rol64(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 64, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
struct buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ btcmsg_craft_msgheader(struct buff **, char *,
                                          struct buff *);
int btcmsg_craft_tx(struct buff *txBuf, struct buff **bufOut) {
  btcmsg_craft_msgheader(bufOut, "tx", txBuf);
  return 0;
}


x86 assembly (clang, -O0):
<btcmsg_craft_tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <btcmsg_craft_msgheader@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btcmsg_craft_tx>:
push   %rax
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee2(%rip),%rsi
mov    %rax,%rdi
call   1030 <btcmsg_craft_msgheader@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.buff = type { i32 }
@.str = [3 x i8] c"tx\00"
define i32 @btcmsg_craft_tx(%struct.buff* %0, %struct.buff** %1) {
%3 = alloca %struct.buff*
%4 = alloca %struct.buff**
store %struct.buff* %0, %struct.buff** %3
store %struct.buff** %1, %struct.buff*** %4
%5 = load %struct.buff**, %struct.buff*** %4
%6 = load %struct.buff*, %struct.buff** %3
%7 = call i32 @btcmsg_craft_msgheader(%struct.buff** %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.buff* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.buff = type { i32 }
@.str = [3 x i8] c"tx\00"
define i32 @btcmsg_craft_tx(%struct.buff* %0, %struct.buff** %1) {
%3 = tail call i32 @btcmsg_craft_msgheader(%struct.buff** %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.buff* %0)
ret i32 0
}
double kelvin_to_celsius(double kelvin_temp) { return kelvin_temp - 273.15; }


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

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

LLVM IR (-O0):
define double @kelvin_to_celsius(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 2.731500e+02
ret double %4
}

LLVM IR (-O2):
define double @kelvin_to_celsius(double %0) {
%2 = fadd double %0, -2.731500e+02
ret double %2
}
void dup_mm_exe_file(struct mm_struct *oldmm, struct mm_struct *newmm) {}


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

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

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

LLVM IR (-O2):
%struct.mm_struct = type opaque
define void @dup_mm_exe_file(%struct.mm_struct* nocapture %0, %struct.mm_struct* nocapture %1) {
ret void
}