xunge/DecIR huggingface dataset:
int expand_stack(int setsize) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @expand_stack(i32 %0) {
ret i32 -1
}
int main() {
  int x = 0;
  for (int i = 0; i < 2; i = i + 1) {
    x = x + i;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    113a <main+0x3a>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void unset_port_handler(void) {}


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

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

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

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

/* Variables and functions */
int __original_creat(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ lic_fadv_dont(int);
int creat(const char *pathname, int flags, mode_t mode) {
  int ret = -1;
  ret = __original_creat(pathname, flags, mode);
  if (ret != -1)
    lic_fadv_dont(ret);
  return ret;
}


x86 assembly (clang, -O0):
<creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <__original_creat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     115d <creat+0x3d>
mov    -0x14(%rbp),%edi
call   1040 <lic_fadv_dont@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat>:
push   %rbx
call   1030 <__original_creat@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1134 <creat+0x14>
mov    %ebx,%edi
call   1040 <lic_fadv_dont@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @creat(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @__original_creat(i8* %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @lic_fadv_dont(i32 %4)
br label %8
8: ; preds = %6, %3
ret i32 %4
}
_Atomic(int) compound_add(_Atomic(int) in) { return (in += 5); }


x86 assembly (clang, -O0):
<compound_add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x5,%eax
lock xadd %eax,-0x4(%rbp)
add    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compound_add>:
mov    %edi,-0x4(%rsp)
mov    $0x5,%eax
lock xadd %eax,-0x4(%rsp)
add    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @compound_add(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = atomicrmw add i32* %2, i32 5 seq_cst
%4 = add i32 %3, 5
ret i32 %4
}

LLVM IR (-O2):
define i32 @compound_add(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = atomicrmw add i32* %2, i32 5 seq_cst
%4 = add i32 %3, 5
ret i32 %4
}
void RTTcpServerShutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpServerShutdown() {
ret void
}
/* Variables and functions */
int do_smbus_send_byte(int, unsigned int, unsigned char);
int smbus_send_byte(unsigned device, unsigned char val) {
  return do_smbus_send_byte(0x1000, device, val);
}


x86 assembly (clang, -O0):
<smbus_send_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1000,%edi
movzbl -0x5(%rbp),%edx
call   1030 <do_smbus_send_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_send_byte>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x1000,%edi
jmp    1030 <do_smbus_send_byte@plt>

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

LLVM IR (-O2):
define i32 @smbus_send_byte(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @do_smbus_send_byte(i32 4096, i32 %0, i8 zeroext %1)
ret i32 %3
}
char *find_ptr(char *s, char c) {
  char *p = s;
  while (*p != c) {
    p++;
  }
  return p;
}


x86 assembly (clang, -O0):
<find_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     113a <find_ptr+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <find_ptr+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_ptr>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
mov    %rax,%rcx
add    $0x1,%rax
cmp    %sil,0x1(%rcx)
jne    1110 <find_ptr+0x10>
ret

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

LLVM IR (-O2):
define i8* @find_ptr(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %1
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
ret i8* %4
}
void av_thread_message_queue_set_err_send() {}


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

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

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

LLVM IR (-O2):
define void @av_thread_message_queue_set_err_send() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nc_advise(char *, int const, char *, int);
int nc_close(int);
int ncclose(int ncid) {
  const int status = nc_close(ncid);
  if (status != 0) {
    nc_advise("ncclose", status, "ncid %d", ncid);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ncclose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <nc_close@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1165 <ncclose+0x45>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%ecx
lea    0xeb3(%rip),%rdi
lea    0xeb4(%rip),%rdx
call   1040 <nc_advise@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116c <ncclose+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncclose>:
push   %rbx
mov    %edi,%ebx
call   1030 <nc_close@plt>
test   %eax,%eax
je     114a <ncclose+0x2a>
lea    0xecd(%rip),%rdi
lea    0xece(%rip),%rdx
mov    %eax,%esi
mov    %ebx,%ecx
call   1040 <nc_advise@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"ncclose\00"
@.str.1 = [8 x i8] c"ncid %d\00"
define i32 @ncclose(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @nc_close(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = call i32 @nc_advise(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %11)
store i32 -1, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [8 x i8] c"ncclose\00"
@.str.1 = [8 x i8] c"ncid %d\00"
define i32 @ncclose(i32 %0) {
%2 = tail call i32 @nc_close(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @nc_advise(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_get_expect_reply(void *m) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_get_expect_reply>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_get_expect_reply>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_expect_reply(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_expect_reply(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
double pathconN_nm6_sq(double x) { return x * x; }


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

x86 assembly (clang, -O2):
<pathconN_nm6_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pathconN_nm6_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @pathconN_nm6_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ __pthread_mutex_lock(void *);
void __mutex_lock_solid(void *lock) { __pthread_mutex_lock(lock); }


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

x86 assembly (clang, -O2):
<__mutex_lock_solid>:
jmp    1030 <__pthread_mutex_lock@plt>

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

LLVM IR (-O2):
define void @__mutex_lock_solid(i8* %0) {
%2 = tail call i32 @__pthread_mutex_lock(i8* %0)
ret void
}
/* Variables and functions */
int get_lines();
int get_max_lines(void) { return get_lines() - 3; }


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

x86 assembly (clang, -O2):
<get_max_lines>:
push   %rax
xor    %eax,%eax
call   1030 <get_lines@plt>
add    $0xfffffffd,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_max_lines() {
%1 = call i32 (...) @get_lines()
%2 = sub nsw i32 %1, 3
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_max_lines() {
%1 = tail call i32 (...) @get_lines()
%2 = add nsw i32 %1, -3
ret i32 %2
}
char *longestPalindrome(char *s) {
  struct BTStack {
    int pos;
    int count;
  } bts;
}


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

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

LLVM IR (-O0):
%struct.BTStack = type { i32, i32 }
define i8* @longestPalindrome(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca %struct.BTStack
store i8* %0, i8** %3
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
%struct.BTStack = type { i32, i32 }
define noalias i8* @longestPalindrome(i8* nocapture readnone %0) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ LCD_write_byte(int, int /*<<< orphan*/);
void LCD_set_pos(unsigned int x, unsigned int y) {
  LCD_write_byte(0x40 | y, 0);
  LCD_write_byte(0x80 | x, 0);
}


x86 assembly (clang, -O0):
<LCD_set_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
or     $0x40,%edi
xor    %esi,%esi
call   1030 <LCD_write_byte@plt>
mov    -0x4(%rbp),%edi
or     $0x80,%edi
xor    %esi,%esi
call   1030 <LCD_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_set_pos>:
push   %rbx
mov    %edi,%ebx
or     $0x40,%esi
mov    %esi,%edi
xor    %esi,%esi
call   1030 <LCD_write_byte@plt>
or     $0x80,%ebx
mov    %ebx,%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <LCD_write_byte@plt>

LLVM IR (-O0):
define void @LCD_set_pos(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = or i32 64, %5
%7 = call i32 @LCD_write_byte(i32 %6, i32 0)
%8 = load i32, i32* %3
%9 = or i32 128, %8
%10 = call i32 @LCD_write_byte(i32 %9, i32 0)
ret void
}

LLVM IR (-O2):
define void @LCD_set_pos(i32 %0, i32 %1) {
%3 = or i32 %1, 64
%4 = tail call i32 @LCD_write_byte(i32 %3, i32 0)
%5 = or i32 %0, 128
%6 = tail call i32 @LCD_write_byte(i32 %5, i32 0)
ret void
}
/* Type definitions */
struct fh_operator {
  int dummy;
};

/* Variables and functions */
struct fh_operator *fh_get_binary_op(char const *);
struct fh_operator *fh_get_prefix_op(char const *);
struct fh_operator *fh_get_op(const char *name) {
  struct fh_operator *op;
  if ((op = fh_get_prefix_op(name)) != NULL)
    return op;
  if ((op = fh_get_binary_op(name)) != NULL)
    return op;
  return NULL;
}


x86 assembly (clang, -O0):
<fh_get_op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fh_get_prefix_op@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1150 <fh_get_op+0x30>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <fh_get_op+0x5c>
mov    -0x10(%rbp),%rdi
call   1040 <fh_get_binary_op@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1174 <fh_get_op+0x54>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <fh_get_op+0x5c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fh_get_op>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fh_get_prefix_op@plt>
test   %rax,%rax
je     1130 <fh_get_op+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fh_get_binary_op@plt>

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

LLVM IR (-O2):
%struct.fh_operator = type { i32 }
define %struct.fh_operator* @fh_get_op(i8* %0) {
%2 = tail call %struct.fh_operator* @fh_get_prefix_op(i8* %0)
%3 = icmp eq %struct.fh_operator* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call %struct.fh_operator* @fh_get_binary_op(i8* %0)
br label %6
6: ; preds = %4, %1
%7 = phi %struct.fh_operator* [ %2, %1 ], [ %5, %4 ]
ret %struct.fh_operator* %7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void cta_y420cmdb(const unsigned char *x, unsigned int length) {
  int i;
  for (i = 0; i < length; i++) {
    uint8_t v = x[0 + i];
    int j;
    for (j = 0; j < 8; j++)
      if (v & (1 << j))
        (void)("    VSD Index %d\n", i * 8 + j);
  }
}


x86 assembly (clang, -O0):
<cta_y420cmdb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1183 <cta_y420cmdb+0x83>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    1170 <cta_y420cmdb+0x70>
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     115d <cta_y420cmdb+0x5d>
jmp    1162 <cta_y420cmdb+0x62>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1139 <cta_y420cmdb+0x39>
jmp    1175 <cta_y420cmdb+0x75>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <cta_y420cmdb+0x12>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c" VSD Index %d\0A\00"
define void @cta_y420cmdb(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %39, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %42
12: ; preds = %8
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = add nsw i32 0, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
store i32 %19, i32* %6
store i32 0, i32* %7
br label %20
20: ; preds = %35, %12
%21 = load i32, i32* %7
%22 = icmp slt i32 %21, 8
br i1 %22, label %23, label %38
23: ; preds = %20
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = shl i32 1, %25
%27 = and i32 %24, %26
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %34
29: ; preds = %23
%30 = load i32, i32* %5
%31 = mul nsw i32 %30, 8
%32 = load i32, i32* %7
%33 = add nsw i32 %31, %32
br label %34
34: ; preds = %29, %23
br label %35
35: ; preds = %34
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
br label %20
38: ; preds = %20
br label %39
39: ; preds = %38
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %8
42: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @cta_y420cmdb(i8* nocapture %0, i32 %1) {
ret void
}
void av_asprintf() {}


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

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

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

LLVM IR (-O2):
define void @av_asprintf() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XtPointer;
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ Widget;
typedef int /*<<< orphan*/ Region;

/* Variables and functions */
int /*<<< orphan*/ XtCallCallbacks(int /*<<< orphan*/, char *,
                                   int /*<<< orphan*/);
void Redisplay(Widget w, XEvent *event, Region region) {
  XtCallCallbacks(w, "exposeCallback", (XtPointer)event);
}


x86 assembly (clang, -O0):
<Redisplay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xece(%rip),%rsi
call   1030 <XtCallCallbacks@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Redisplay>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <XtCallCallbacks@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"exposeCallback\00"
define void @Redisplay(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = ptrtoint i32* %8 to i32
%10 = call i32 @XtCallCallbacks(i32 %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"exposeCallback\00"
define void @Redisplay(i32 %0, i32* %1, i32 %2) {
%4 = ptrtoint i32* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @XtCallCallbacks(i32 %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int usleep(unsigned int usec) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "usleep");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
lea    0xeea(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"usleep\00"
define i32 @usleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @assert(i32 0)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"usleep\00"
define i32 @usleep(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @assert(i32 0)
ret i32 undef
}
void MUTEX_UNLOCK_SOFTAP_SET(struct brcmf_pub *drvr) {}


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

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

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

LLVM IR (-O2):
%struct.brcmf_pub = type opaque
define void @MUTEX_UNLOCK_SOFTAP_SET(%struct.brcmf_pub* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ string_2();
int main() {
  string_2();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <string_2@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @string_2()
ret i32 0
}
void txt_pressure(chan, pitch, press) {
  prtime();
  printf("Pressure, chan=%d pitch=%d press=%d\n", chan + 1, pitch, press);
}


x86 assembly (clang, -O0):
<txt_pressure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1040 <prtime@plt>
mov    -0x4(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_pressure>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <prtime@plt>
add    $0x1,%ebx
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Pressure, chan=%d pitch=%d press=%d\0A\00"
define void @txt_pressure(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 (...) @prtime()
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Pressure, chan=%d pitch=%d press=%d\0A\00"
define void @txt_pressure(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @prtime()
%5 = add nsw i32 %0, 1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void nl(int fd) { write(fd, "\n", 1); }


x86 assembly (clang, -O0):
<nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <write@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @nl(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
int test_imm_A4uint16_reg(unsigned short val) {
  return ((val) & (0xA4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A4uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xa4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_A4uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 164
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int strlen1(const char *s) {
  int i = 0;
  while (s[i] != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlen1+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen1+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen1>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen1+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen1(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int bcholu(double *, int);
int cholu(double *, int);
int chol(double *A, int N) {
  int sc;
  if (N <= (int)64) {
    sc = cholu(A, N);
  } else {
    sc = bcholu(A, N);
  }
  return sc;
}


x86 assembly (clang, -O0):
<chol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jg     114d <chol+0x2d>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <cholu@plt>
mov    %eax,-0x10(%rbp)
jmp    115c <chol+0x3c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <bcholu@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chol>:
cmp    $0x40,%esi
jg     112a <chol+0xa>
jmp    1030 <cholu@plt>
jmp    1040 <bcholu@plt>

LLVM IR (-O0):
define i32 @chol(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sle i32 %6, 64
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load double*, double** %3
%10 = load i32, i32* %4
%11 = call i32 @cholu(double* %9, i32 %10)
store i32 %11, i32* %5
br label %16
12: ; preds = %2
%13 = load double*, double** %3
%14 = load i32, i32* %4
%15 = call i32 @bcholu(double* %13, i32 %14)
store i32 %15, i32* %5
br label %16
16: ; preds = %12, %8
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @chol(double* %0, i32 %1) {
%3 = icmp slt i32 %1, 65
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @cholu(double* %0, i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i32 @bcholu(double* %0, i32 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
char *strrchr(char *, int);
char *r1bindex(char *str, int chr) {
  char *r;
  if (!chr)
    return str;
  r = strrchr(str, chr);
  if (r)
    return r + 1;
  return str;
}


x86 assembly (clang, -O0):
<r1bindex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1136 <r1bindex+0x26>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <r1bindex+0x5a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1162 <r1bindex+0x52>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    116a <r1bindex+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r1bindex>:
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
je     112b <r1bindex+0x1b>
mov    %rbx,%rdi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @r1bindex(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 %1)
%6 = icmp eq i8* %5, null
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = select i1 %6, i8* %0, i8* %7
br label %9
9: ; preds = %4, %2
%10 = phi i8* [ %0, %2 ], [ %8, %4 ]
ret i8* %10
}
int pathcon_nm2_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 2;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 0;
  return 0;
}


x86 assembly (clang, -O0):
<pathcon_nm2_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <pathcon_nm2_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <pathcon_nm2_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <pathcon_nm2_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <pathcon_nm2_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm2_work>:
test   %rdi,%rdi
je     110b <pathcon_nm2_work+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <pathcon_nm2_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <pathcon_nm2_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <pathcon_nm2_work+0x2c>
movl   $0x0,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @pathcon_nm2_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 0, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: loopback <phyical device> <virtual device>\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"Usage: loopback <phyical device> <virtual device>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"Usage: loopback <phyical device> <virtual device>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret void
}
void marker(int anarg) {
  asm("    .global "
      "set_point"
      "\n"
      "set_point"
      ":\n"
      "    call "
      "x86_trace_dummy"
      "\n");
}


x86 assembly (clang, -O0):
<marker>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)

x86 assembly (clang, -O2):
<marker>:
call   1030 <x86_trace_dummy@plt>
ret

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

LLVM IR (-O2):
define void @marker(i32 %0) {
tail call void asm sideeffect " .global set_point\0Aset_point:\0A call x86_trace_dummy\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t htob_u32(uint32_t hostval) {
  union {
    uint32_t l;
    uint8_t b[4];
  } u1, u2;
  u1.l = hostval;
  u2.b[0] = u1.b[3];
  u2.b[1] = u1.b[2];
  u2.b[2] = u1.b[1];
  u2.b[3] = u1.b[0];
  return u2.l;
}


x86 assembly (clang, -O0):
<htob_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { [4 x i32] }
define i32 @htob_u32(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
%4 = alloca %union.anon
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to [4 x i32]*
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 3
%9 = load i32, i32* %8
%10 = bitcast %union.anon* %4 to [4 x i32]*
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 0
store i32 %9, i32* %11
%12 = bitcast %union.anon* %3 to [4 x i32]*
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 2
%14 = load i32, i32* %13
%15 = bitcast %union.anon* %4 to [4 x i32]*
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %15, i64 0, i64 1
store i32 %14, i32* %16
%17 = bitcast %union.anon* %3 to [4 x i32]*
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %17, i64 0, i64 1
%19 = load i32, i32* %18
%20 = bitcast %union.anon* %4 to [4 x i32]*
%21 = getelementptr inbounds [4 x i32], [4 x i32]* %20, i64 0, i64 2
store i32 %19, i32* %21
%22 = bitcast %union.anon* %3 to [4 x i32]*
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %22, i64 0, i64 0
%24 = load i32, i32* %23
%25 = bitcast %union.anon* %4 to [4 x i32]*
%26 = getelementptr inbounds [4 x i32], [4 x i32]* %25, i64 0, i64 3
store i32 %24, i32* %26
%27 = bitcast %union.anon* %4 to i32*
%28 = load i32, i32* %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @htob_u32(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test_fail(int temp) { printf("Test failed (%d)\n", temp); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Test failed (%d)\0A\00"
define void @test_fail(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Test failed (%d)\0A\00"
define void @test_fail(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t xorbits2(uint32_t v, int n) {
  (void)n;
  v ^= v >> 1;
  v ^= v >> 2;
  v = (v & 0x11111111U) * 0x11111111U;
  return (v >> 28) & 1;
}


x86 assembly (clang, -O0):
<xorbits2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x11111111,%eax
imul   $0x11111111,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1c,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xorbits2>:
mov    %edi,%eax
sar    %eax
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
xor    %eax,%ecx
and    $0x11111111,%ecx
imul   $0x11111111,%ecx,%eax
shr    $0x1c,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @xorbits2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = ashr i32 %6, 1
%8 = load i32, i32* %3
%9 = xor i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = ashr i32 %10, 2
%12 = load i32, i32* %3
%13 = xor i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = and i32 %14, 286331153
%16 = mul i32 %15, 286331153
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = ashr i32 %17, 28
%19 = and i32 %18, 1
ret i32 %19
}

LLVM IR (-O2):
define i32 @xorbits2(i32 %0, i32 %1) {
%3 = ashr i32 %0, 1
%4 = xor i32 %3, %0
%5 = lshr i32 %4, 2
%6 = xor i32 %5, %4
%7 = and i32 %6, 286331153
%8 = mul i32 %7, 286331153
%9 = lshr i32 %8, 28
%10 = and i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void forward() {
  system("echo  1100000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle");
  system("echo  1900000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle");
  system("echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable");
  system("echo 1 > /sys/class/pwm/pwmchip0/pwm1/enable");
}


x86 assembly (clang, -O0):
<forward>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
lea    0xf11(%rip),%rdi
call   1030 <system@plt>
lea    0xf3d(%rip),%rdi
call   1030 <system@plt>
lea    0xf5e(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<forward>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
lea    0xf14(%rip),%rdi
call   1030 <system@plt>
lea    0xf40(%rip),%rdi
call   1030 <system@plt>
lea    0xf61(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"echo 1100000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle\00"
@.str.1 = [56 x i8] c"echo 1900000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle\00"
@.str.2 = [45 x i8] c"echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable\00"
@.str.3 = [45 x i8] c"echo 1 > /sys/class/pwm/pwmchip0/pwm1/enable\00"
define void @forward() {
%1 = call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [56 x i8] c"echo 1100000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle\00"
@.str.1 = [56 x i8] c"echo 1900000 > /sys/class/pwm/pwmchip0/pwm1/duty_cycle\00"
@.str.2 = [45 x i8] c"echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable\00"
@.str.3 = [45 x i8] c"echo 1 > /sys/class/pwm/pwmchip0/pwm1/enable\00"
define void @forward() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int foo(int a, char b) {
  print_int(a);
  return 123;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <print_int@plt>
mov    $0x7b,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
call   1030 <print_int@plt>
mov    $0x7b,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = call i32 @print_int(i32 %5)
ret i32 123
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i8 signext %1) {
%3 = tail call i32 @print_int(i32 %0)
ret i32 123
}
int foo(int i, int precision) {
  i = precision - i - 1;
  while (--i)
    ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     112d <foo+0x2d>
jmp    1116 <foo+0x16>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
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* %5
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %4
br label %10
10: ; preds = %14, %2
%11 = load i32, i32* %4
%12 = add nsw i32 %11, -1
store i32 %12, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
br label %10
15: ; preds = %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *pname) {
  printf("Usage: %s code_file [max_steps]\n", pname);
  exit(0);
}


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

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

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

LLVM IR (-O2):
@.str = [33 x i8] c"Usage: %s code_file [max_steps]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}