xunge/DecIR huggingface dataset:
char *peApiName(void) { return "epoll"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"epoll\00"
define i8* @peApiName() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void __attribute__((__warning__(
    "curl_easy_getinfo expects a pointer to curl_socket_t for this info")))
__attribute__((__unused__)) __attribute__((__no__))
_curl_easy_getinfo_err_curl_socket(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_getinfo_err_curl_socket() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delete_all();
void menu_delete(void) { delete_all(); }


x86 assembly (clang, -O0):
<menu_delete>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <delete_all@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @menu_delete() {
%1 = call i32 (...) @delete_all()
ret void
}

LLVM IR (-O2):
define void @menu_delete() {
%1 = tail call i32 (...) @delete_all()
ret void
}
/* Type definitions */
struct vfsmount {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ IS_ERR_OR_NULL(int /*<<< orphan*/);
int /*<<< orphan*/ real_mount(struct vfsmount *);
int is_mounted(struct vfsmount *mnt) {
  return !IS_ERR_OR_NULL(real_mount(mnt));
}


x86 assembly (clang, -O0):
<is_mounted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <real_mount@plt>
mov    %eax,%edi
call   1040 <IS_ERR_OR_NULL@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_mounted>:
push   %rax
call   1030 <real_mount@plt>
mov    %eax,%edi
call   1040 <IS_ERR_OR_NULL@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.vfsmount = type { i32 }
define i32 @is_mounted(%struct.vfsmount* %0) {
%2 = alloca %struct.vfsmount*
store %struct.vfsmount* %0, %struct.vfsmount** %2
%3 = load %struct.vfsmount*, %struct.vfsmount** %2
%4 = call i32 @real_mount(%struct.vfsmount* %3)
%5 = call i32 @IS_ERR_OR_NULL(i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.vfsmount = type { i32 }
define i32 @is_mounted(%struct.vfsmount* %0) {
%2 = tail call i32 @real_mount(%struct.vfsmount* %0)
%3 = tail call i32 @IS_ERR_OR_NULL(i32 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void g() {
  float x$1 = 0x1.8p+2f;
  printf("%f\n", x$1);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xecf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
lea    0xef1(%rip),%rdi
movsd  0xee1(%rip),%xmm0
mov    $0x1,%al
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define void @g() {
%1 = alloca float
store float 6.000000e+00, float* %1
%2 = load float, float* %1
%3 = fpext float %2 to double
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @g() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 6.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(char, int);
int /*<<< orphan*/ ft_putstr_fd(char const *, int);
void ft_putendl_fd(char const *s, int fd) {
  if (s) {
    ft_putstr_fd(s, fd);
    ft_putchar_fd('\n', fd);
  }
}


x86 assembly (clang, -O0):
<ft_putendl_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <ft_putendl_fd+0x33>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ft_putstr_fd@plt>
mov    -0xc(%rbp),%esi
mov    $0xa,%edi
call   1040 <ft_putchar_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl_fd>:
test   %rdi,%rdi
je     113a <ft_putendl_fd+0x1a>
push   %rbx
mov    %esi,%ebx
call   1030 <ft_putstr_fd@plt>
mov    $0xa,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <ft_putchar_fd@plt>
ret

LLVM IR (-O0):
define void @ft_putendl_fd(i8* %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 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @ft_putstr_fd(i8* %8, i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @ft_putchar_fd(i8 signext 10, i32 %11)
br label %13
13: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @ft_putstr_fd(i8* %0, i32 %1)
%6 = tail call i32 @ft_putchar_fd(i8 signext 10, i32 %1)
br label %7
7: ; preds = %4, %2
ret void
}
unsigned int func2(double d) { return (unsigned int)d; }


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

x86 assembly (clang, -O2):
<func2>:
cvttsd2si %xmm0,%rax
ret

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

LLVM IR (-O2):
define i32 @func2(double %0) {
%2 = fptoui double %0 to i32
ret i32 %2
}
/* Variables and functions */
int lcd_read(int /*<<< orphan*/);
int /*<<< orphan*/ pmp_master_write(int);
int /*<<< orphan*/ pmp_set_address(int);
void lcd_write(int addr, int c) {
  while ((lcd_read(0) & 0x80))
    ;
  pmp_set_address(addr);
  pmp_master_write(c);
}


x86 assembly (clang, -O0):
<lcd_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <lcd_read@plt>
and    $0x80,%eax
cmp    $0x0,%eax
je     1158 <lcd_write+0x28>
jmp    113e <lcd_write+0xe>
mov    -0x4(%rbp),%edi
call   1050 <pmp_set_address@plt>
mov    -0x8(%rbp),%edi
call   1030 <pmp_master_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_write>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1040 <lcd_read@plt>
test   $0x80,%al
jne    1140 <lcd_write+0x10>
mov    %ebp,%edi
call   1050 <pmp_set_address@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <pmp_master_write@plt>

LLVM IR (-O0):
define void @lcd_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = call i32 @lcd_read(i32 0)
%7 = and i32 %6, 128
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load i32, i32* %3
%12 = call i32 @pmp_set_address(i32 %11)
%13 = load i32, i32* %4
%14 = call i32 @pmp_master_write(i32 %13)
ret void
}

LLVM IR (-O2):
define void @lcd_write(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @lcd_read(i32 0)
%5 = and i32 %4, 128
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3
%8 = tail call i32 @pmp_set_address(i32 %0)
%9 = tail call i32 @pmp_master_write(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ nrerror(char *);
float *vector(int nl, int nh) {
  float *v;
  v = (float *)malloc((unsigned)(nh - nl + 1) * sizeof(float));
  if (!v)
    nrerror("allocation failure in vector()");
  return v - nl;
}


x86 assembly (clang, -O0):
<vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <vector+0x3f>
lea    0xea6(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x4(,%rsi,4),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1147 <vector+0x27>
lea    0xebe(%rip),%rdi
call   1030 <nrerror@plt>
movslq %ebp,%rax
shl    $0x2,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"allocation failure in vector()\00"
define float* @vector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to float*
store float* %14, float** %5
%15 = load float*, float** %5
%16 = icmp ne float* %15, null
br i1 %16, label %19, label %17
17: ; preds = %2
%18 = call i32 @nrerror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
%20 = load float*, float** %5
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = sub i64 0, %22
%24 = getelementptr inbounds float, float* %20, i64 %23
ret float* %24
}

LLVM IR (-O2):
@.str = [31 x i8] c"allocation failure in vector()\00"
define float* @vector(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = shl i32 %3, 2
%5 = add i32 %4, 4
%6 = tail call i64 @malloc(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to float*
%12 = sext i32 %0 to i64
%13 = sub nsw i64 0, %12
%14 = getelementptr inbounds float, float* %11, i64 %13
ret float* %14
}
int NE_OP(int x, int y) { return x != y; }


x86 assembly (clang, -O0):
<NE_OP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NE_OP>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @NE_OP(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 = icmp ne i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @NE_OP(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
bool is_pow2(int n) { return (n & (n - 1)) == 0; }


x86 assembly (clang, -O0):
<is_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pow2>:
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_pow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_pow2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
void init_file(struct v7 *v7) { (void)v7; }


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

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

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

LLVM IR (-O2):
%struct.v7 = type opaque
define void @init_file(%struct.v7* nocapture %0) {
ret void
}
unsigned short get_uint16(unsigned char *p) { return *p + (p[1] << 8); }


x86 assembly (clang, -O0):
<get_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint16>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @get_uint16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = add nsw i32 %5, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @get_uint16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
%7 = shl nuw i16 %6, 8
%8 = or i16 %7, %3
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ os_usleep(int, int /*<<< orphan*/);
int do_wait(int nsec) {
  int rv = 0;
  if (nsec > 0)
    os_usleep(nsec, 0);
  return (rv);
}


x86 assembly (clang, -O0):
<do_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1136 <do_wait+0x26>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <os_usleep@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_wait>:
test   %edi,%edi
jle    1120 <do_wait+0x10>
push   %rax
xor    %esi,%esi
call   1030 <os_usleep@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @do_wait(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @os_usleep(i32 %0, i32 0)
br label %5
5: ; preds = %3, %1
ret i32 0
}
int indexof(char k) {}


x86 assembly (clang, -O0):
<indexof>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @indexof(i8 signext %0) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_fork;
int /*<<< orphan*/ syscall_0(int /*<<< orphan*/);
pid_t fork(void) { return (pid_t)syscall_0(SYS_fork); }


x86 assembly (clang, -O0):
<fork>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall_0@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall_0@plt>

LLVM IR (-O0):
@SYS_fork = global i32 0
define i32 @fork() {
%1 = load i32, i32* @SYS_fork
%2 = call i32 @syscall_0(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@SYS_fork = global i32 0
define i32 @fork() {
%1 = load i32, i32* @SYS_fork
%2 = tail call i32 @syscall_0(i32 %1)
ret i32 %2
}
/* Type definitions */
struct event_base {
  int dummy;
};

/* Variables and functions */
int event_base_loop(struct event_base *, int /*<<< orphan*/);
int event_base_dispatch(struct event_base *base) {
  return event_base_loop(base, 0);
}


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

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

LLVM IR (-O0):
%struct.event_base = type { i32 }
define i32 @event_base_dispatch(%struct.event_base* %0) {
%2 = alloca %struct.event_base*
store %struct.event_base* %0, %struct.event_base** %2
%3 = load %struct.event_base*, %struct.event_base** %2
%4 = call i32 @event_base_loop(%struct.event_base* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.event_base = type { i32 }
define i32 @event_base_dispatch(%struct.event_base* %0) {
%2 = tail call i32 @event_base_loop(%struct.event_base* %0, i32 0)
ret i32 %2
}
int test_imm_74uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x74 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_74uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x74,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_74uint64_lowword_reg>:
test   $0x74,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_74uint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 116
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_74uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 116
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
void inthandler(int s) {
  printf("Received singal %d..waiting\n", s);
  sleep(2);
  printf("leaving inthandler\n");
}


x86 assembly (clang, -O0):
<inthandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inthandler>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
lea    0xecb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Received singal %d..waiting\0A\00"
@.str.1 = [20 x i8] c"leaving inthandler\0A\00"
define void @inthandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @sleep(i32 2)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Received singal %d..waiting\0A\00"
@str = [19 x i8] c"leaving inthandler\00"
define void @inthandler(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_48int16_mem(short *val) {
  return ((*val) & (0x48 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_48int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x48,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_48int16_mem>:
testb  $0x48,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_48int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 72
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_48int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 72
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int AA_MAX(int, int);
int AA_MIN(int, int);
int aa_cla_dgelsd_nlvl(int, int);
int aa_cla_dgelsd_miniwork(int m, int n) {
  int minmn = AA_MIN(m, n);
  int nlvl = aa_cla_dgelsd_nlvl(m, n);
  return AA_MAX(1, 3 * minmn * nlvl + 11 * minmn);
}


x86 assembly (clang, -O0):
<aa_cla_dgelsd_miniwork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <AA_MIN@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <aa_cla_dgelsd_nlvl@plt>
mov    %eax,-0x10(%rbp)
imul   $0x3,-0xc(%rbp),%esi
imul   -0x10(%rbp),%esi
imul   $0xb,-0xc(%rbp),%eax
add    %eax,%esi
mov    $0x1,%edi
call   1050 <AA_MAX@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_cla_dgelsd_miniwork>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <AA_MIN@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <aa_cla_dgelsd_nlvl@plt>
lea    (%rax,%rax,2),%esi
add    $0xb,%esi
imul   %r14d,%esi
mov    $0x1,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <AA_MAX@plt>

LLVM IR (-O0):
define i32 @aa_cla_dgelsd_miniwork(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @AA_MIN(i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @aa_cla_dgelsd_nlvl(i32 %10, i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = mul nsw i32 3, %13
%15 = load i32, i32* %6
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %5
%18 = mul nsw i32 11, %17
%19 = add nsw i32 %16, %18
%20 = call i32 @AA_MAX(i32 1, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @aa_cla_dgelsd_miniwork(i32 %0, i32 %1) {
%3 = tail call i32 @AA_MIN(i32 %0, i32 %1)
%4 = tail call i32 @aa_cla_dgelsd_nlvl(i32 %0, i32 %1)
%5 = mul i32 %4, 3
%6 = add i32 %5, 11
%7 = mul i32 %6, %3
%8 = tail call i32 @AA_MAX(i32 1, i32 %7)
ret i32 %8
}
int priority(op)
int op;
{
  switch (op) {
  case 14:
    return (2);
  case 24:
  case 19:
    return (1);
  case 34:
  case 29:
    return (0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<priority>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffff2,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x14,%eax
ja     1154 <priority+0x54>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x2,-0x4(%rbp)
jmp    115b <priority+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    115b <priority+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    115b <priority+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<priority>:
add    $0xfffffff2,%edi
cmp    $0x14,%edi
ja     111d <priority+0x1d>
mov    $0x2,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @priority(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 14, label %5
i32 24, label %6
i32 19, label %6
i32 34, label %7
i32 29, label %7
]
5: ; preds = %1
store i32 2, i32* %2
br label %9
6: ; preds = %1, %1
store i32 1, i32* %2
br label %9
7: ; preds = %1, %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @priority(i32 %0) {
switch i32 %0, label %4 [
i32 14, label %5
i32 24, label %2
i32 19, label %2
i32 34, label %3
i32 29, label %3
]
2: ; preds = %1, %1
br label %5
3: ; preds = %1, %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3, %2
%6 = phi i32 [ 0, %4 ], [ 0, %3 ], [ 1, %2 ], [ 2, %1 ]
ret i32 %6
}
/* Variables and functions */
char *strerror(int);
char *_SysErrorMsg(int n) {
  char *s = strerror(n);
  return (s ? s : "unknown error");
}


x86 assembly (clang, -O0):
<_SysErrorMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <strerror@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113f <_SysErrorMsg+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    114f <_SysErrorMsg+0x3f>
lea    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    114f <_SysErrorMsg+0x3f>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_SysErrorMsg>:
push   %rax
call   1030 <strerror@plt>
test   %rax,%rax
lea    0xee0(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"unknown error\00"
define i8* @_SysErrorMsg(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @strerror(i32 %4)
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
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %8
%12 = phi i8* [ %9, %8 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %10 ]
ret i8* %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"unknown error\00"
define i8* @_SysErrorMsg(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int usage(char **argv) {
  printf("\nUsage: %s %s file.bin\n\n", argv[-1], argv[0]);
  return 1;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    -0x8(%rdi),%rsi
mov    (%rdi),%rdx
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0AUsage: %s %s file.bin\0A\0A\00"
define i32 @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 -1
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %2
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %8)
ret i32 1
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0AUsage: %s %s file.bin\0A\0A\00"
define i32 @usage(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 -1
%3 = load i8*, i8** %2
%4 = load i8*, i8** %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret i32 1
}
void YUY2ToUV422Row_NEON() {}


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

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

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

LLVM IR (-O2):
define void @YUY2ToUV422Row_NEON() {
ret void
}
/* Variables and functions */
double pow(double, double);
double windchill(double F, double mph) {
  double a = pow(mph, 0.16);
  double wChill = 35.74 + .6215 * F - 35.75 * a + 0.4275 * F * a;
  return wChill;
}


x86 assembly (clang, -O0):
<windchill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xef1(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeca(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xea5(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe8d(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<windchill>:
push   %rax
movapd %xmm1,%xmm2
movsd  %xmm0,(%rsp)
movsd  0xede(%rip),%xmm1
movapd %xmm2,%xmm0
call   1030 <pow@plt>
movsd  0xed5(%rip),%xmm1
movsd  (%rsp),%xmm3
mulsd  %xmm3,%xmm1
addsd  0xecc(%rip),%xmm1
movsd  0xecc(%rip),%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
mulsd  0xec4(%rip),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @windchill(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %4
%8 = call double @pow(double %7, double 1.600000e-01)
store double %8, double* %5
%9 = load double, double* %3
%10 = call double @llvm.fmuladd.f64(double 6.215000e-01, double %9, double 3.574000e+01)
%11 = load double, double* %5
%12 = call double @llvm.fmuladd.f64(double -3.575000e+01, double %11, double %10)
%13 = load double, double* %3
%14 = fmul double 4.275000e-01, %13
%15 = load double, double* %5
%16 = call double @llvm.fmuladd.f64(double %14, double %15, double %12)
store double %16, double* %6
%17 = load double, double* %6
ret double %17
}

LLVM IR (-O2):
define double @windchill(double %0, double %1) {
%3 = tail call double @pow(double %1, double 1.600000e-01)
%4 = tail call double @llvm.fmuladd.f64(double %0, double 6.215000e-01, double 3.574000e+01)
%5 = tail call double @llvm.fmuladd.f64(double %3, double -3.575000e+01, double %4)
%6 = fmul double %0, 4.275000e-01
%7 = tail call double @llvm.fmuladd.f64(double %6, double %3, double %5)
ret double %7
}
/* Type definitions */
typedef int const int32_t;

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


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @mod(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
void udpsrvdtls_init() {}


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

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

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

LLVM IR (-O2):
define void @udpsrvdtls_init() {
ret void
}
/* Variables and functions */
size_t strlen(char const *);
char *strncpy(char *, char const *, size_t);
char *sdtools_strncpy(char *dest, const char *src, size_t n) {
  char *rv = strncpy(dest, src, n);
  dest[(strlen(src) < n) ? strlen(src) : n] = '\0';
  return rv;
}


x86 assembly (clang, -O0):
<sdtools_strncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    -0x18(%rbp),%rax
jae    1176 <sdtools_strncpy+0x56>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x30(%rbp)
jmp    117e <sdtools_strncpy+0x5e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x30(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdtools_strncpy>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strncpy@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
cmp    %rbx,%rax
cmovb  %rax,%rbx
movb   $0x0,(%r15,%rbx,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @sdtools_strncpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @strncpy(i8* %8, i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i64 @strlen(i8* %13)
%15 = load i64, i64* %6
%16 = icmp ult i64 %14, %15
br i1 %16, label %17, label %20
17: ; preds = %3
%18 = load i8*, i8** %5
%19 = call i64 @strlen(i8* %18)
br label %22
20: ; preds = %3
%21 = load i64, i64* %6
br label %22
22: ; preds = %20, %17
%23 = phi i64 [ %19, %17 ], [ %21, %20 ]
%24 = getelementptr inbounds i8, i8* %12, i64 %23
store i8 0, i8* %24
%25 = load i8*, i8** %7
ret i8* %25
}

LLVM IR (-O2):
define i8* @sdtools_strncpy(i8* returned %0, i8* nocapture %1, i64 %2) {
%4 = tail call i8* @strncpy(i8* dereferenceable(1) %0, i8* %1, i64 %2)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = icmp ult i64 %5, %2
%7 = select i1 %6, i64 %5, i64 %2
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret i8* %0
}
int __doTurnBet(struct hand *thishand) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.hand = type opaque
define i32 @__doTurnBet(%struct.hand* nocapture readnone %0) {
ret i32 0
}
unsigned char apollo_get_version(void) { return (0); }


x86 assembly (clang, -O0):
<apollo_get_version>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @apollo_get_version() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @apollo_get_version() {
ret i8 0
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int sum_array_int(int *, int);
void sum_array_int_test(void) {
  assert(sum_array_int(NULL, 0) == 0);
  int a[] = {-10, 0, 10, 11, 12, 13, 14, 100};
  assert(sum_array_int(a, (sizeof(a) / sizeof((a)[0]))) == 150);
}


x86 assembly (clang, -O0):
<sum_array_int_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1030 <sum_array_int@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0xeb6(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1030 <sum_array_int@plt>
cmp    $0x96,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_array_int_test>:
sub    $0x28,%rsp
xor    %edi,%edi
xor    %esi,%esi
call   1030 <sum_array_int@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <sum_array_int@plt>
xor    %edi,%edi
cmp    $0x96,%eax
sete   %dil
call   1040 <assert@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.sum_array_int_test.a = [8 x i32] [i32 -10, i32 0, i32 10, i32 11, i32 12, i32 13, i32 14, i32 100]
define void @sum_array_int_test() {
%1 = alloca [8 x i32]
%2 = call i32 @sum_array_int(i32* null, i32 0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = bitcast [8 x i32]* %1 to i8*
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%8 = call i32 @sum_array_int(i32* %7, i32 8)
%9 = icmp eq i32 %8, 150
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
@__const.sum_array_int_test.a = [8 x i32] [i32 -10, i32 0, i32 10, i32 11, i32 12, i32 13, i32 14, i32 100]
define void @sum_array_int_test() {
%1 = alloca [8 x i32]
%2 = tail call i32 @sum_array_int(i32* null, i32 0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = bitcast [8 x i32]* %1 to i8*
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%8 = call i32 @sum_array_int(i32* %7, i32 8)
%9 = icmp eq i32 %8, 150
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_turnOffStatusLed(void) { printf("Display: Status LED off"); }


x86 assembly (clang, -O0):
<display_turnOffStatusLed>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"Display: Status LED off\00"
define void @display_turnOffStatusLed() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Display: Status LED off\00"
define void @display_turnOffStatusLed() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fftss_init_threads();
void fftss_init_threads_(void) { fftss_init_threads(); }


x86 assembly (clang, -O0):
<fftss_init_threads_>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <fftss_init_threads@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fftss_init_threads_() {
%1 = call i32 (...) @fftss_init_threads()
ret void
}

LLVM IR (-O2):
define void @fftss_init_threads_() {
%1 = tail call i32 (...) @fftss_init_threads()
ret void
}
void swap_integers(int *a, int *b) {
  int t = *a;
  *a = *b;
  *b = t;
}


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

x86 assembly (clang, -O2):
<swap_integers>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @swap_integers(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap_integers(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
struct sockaddr_un {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ peer;

/* Variables and functions */
int accept(int, struct sockaddr *, unsigned int *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int do_accept(int s) {
  struct sockaddr_un peer;
  unsigned int addrlen;
  int fd;
  addrlen = sizeof(peer);
  fd = accept(s, (struct sockaddr *)&peer, &addrlen);
  if (fd == -1) {
    perror("unix accept");
    exit(1);
  }
  return fd;
}


x86 assembly (clang, -O0):
<do_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1175 <do_accept+0x45>
lea    0xe9a(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_accept>:
sub    $0x18,%rsp
movl   $0x4,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1040 <accept@plt>
cmp    $0xffffffff,%eax
je     1155 <do_accept+0x25>
add    $0x18,%rsp
ret
lea    0xea4(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_un = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [12 x i8] c"unix accept\00"
define i32 @do_accept(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_un
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %4
%6 = load i32, i32* %2
%7 = bitcast %struct.sockaddr_un* %3 to %struct.sockaddr*
%8 = call i32 @accept(i32 %6, %struct.sockaddr* %7, i32* %4)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [12 x i8] c"unix accept\00"
define i32 @do_accept(i32 %0) {
%2 = alloca %struct.sockaddr_un
%3 = alloca i32
%4 = bitcast %struct.sockaddr_un* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_un* %2 to %struct.sockaddr*
%7 = call i32 @accept(i32 %0, %struct.sockaddr* %6, i32* %3)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
ret i32 %7
}
/* Variables and functions */
int strcmp(char *, char *);
compareFields(const void *first, const void *second) {
  return strcmp((char *)first, (char *)second);
}


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

x86 assembly (clang, -O2):
<compareFields>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compareFields(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 i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @compareFields(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((no)) catchme(int i) {
  if (i != 0 && i != 64)
    abort();
}


x86 assembly (clang, -O0):
<catchme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1136 <catchme+0x26>
cmpl   $0x40,-0x4(%rbp)
je     1136 <catchme+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catchme>:
test   $0xffffffbf,%edi
jne    1119 <catchme+0x9>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @catchme(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 64
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @catchme(i32 %0) {
%2 = and i32 %0, -65
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
unsigned kol_key_lang_get() {
  asm volatile("int $0x40" ::"a"(26), "b"(2), "c"(9));
}


x86 assembly (clang, -O0):
<kol_key_lang_get>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x1a,%eax
mov    $0x2,%ebx
mov    $0x9,%ecx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_key_lang_get>:
push   %rbx
mov    $0x1a,%eax
mov    $0x2,%ebx
mov    $0x9,%ecx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @kol_key_lang_get() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 26, i32 2, i32 9)
ret i32 undef
}
int main() {
  int y = 3;
  y = ({
    int X = 4;
    X;
  });
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%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
store i32 0, i32* %1
store i32 3, i32* %2
store i32 4, i32* %3
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = load i32, i32* %4
store i32 %6, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
const char *mpCompileTime(void) {
  return "Mar 18 2022"
         " "
         "06:22:18";
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Mar 18 2022 06:22:18\00"
define i8* @mpCompileTime() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [21 x i8] c"Mar 18 2022 06:22:18\00"
define i8* @mpCompileTime() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}
int clog_console_init_callback_fun(void *args) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @clog_console_init_callback_fun(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setupterm(char *, int, int *);
void my_setupterm(const char *term, int fildes, int *errret) {
  setupterm((char *)term, fildes, errret);
}


x86 assembly (clang, -O0):
<my_setupterm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <setupterm@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_setupterm>:
jmp    1030 <setupterm@plt>

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

LLVM IR (-O2):
define void @my_setupterm(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @setupterm(i8* %0, i32 %1, i32* %2)
ret void
}