xunge/DecIR huggingface dataset:
signed clamps(signed min, signed x, signed max) {
  if (min > x)
    return min;
  if (max < x)
    return max;
  else
    return x;
}


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

x86 assembly (clang, -O2):
<clamps>:
mov    %edx,%eax
cmp    %esi,%edx
cmovge %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @clamps(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = icmp slt i32 %2, %1
%6 = select i1 %5, i32 %2, i32 %1
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
/* Variables and functions */
bool nrf53_errata_37(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf53_errata_37() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf53_errata_37() {
ret i32 0
}
/* Variables and functions */
void *memset(void *, int, size_t);
void *libc_memset(void *s, int c, size_t n) { return memset(s, c, n); }


x86 assembly (clang, -O0):
<libc_memset>:
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    %rdi,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libc_memset>:
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define i8* @libc_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %4, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
double M_PI;
int /*<<< orphan*/ printf(char *, double);
int main(int argc, const char *argv[]) {
  printf("El valor de PI es: %f\n", M_PI);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ebb(%rip),%rax
movsd  (%rax),%xmm0
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"El valor de PI es: %f\0A\00"
@M_PI = global double 0.000000e+00
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load double, double* @M_PI
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"El valor de PI es: %f\0A\00"
@M_PI = global double 0.000000e+00
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load double, double* @M_PI
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}
void copy(char to[], char from[]) {
  int index = 0;
  while ((to[index] = from[index]) != '\0') {
    ++index;
  }
}


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

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

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

LLVM IR (-O2):
define void @copy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}
int abs(int j) { return (j < 0) ? -j : j; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
struct t_item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ a_type(struct t_item *);
int get_armor_type_value(int /*<<< orphan*/, int);
int armor_get_value(struct t_item *armor, int bodypart) {
  return get_armor_type_value(a_type(armor), bodypart);
}


x86 assembly (clang, -O0):
<armor_get_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <a_type@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1030 <get_armor_type_value@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<armor_get_value>:
push   %rbx
mov    %esi,%ebx
call   1040 <a_type@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <get_armor_type_value@plt>

LLVM IR (-O0):
%struct.t_item = type { i32 }
define i32 @armor_get_value(%struct.t_item* %0, i32 %1) {
%3 = alloca %struct.t_item*
%4 = alloca i32
store %struct.t_item* %0, %struct.t_item** %3
store i32 %1, i32* %4
%5 = load %struct.t_item*, %struct.t_item** %3
%6 = call i32 @a_type(%struct.t_item* %5)
%7 = load i32, i32* %4
%8 = call i32 @get_armor_type_value(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.t_item = type { i32 }
define i32 @armor_get_value(%struct.t_item* %0, i32 %1) {
%3 = tail call i32 @a_type(%struct.t_item* %0)
%4 = tail call i32 @get_armor_type_value(i32 %3, i32 %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
clock_t clock() {
  __set_errno(ENOSYS);
  return (clock_t)-1;
}


x86 assembly (clang, -O0):
<clock>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @clock() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @clock() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
void *copy(void *x) { return x; }


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

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

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

LLVM IR (-O2):
define i8* @copy(i8* readnone returned %0) {
ret i8* %0
}
void rtw_netif_stop_queue(void *pnetdev) {}


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

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

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

LLVM IR (-O2):
define void @rtw_netif_stop_queue(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bar_read32(uint32_t bar, uint32_t offset) {
  volatile uint32_t *preg = (volatile uint32_t *)(bar | (offset & 0xFF));
  return (*preg);
}


x86 assembly (clang, -O0):
<bar_read32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_read32>:
movzbl %sil,%eax
or     %edi,%eax
cltq
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @bar_read32(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* %4
%8 = and i32 %7, 255
%9 = or i32 %6, %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %5
%12 = load i32*, i32** %5
%13 = load volatile i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @bar_read32(i32 %0, i32 %1) {
%3 = and i32 %1, 255
%4 = or i32 %3, %0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
ret i32 %7
}
int freecell_solver_user_get_max_num_stacks(void) { return 10; }


x86 assembly (clang, -O0):
<freecell_solver_user_get_max_num_stacks>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @freecell_solver_user_get_max_num_stacks() {
ret i32 10
}

LLVM IR (-O2):
define i32 @freecell_solver_user_get_max_num_stacks() {
ret i32 10
}
unsigned int snfd_calc_read_size(unsigned int read_buffer_size,
                                 unsigned int block_size, unsigned int offset) {
  block_size = block_size - offset;
  unsigned int read_size = read_buffer_size;
  if (read_size > block_size)
    read_size = block_size;
  return read_size;
}


x86 assembly (clang, -O0):
<snfd_calc_read_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    112e <snfd_calc_read_size+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<snfd_calc_read_size>:
mov    %esi,%eax
sub    %edx,%eax
cmp    %edi,%eax
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @snfd_calc_read_size(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 %1, %2
%5 = icmp ult i32 %4, %0
%6 = select i1 %5, i32 %4, i32 %0
ret i32 %6
}
int fb_hTimeLeap(int year) {
  if ((year % 400) == 0)
    return 1;
  if ((year % 100) == 0)
    return 0;
  return (((year & 3) == 0) ? 1 : 0);
}


x86 assembly (clang, -O0):
<fb_hTimeLeap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <fb_hTimeLeap+0x27>
movl   $0x1,-0x4(%rbp)
jmp    115d <fb_hTimeLeap+0x5d>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <fb_hTimeLeap+0x47>
movl   $0x0,-0x4(%rbp)
jmp    115d <fb_hTimeLeap+0x5d>
mov    -0x8(%rbp),%edx
and    $0x3,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_hTimeLeap>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112c <fb_hTimeLeap+0x2c>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1132 <fb_hTimeLeap+0x32>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @fb_hTimeLeap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 400
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
%10 = srem i32 %9, 100
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %19
13: ; preds = %8
%14 = load i32, i32* %3
%15 = and i32 %14, 3
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
store i32 %18, i32* %2
br label %19
19: ; preds = %13, %12, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @fb_hTimeLeap(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %1, %7
%12 = phi i32 [ %10, %7 ], [ 1, %1 ], [ 0, %4 ]
ret i32 %12
}
int test_imm_8Duint8_mem(unsigned char *val) {
  return ((*val) & (0x8D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Duint8_mem(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 = and i32 %5, 141
%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_8Duint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -115
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello, people!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, people!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hello, people!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void set1(unsigned long addr) { *((int *)addr) = 1; }


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

x86 assembly (clang, -O2):
<set1>:
movl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @set1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
store i32 1, i32* %4
ret void
}

LLVM IR (-O2):
define void @set1(i64 %0) {
%2 = inttoptr i64 %0 to i32*
store i32 1, i32* %2
ret void
}
int *f(int x) {
  int *y = &x;
  return y;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    -0x4(%rsp),%rax
ret

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

LLVM IR (-O2):
define noalias i32* @f(i32 %0) {
%2 = alloca i32
ret i32* %2
}
void snd_march(void) {}


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

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

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

LLVM IR (-O2):
define void @snd_march() {
ret void
}
int _mynoop1() { return (0); }


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

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

LLVM IR (-O0):
define i32 @_mynoop1() {
ret i32 0
}

LLVM IR (-O2):
define i32 @_mynoop1() {
ret i32 0
}
int length(char a[]) {
  int i = 0;
  while (a[i] != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<length>:
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 <length+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @length(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 @length(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
}
void cp_3d(double *a, double *b) {
  *(a++) = *(b++);
  *(a++) = *(b++);
  *(a) = *(b);
}


x86 assembly (clang, -O0):
<cp_3d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp_3d>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @cp_3d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i32 1
store double* %6, double** %4
%7 = load double, double* %5
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i32 1
store double* %9, double** %3
store double %7, double* %8
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i32 1
store double* %11, double** %4
%12 = load double, double* %10
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i32 1
store double* %14, double** %3
store double %12, double* %13
%15 = load double*, double** %4
%16 = load double, double* %15
%17 = load double*, double** %3
store double %16, double* %17
ret void
}

LLVM IR (-O2):
define void @cp_3d(double* nocapture writeonly %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %1, i64 1
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
store double %4, double* %0
%6 = getelementptr inbounds double, double* %1, i64 2
%7 = load double, double* %3
%8 = getelementptr inbounds double, double* %0, i64 2
store double %7, double* %5
%9 = load double, double* %6
store double %9, double* %8
ret void
}
int inside(x, y, rx, ry)
int x, y, rx, ry;
{ return (((x >= 0) && (x < rx) && (y >= 0) && (y < ry))); }


x86 assembly (clang, -O0):
<inside>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x11(%rbp)
jl     114b <inside+0x4b>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x11(%rbp)
jge    114b <inside+0x4b>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jl     114b <inside+0x4b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inside>:
xor    %eax,%eax
test   %edi,%edi
js     1115 <inside+0x15>
test   %esi,%esi
js     1115 <inside+0x15>
cmp    %edx,%edi
jge    1115 <inside+0x15>
xor    %eax,%eax
cmp    %ecx,%esi
setl   %al
ret

LLVM IR (-O0):
define i32 @inside(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 sge i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %4
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = load i32, i32* %6
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %6
%20 = load i32, i32* %8
%21 = icmp slt i32 %19, %20
br label %22
22: ; preds = %18, %15, %11, %4
%23 = phi i1 [ false, %15 ], [ false, %11 ], [ false, %4 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @inside(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %0, -1
br i1 %5, label %6, label %13
6: ; preds = %4
%7 = icmp slt i32 %0, %2
%8 = icmp sgt i32 %1, -1
%9 = and i1 %8, %7
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = icmp slt i32 %1, %3
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %10, %6, %4
%14 = phi i32 [ 0, %6 ], [ 0, %4 ], [ %12, %10 ]
ret i32 %14
}
/* Variables and functions */
char printf(char *, char *);
char help(char *exe) {
  return printf("brb-universe\nCopyright 2014 grepwood, licensed under GPL "
                "v3\n\nUsage: %s\t[help || sec len]\n\t-h, --help\tprint this "
                "message\n\tsec\t\tsecurity for which to "
                "generate\n\tlen\t\tlength of generated password\n",
                exe);
}


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

x86 assembly (clang, -O2):
<help>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [193 x i8] c"brb-universe\0ACopyright 2014 grepwood, licensed under GPL v3\0A\0AUsage: %s\09[help || sec len]\0A\09-h, --help\09print this message\0A\09sec\09\09security for which to generate\0A\09len\09\09length of generated password\0A\00"
define signext i8 @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call signext i8 @printf(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8 %4
}

LLVM IR (-O2):
@.str = [193 x i8] c"brb-universe\0ACopyright 2014 grepwood, licensed under GPL v3\0A\0AUsage: %s\09[help || sec len]\0A\09-h, --help\09print this message\0A\09sec\09\09security for which to generate\0A\09len\09\09length of generated password\0A\00"
define signext i8 @help(i8* %0) {
%2 = tail call signext i8 @printf(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8 %2
}
/* Variables and functions */
unsigned int time_microsec();
void usleep(unsigned int us) {
  unsigned int tact;
  unsigned int tstart = time_microsec();
  do {
    tact = time_microsec();
  } while (tact - tstart < us);
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <time_microsec@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <time_microsec@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jb     1125 <usleep+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <time_microsec@plt>
mov    %eax,%ebp
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <time_microsec@plt>
sub    %ebp,%eax
cmp    %ebx,%eax
jb     1120 <usleep+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @usleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = call i32 (...) @time_microsec()
store i32 %5, i32* %4
br label %6
6: ; preds = %8, %1
%7 = call i32 (...) @time_microsec()
store i32 %7, i32* %3
br label %8
8: ; preds = %6
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub i32 %9, %10
%12 = load i32, i32* %2
%13 = icmp ult i32 %11, %12
br i1 %13, label %6, label %14
14: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @usleep(i32 %0) {
%2 = tail call i32 (...) @time_microsec()
br label %3
3: ; preds = %3, %1
%4 = tail call i32 (...) @time_microsec()
%5 = sub i32 %4, %2
%6 = icmp ult i32 %5, %0
br i1 %6, label %3, label %7
7: ; preds = %3
ret void
}
void SSMR3Open(void) {}


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

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

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

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

/* Variables and functions */
int getshstr(int *, int *, char **, size_t *, int /*<<< orphan*/ *, int, int,
             int, int /*<<< orphan*/);
int getshdelim_numbered(int *firstline, int *lastline, char **lineptr,
                        size_t *n, int delimiter, int delimiter_quote,
                        int commentor, FILE *stream) {
  return getshstr(firstline, lastline, lineptr, n, stream, delimiter,
                  delimiter_quote, commentor, 0);
}


x86 assembly (clang, -O0):
<getshdelim_numbered>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    0x18(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    -0x28(%rbp),%r10d
mov    0x10(%rbp),%eax
xor    %r11d,%r11d
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <getshstr@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getshdelim_numbered>:
push   %rax
mov    %r9d,%eax
mov    %r8d,%r9d
mov    0x18(%rsp),%r8
mov    0x10(%rsp),%r10d
sub    $0x8,%rsp
push   $0x0
push   %r10
push   %rax
call   1030 <getshstr@plt>
add    $0x20,%rsp
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getshdelim_numbered(i32* %0, i32* %1, i8** %2, i64* %3, i32 %4, i32 %5, i32 %6, i32* %7) {
%9 = tail call i32 @getshstr(i32* %0, i32* %1, i8** %2, i64* %3, i32* %7, i32 %4, i32 %5, i32 %6, i32 0)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void fatalerror(char error_text[]) {
  fprintf(stderr, "Run-time error...\n");
  fprintf(stderr, "%s\n", error_text);
  fprintf(stderr, "...now exiting to system...\n");
  abort();
}


x86 assembly (clang, -O0):
<fatalerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<fatalerror>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r14),%edi
lea    0xeca(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r14),%edi
lea    0xeba(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
define void @fatalerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
define void @fatalerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 (...) @abort()
unreachable
}
void g_DUMMY_popup_set_selection(int cont_id, int item_id, int position) {
  cont_id = cont_id;
  item_id = item_id;
  position = position;
}


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

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

LLVM IR (-O0):
define void @g_DUMMY_popup_set_selection(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
store i32 %7, i32* %4
%8 = load i32, i32* %5
store i32 %8, i32* %5
%9 = load i32, i32* %6
store i32 %9, i32* %6
ret void
}

LLVM IR (-O2):
define void @g_DUMMY_popup_set_selection(i32 %0, i32 %1, i32 %2) {
ret void
}
long double atan2l(long double y, long double x) {
  long double res = 0.0L;
  asm("fpatan" : "=t"(res) : "u"(y), "0"(x) : "st(1)");
  return res;
}


x86 assembly (clang, -O0):
<atan2l>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldz
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fpatan
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<atan2l>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fpatan
ret

LLVM IR (-O0):
define x86_fp80 @atan2l(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
store x86_fp80 0xK00000000000000000000, x86_fp80* %5
%6 = load x86_fp80, x86_fp80* %3
%7 = load x86_fp80, x86_fp80* %4
%8 = call x86_fp80 asm "fpatan", "={st},{st(1)},0,~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %6, x86_fp80 %7)
store x86_fp80 %8, x86_fp80* %5
%9 = load x86_fp80, x86_fp80* %5
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @atan2l(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 asm "fpatan", "={st},{st(1)},0,~{st(1)},~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
void inthandler(int __attribute__((unused)) sig) {
  printf("%d: SIGINT\n", getpid());
}


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

x86 assembly (clang, -O2):
<inthandler>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d: SIGINT\0A\00"
define void @inthandler(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int convert_bin2int(int *bin_arr) {
  int val = 0;
  int i;
  for (i = 0; i <= 3; i++) {
    val = (val << 1) | bin_arr[i];
  }
  return val;
}


x86 assembly (clang, -O0):
<convert_bin2int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jg     1142 <convert_bin2int+0x42>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
or     (%rcx,%rdx,4),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <convert_bin2int+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_bin2int>:
mov    (%rdi),%ecx
mov    0x4(%rdi),%eax
shl    $0x2,%ecx
add    %eax,%eax
or     %ecx,%eax
or     0x8(%rdi),%eax
add    %eax,%eax
or     0xc(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @convert_bin2int(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %2, 2
%6 = shl i32 %4, 1
%7 = or i32 %5, %6
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = or i32 %9, %7
%11 = shl i32 %10, 1
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %13, %11
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ handle_arch_m64_finalize();
int /*<<< orphan*/ handle_arch_msize_long_finalize();
void handle_arch_finalize(void) {
  handle_arch_m64_finalize();
  handle_arch_msize_long_finalize();
}


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

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

LLVM IR (-O0):
define void @handle_arch_finalize() {
%1 = call i32 (...) @handle_arch_m64_finalize()
%2 = call i32 (...) @handle_arch_msize_long_finalize()
ret void
}

LLVM IR (-O2):
define void @handle_arch_finalize() {
%1 = tail call i32 (...) @handle_arch_m64_finalize()
%2 = tail call i32 (...) @handle_arch_msize_long_finalize()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double sin(double);
int main(void) {
  printf("Resultado: %g\n", sin(3.141592654 / 2.0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
call   1040 <sin@plt>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Resultado: %g\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @sin(double 0x3FF921FB54524550)
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Resultado: %g\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double 1.000000e+00)
ret i32 0
}
int main() {
  foo(bar());
  foo(1, bar());
  foo(bar(), 2);
  foo(1, bar(), 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,%esi
mov    $0x1,%edi
mov    $0x2,%edx
mov    $0x0,%al
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
call   1030 <bar@plt>
mov    $0x1,%edi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %eax,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
call   1030 <bar@plt>
mov    $0x1,%edi
mov    %eax,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @bar()
%2 = call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 %1)
%3 = call i32 (...) @bar()
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @foo to i32 (i32, i32, ...)*)(i32 1, i32 %3)
%5 = call i32 (...) @bar()
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @foo to i32 (i32, i32, ...)*)(i32 %5, i32 2)
%7 = call i32 (...) @bar()
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @foo to i32 (i32, i32, i32, ...)*)(i32 1, i32 %7, i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @foo to i32 (i32, ...)*)(i32 %1)
%3 = tail call i32 (...) @bar()
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @foo to i32 (i32, i32, ...)*)(i32 1, i32 %3)
%5 = tail call i32 (...) @bar()
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @foo to i32 (i32, i32, ...)*)(i32 %5, i32 2)
%7 = tail call i32 (...) @bar()
%8 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @foo to i32 (i32, i32, i32, ...)*)(i32 1, i32 %7, i32 2)
ret i32 0
}
/* Variables and functions */
int map_getrowvert(int);
int map_getrowmapvert(int vert) { return 2 * map_getrowvert(vert) + 3; }


x86 assembly (clang, -O0):
<map_getrowmapvert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <map_getrowvert@plt>
shl    $0x1,%eax
add    $0x3,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @map_getrowmapvert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @map_getrowvert(i32 %3)
%5 = mul nsw i32 2, %4
%6 = add nsw i32 %5, 3
ret i32 %6
}

LLVM IR (-O2):
define i32 @map_getrowmapvert(i32 %0) {
%2 = tail call i32 @map_getrowvert(i32 %0)
%3 = shl nsw i32 %2, 1
%4 = add nsw i32 %3, 3
ret i32 %4
}
void func2(int a, int b) {
  a++;
  b += 2;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func2(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 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 2
store i32 %8, i32* %4
ret void
}

LLVM IR (-O2):
define void @func2(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void checked_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<checked_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @checked_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void pacer_to_heart_diastolic_pulse() {}


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

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

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

LLVM IR (-O2):
define void @pacer_to_heart_diastolic_pulse() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CheckRunningInMainThread(char *);
int DoXOPAlert(int, char const *, char const *);
int XOPOKCancelAlert(const char *title, const char *message) {
  if (!CheckRunningInMainThread("XOPOKCancelAlert"))
    return -1;
  return DoXOPAlert(1511, title, message);
}


x86 assembly (clang, -O0):
<XOPOKCancelAlert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    1151 <XOPOKCancelAlert+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <XOPOKCancelAlert+0x46>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x5e7,%edi
call   1040 <DoXOPAlert@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XOPOKCancelAlert>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     1151 <XOPOKCancelAlert+0x31>
mov    $0x5e7,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <DoXOPAlert@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"XOPOKCancelAlert\00"
define i32 @XOPOKCancelAlert(i8* %0, i8* %1) {
%3 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @DoXOPAlert(i32 1511, i8* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}