xunge/DecIR huggingface dataset:
double normalizeAngle(double ang) {
  for (;;) {
    if (ang >= 360.0) {
      ang -= 360.0;
    } else if (ang < 0.0) {
      ang += 360.0;
    } else {
      break;
    }
  }
  return (ang);
}


x86 assembly (clang, -O0):
<normalizeAngle>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     113b <normalizeAngle+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  0xed3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116a <normalizeAngle+0x6a>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1160 <normalizeAngle+0x60>
movsd  0xeaf(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1165 <normalizeAngle+0x65>
jmp    116f <normalizeAngle+0x6f>
jmp    116a <normalizeAngle+0x6a>
jmp    1109 <normalizeAngle+0x9>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalizeAngle>:
movsd  0xef8(%rip),%xmm1
movsd  0xef8(%rip),%xmm2
xorpd  %xmm3,%xmm3
jmp    1124 <normalizeAngle+0x24>
cs nopw 0x0(%rax,%rax,1)
addsd  %xmm4,%xmm0
ucomisd %xmm2,%xmm0
movapd %xmm1,%xmm4
jae    1120 <normalizeAngle+0x20>
ucomisd %xmm0,%xmm3
movapd %xmm2,%xmm4
ja     1120 <normalizeAngle+0x20>
ret

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

LLVM IR (-O2):
define double @normalizeAngle(double %0) {
br label %2
2: ; preds = %7, %1
%3 = phi double [ %0, %1 ], [ %9, %7 ]
%4 = fcmp ult double %3, 3.600000e+02
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = fcmp olt double %3, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %5, %2
%8 = phi double [ -3.600000e+02, %2 ], [ 3.600000e+02, %5 ]
%9 = fadd double %3, %8
br label %2
10: ; preds = %5
ret double %3
}
int roi_set_leds(char *buff, unsigned char leds, unsigned char power_color,
                 unsigned char power_intensity) {
  buff[0] = (139);
  buff[1] = leds;
  buff[2] = power_color;
  buff[3] = power_intensity;
  return 4;
}


x86 assembly (clang, -O0):
<roi_set_leds>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x8b,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roi_set_leds>:
movb   $0x8b,(%rdi)
mov    %sil,0x1(%rdi)
mov    %dl,0x2(%rdi)
mov    %cl,0x3(%rdi)
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @roi_set_leds(i8* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 -117, i8* %10
%11 = load i8, i8* %6
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %13
%14 = load i8, i8* %7
%15 = load i8*, i8** %5
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 %14, i8* %16
%17 = load i8, i8* %8
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 3
store i8 %17, i8* %19
ret i32 4
}

LLVM IR (-O2):
define i32 @roi_set_leds(i8* nocapture writeonly %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
store i8 -117, i8* %0
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %1, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %2, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %3, i8* %7
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *);
int keyborad_handler() {
  kprintf("1 enter the keyboard interrupt\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"1 enter the keyboard interrupt\0A\00"
define i32 @keyborad_handler() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"1 enter the keyboard interrupt\0A\00"
define i32 @keyborad_handler() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int sendingbyte(void) {
  return ((*(short int *)((0xfffffc00L) + 0x0c)) & 0x80) == 0;
}


x86 assembly (clang, -O0):
<sendingbyte>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffc0c,%eax
movswl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendingbyte>:
mov    $0xfffffc0c,%ecx
xor    %eax,%eax
testb  $0x80,(%rcx)
sete   %al
ret

LLVM IR (-O0):
define i32 @sendingbyte() {
%1 = load i16, i16* inttoptr (i64 4294966284 to i16*)
%2 = sext i16 %1 to i32
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @sendingbyte() {
%1 = load i16, i16* inttoptr (i64 4294966284 to i16*)
%2 = lshr i16 %1, 7
%3 = and i16 %2, 1
%4 = xor i16 %3, 1
%5 = zext i16 %4 to i32
ret i32 %5
}
char *strchr(const char *p, int ch) {
  char c;
  c = ch;
  for (;; ++p) {
    if (*p == c)
      return ((char *)p);
    if (*p == '\0')
      return 0;
  }
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    1131 <strchr+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1164 <strchr+0x64>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114e <strchr+0x4e>
movq   $0x0,-0x8(%rbp)
jmp    1164 <strchr+0x64>
jmp    1153 <strchr+0x53>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1111 <strchr+0x11>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @strchr(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 = trunc i32 %7 to i8
store i8 %8, i8* %6
br label %9
9: ; preds = %25, %2
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %12, %14
br i1 %15, label %16, label %18
16: ; preds = %9
%17 = load i8*, i8** %4
store i8* %17, i8** %3
br label %28
18: ; preds = %9
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %18
store i8* null, i8** %3
br label %28
24: ; preds = %18
br label %25
25: ; preds = %24
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %4
br label %9
28: ; preds = %23, %16
%29 = load i8*, i8** %3
ret i8* %29
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %12, %8, %2
%18 = phi i8* [ %0, %2 ], [ null, %8 ], [ %13, %12 ]
ret i8* %18
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int rt_modbus_min_bytes(uint8_t *buf) {
  switch (buf[1]) {
  case (0x01):
  case (0x02):
  case (0x03):
  case (0x04):
  case (0x05):
  case (0x06):
  case (0x08):
  case (67):
    return 8;
  case (0x07):
  case (0x11):
    return 4;
  case (0x0F):
  case (0x10):
    return 7;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<rt_modbus_min_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x42,%eax
ja     1159 <rt_modbus_min_bytes+0x59>
mov    -0x18(%rbp),%rax
lea    0xed4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x8,-0x4(%rbp)
jmp    1160 <rt_modbus_min_bytes+0x60>
movl   $0x4,-0x4(%rbp)
jmp    1160 <rt_modbus_min_bytes+0x60>
movl   $0x7,-0x4(%rbp)
jmp    1160 <rt_modbus_min_bytes+0x60>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_modbus_min_bytes>:
mov    0x4(%rdi),%ecx
add    $0xffffffff,%ecx
cmp    $0x42,%ecx
ja     112d <rt_modbus_min_bytes+0x2d>
mov    $0x8,%eax
lea    0xee9(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
ret
mov    $0x4,%eax
ret
mov    $0x7,%eax
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @rt_modbus_min_bytes(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32, i32* %5
switch i32 %6, label %10 [
i32 1, label %7
i32 2, label %7
i32 3, label %7
i32 4, label %7
i32 5, label %7
i32 6, label %7
i32 8, label %7
i32 67, label %7
i32 7, label %8
i32 17, label %8
i32 15, label %9
i32 16, label %9
]
7: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 8, i32* %2
br label %11
8: ; preds = %1, %1
store i32 4, i32* %2
br label %11
9: ; preds = %1, %1
store i32 7, i32* %2
br label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %11
11: ; preds = %10, %9, %8, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @rt_modbus_min_bytes(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 1, label %7
i32 2, label %7
i32 3, label %7
i32 4, label %7
i32 5, label %7
i32 6, label %7
i32 8, label %7
i32 67, label %7
i32 7, label %4
i32 17, label %4
i32 15, label %5
i32 16, label %5
]
4: ; preds = %1, %1
br label %7
5: ; preds = %1, %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %6, %5, %4
%8 = phi i32 [ -1, %6 ], [ 7, %5 ], [ 4, %4 ], [ 8, %1 ], [ 8, %1 ], [ 8, %1 ], [ 8, %1 ], [ 8, %1 ], [ 8, %1 ], [ 8, %1 ], [ 8, %1 ]
ret i32 %8
}
void osd_parallelize(void (*task)(void *param, int task_num, int task_count),
                     void *param, int max_tasks) {
  task(param, 0, 1);
}


x86 assembly (clang, -O0):
<osd_parallelize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osd_parallelize>:
mov    %rdi,%rax
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x1,%edx
jmp    *%rax

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

LLVM IR (-O2):
define void @osd_parallelize(void (i8*, i32, i32)* nocapture %0, i8* %1, i32 %2) {
tail call void %0(i8* %1, i32 0, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void close_pid_stat(FILE *fp) { fclose(fp); }


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

x86 assembly (clang, -O2):
<close_pid_stat>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @close_pid_stat(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ returnValueFromMethod(int);
void interpretReturnFalseFromMethod(int context) {
  returnValueFromMethod((20 << 2));
}


x86 assembly (clang, -O0):
<interpretReturnFalseFromMethod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x50,%edi
call   1030 <returnValueFromMethod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpretReturnFalseFromMethod>:
mov    $0x50,%edi
jmp    1030 <returnValueFromMethod@plt>

LLVM IR (-O0):
define void @interpretReturnFalseFromMethod(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @returnValueFromMethod(i32 80)
ret void
}

LLVM IR (-O2):
define void @interpretReturnFalseFromMethod(i32 %0) {
%2 = tail call i32 @returnValueFromMethod(i32 80)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ port_lock();
void chSysLock(void) {
  port_lock();
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @chSysLock() {
%1 = tail call i32 (...) @port_lock()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EMLINK;
int /*<<< orphan*/ errno;
int link(const char *old, const char *new) {
  errno = EMLINK;
  return -1;
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<link>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EMLINK = global i32 0
@errno = global i32 0
define i32 @link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EMLINK
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EMLINK = global i32 0
@errno = global i32 0
define i32 @link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EMLINK
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int f152(int *);
int f153(int *p) { return f152(p); }


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

x86 assembly (clang, -O2):
<f153>:
jmp    1030 <f152@plt>

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

LLVM IR (-O2):
define i32 @f153(i32* %0) {
%2 = tail call i32 @f152(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ myfoo(int *);
void paramFree(int *p) {
  myfoo(p);
  free(p);
  myfoo(p);
}


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

x86 assembly (clang, -O2):
<paramFree>:
push   %rbx
mov    %rdi,%rbx
call   1040 <myfoo@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <myfoo@plt>

LLVM IR (-O0):
define void @paramFree(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @myfoo(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @free(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @myfoo(i32* %7)
ret void
}

LLVM IR (-O2):
define void @paramFree(i32* %0) {
%2 = tail call i32 @myfoo(i32* %0)
%3 = tail call i32 @free(i32* %0)
%4 = tail call i32 @myfoo(i32* %0)
ret void
}
/* Type definitions */
struct sigaction {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int NSIG;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __sigaction(int sig, const struct sigaction *act, struct sigaction *oact) {
  if (sig <= 0 || sig >= NSIG) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__sigaction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    113f <__sigaction+0x2f>
mov    -0x8(%rbp),%eax
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%eax
jl     1159 <__sigaction+0x49>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <__sigaction+0x5e>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sigaction>:
push   %rax
mov    0x2eb8(%rip),%rdx
mov    0x2eb9(%rip),%rax
mov    %rax,%rcx
cmp    %edi,(%rdx)
jle    112d <__sigaction+0x1d>
mov    0x2ebb(%rip),%rcx
test   %edi,%edi
cmovg  %rcx,%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32 }
@NSIG = global i32 0
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.sigaction*
%7 = alloca %struct.sigaction*
store i32 %0, i32* %5
store %struct.sigaction* %1, %struct.sigaction** %6
store %struct.sigaction* %2, %struct.sigaction** %7
%8 = load i32, i32* %5
%9 = icmp sle i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load i32, i32* %5
%12 = load i32, i32* @NSIG
%13 = icmp sge i32 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %10, %3
%15 = load i32, i32* @EINVAL
%16 = call i32 @__set_errno(i32 %15)
store i32 -1, i32* %4
br label %20
17: ; preds = %10
%18 = load i32, i32* @ENOSYS
%19 = call i32 @__set_errno(i32 %18)
store i32 -1, i32* %4
br label %20
20: ; preds = %17, %14
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
@NSIG = global i32 0
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__sigaction(i32 %0, %struct.sigaction* nocapture readnone %1, %struct.sigaction* nocapture readnone %2) {
%4 = icmp sgt i32 %0, 0
%5 = load i32, i32* @NSIG
%6 = icmp sgt i32 %5, %0
%7 = select i1 %4, i1 %6, i1 false
%8 = load i32, i32* @ENOSYS
%9 = load i32, i32* @EINVAL
%10 = select i1 %7, i32 %8, i32 %9
%11 = tail call i32 @__set_errno(i32 %10)
ret i32 -1
}
unsigned xrop3_48_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~S;
  stk1 = T & stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_48_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_48_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
not    %eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_48_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %6
%23 = xor i32 %22, -1
store i32 %23, i32* %9
%24 = load i32, i32* %7
%25 = load i32, i32* %9
%26 = and i32 %24, %25
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = and i32 %27, %28
%30 = load i32, i32* %8
%31 = load i32, i32* %7
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = or i32 %29, %33
%35 = load i32, i32* %7
%36 = load i32, i32* %6
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = and i32 %38, %39
%41 = or i32 %34, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_48_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = xor i32 %4, -1
%7 = and i32 %6, %5
ret i32 %7
}
void protocolBISTRxErrorCount(void) {}


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

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

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

LLVM IR (-O2):
define void @protocolBISTRxErrorCount() {
ret void
}
int mask_cmp(unsigned int *map, unsigned int mask) { return !(*map & mask); }


x86 assembly (clang, -O0):
<mask_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_cmp>:
xor    %eax,%eax
test   %esi,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @mask_cmp(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = and i32 %6, %7
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @mask_cmp(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, %1
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
float rf_clamp_float(float min, float max, float in) {
  if (in > max)
    return max;
  if (in < min)
    return min;
  return in;
}


x86 assembly (clang, -O0):
<rf_clamp_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1131 <rf_clamp_float+0x31>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <rf_clamp_float+0x5d>
movss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1153 <rf_clamp_float+0x53>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <rf_clamp_float+0x5d>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rf_clamp_float>:
maxss  %xmm2,%xmm0
movaps %xmm1,%xmm3
cmpltss %xmm2,%xmm3
movaps %xmm3,%xmm2
andnps %xmm0,%xmm2
andps  %xmm1,%xmm3
orps   %xmm2,%xmm3
movaps %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define float @rf_clamp_float(float %0, float %1, float %2) {
%4 = fcmp ogt float %2, %1
%5 = fcmp olt float %2, %0
%6 = select i1 %5, float %0, float %2
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ itoa(int, char *, int);
void uninitvar_itoa(void) {
  int value;
  char *str;
  int base;
  (void)itoa(value, str, base);
}


x86 assembly (clang, -O0):
<uninitvar_itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <itoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_itoa>:
jmp    1030 <itoa@plt>

LLVM IR (-O0):
define void @uninitvar_itoa() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = load i32, i32* %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = call i32 @itoa(i32 %4, i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_itoa() {
%1 = tail call i32 @itoa(i32 undef, i8* undef, i32 undef)
ret void
}
int fun402() { return 402; }


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

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

LLVM IR (-O0):
define i32 @fun402() {
ret i32 402
}

LLVM IR (-O2):
define i32 @fun402() {
ret i32 402
}
int is_power_of_two(int i) { return !(i & (i - 1)); }


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

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

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

LLVM IR (-O2):
define i32 @is_power_of_two(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
void av_thread_message_queue_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_thread_message_queue_alloc() {
ret void
}
/* Variables and functions */
int ap_cmd_get_int(int, int, int *);
int ap_get_block(int session, int *val) {
  return (ap_cmd_get_int(session, 0xcc1b, val));
}


x86 assembly (clang, -O0):
<ap_get_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0xcc1b,%esi
call   1030 <ap_cmd_get_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_get_block>:
mov    %rsi,%rdx
mov    $0xcc1b,%esi
jmp    1030 <ap_cmd_get_int@plt>

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

LLVM IR (-O2):
define i32 @ap_get_block(i32 %0, i32* %1) {
%3 = tail call i32 @ap_cmd_get_int(i32 %0, i32 52251, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ log_allocation(char *, size_t, void *);
void *real_realloc(void *, size_t);
void *realloc(void *ptr, size_t size) {
  void *old_ptr = ptr;
  void *nptr = real_realloc(ptr, size);
  log_allocation("realloc", size, nptr);
  if (nptr) {
    log_allocation("free", 0, old_ptr);
  }
  return nptr;
}


x86 assembly (clang, -O0):
<realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <real_realloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xea8(%rip),%rdi
call   1040 <log_allocation@plt>
cmpq   $0x0,-0x20(%rbp)
je     117c <realloc+0x5c>
mov    -0x18(%rbp),%rdx
lea    0xe95(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <log_allocation@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
call   1030 <real_realloc@plt>
mov    %rax,%rbx
lea    0xec6(%rip),%rdi
mov    %r15,%rsi
mov    %rax,%rdx
call   1040 <log_allocation@plt>
test   %rbx,%rbx
je     115b <realloc+0x3b>
lea    0xeb7(%rip),%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <log_allocation@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"realloc\00"
@.str.1 = [5 x i8] c"free\00"
define i8* @realloc(i8* %0, i64 %1) {
%3 = tail call i8* @real_realloc(i8* %0, i64 %1)
%4 = tail call i32 @log_allocation(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %1, i8* %3)
%5 = icmp eq i8* %3, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @log_allocation(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 0, i8* %0)
br label %8
8: ; preds = %6, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ sceKernelExitGame();
__attribute__((destructor)) void back_to_kernel(void) { sceKernelExitGame(); }


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @back_to_kernel, i8* null }]
define void @back_to_kernel() {
%1 = call i32 (...) @sceKernelExitGame()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @back_to_kernel, i8* null }]
define void @back_to_kernel() {
%1 = tail call i32 (...) @sceKernelExitGame()
ret void
}
int SecKeychainItemFreeContent() { return -4; }


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

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

LLVM IR (-O0):
define i32 @SecKeychainItemFreeContent() {
ret i32 -4
}

LLVM IR (-O2):
define i32 @SecKeychainItemFreeContent() {
ret i32 -4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: uniq [-udc] [+n] [-n] [input [output]]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"Usage: uniq [-udc] [+n] [-n] [input [output]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"Usage: uniq [-udc] [+n] [-n] [input [output]]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
const int stringLen(char *arg) {
  int len = 0;
  while (arg[len++] != 0)
    ;
  return len;
}


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

x86 assembly (clang, -O2):
<stringLen>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <stringLen+0x10>
ret

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

LLVM IR (-O2):
define i32 @stringLen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %4 to i32
ret i32 %9
}
void irqEmptyDef() {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<irqEmptyDef>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <irqEmptyDef+0x9>
jmp    1109 <irqEmptyDef+0x9>

x86 assembly (clang, -O2):
<irqEmptyDef>:
jmp    1100 <irqEmptyDef>

LLVM IR (-O0):
define void @irqEmptyDef() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @irqEmptyDef() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
scalar_t__ malloc(int);
int main(void) {
  char *str = (char *)malloc(4);
  str[0] = 'b';
  str[0] = 'a';
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x62,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x61,(%rax)
jmp    113b <main+0x2b>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movb   $0x61,(%rax)
xchg   %ax,%ax
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 98, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 97, i8* %8
br label %9
9: ; preds = %0, %9
br label %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i8*
store i8 97, i8* %2
br label %3
3: ; preds = %3, %0
br label %3
}
void gtk_container_get_focus_chain() {}


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

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

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

LLVM IR (-O2):
define void @gtk_container_get_focus_chain() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t extract_grey(uint8_t *grey, int i) {
  uint8_t val;
  if (i % 2 == 1) {
    val = (grey[i / 2] & 0x0F) << 4;
  } else {
    val = (grey[i / 2] & 0xF0);
  }
  return val | (val >> 4);
}


x86 assembly (clang, -O0):
<extract_grey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    114c <extract_grey+0x4c>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
and    $0xf,%eax
shl    $0x4,%eax
mov    %eax,-0x10(%rbp)
jmp    1173 <extract_grey+0x73>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
and    $0xf0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    $0x4,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_grey>:
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
mov    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%esi
sar    %eax
cltq
mov    (%rdi,%rax,4),%eax
mov    %eax,%ecx
shl    $0x4,%ecx
cmp    $0x1,%esi
cmovne %eax,%ecx
and    $0xf0,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @extract_grey(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* %4
%7 = srem i32 %6, 2
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = sdiv i32 %11, 2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %10, i64 %13
%15 = load i32, i32* %14
%16 = and i32 %15, 15
%17 = shl i32 %16, 4
store i32 %17, i32* %5
br label %26
18: ; preds = %2
%19 = load i32*, i32** %3
%20 = load i32, i32* %4
%21 = sdiv i32 %20, 2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %19, i64 %22
%24 = load i32, i32* %23
%25 = and i32 %24, 240
store i32 %25, i32* %5
br label %26
26: ; preds = %18, %9
%27 = load i32, i32* %5
%28 = load i32, i32* %5
%29 = ashr i32 %28, 4
%30 = or i32 %27, %29
ret i32 %30
}

LLVM IR (-O2):
define i32 @extract_grey(i32* nocapture %0, i32 %1) {
%3 = srem i32 %1, 2
%4 = icmp eq i32 %3, 1
%5 = sdiv i32 %1, 2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = shl i32 %8, 4
%10 = select i1 %4, i32 %9, i32 %8
%11 = and i32 %10, 240
%12 = lshr exact i32 %11, 4
%13 = or i32 %12, %11
ret i32 %13
}
int test_imm_89uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x89 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_89uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 137
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int rand();
char get_rand_letter(void) { return rand() % 26 + 'a'; }


x86 assembly (clang, -O0):
<get_rand_letter>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x1a,%ecx
cltd
idiv   %ecx
add    $0x61,%edx
mov    %dl,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand_letter>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
add    $0x61,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @get_rand_letter() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 26
%3 = add nsw i32 %2, 97
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @get_rand_letter() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 26
%3 = trunc i32 %2 to i8
%4 = add nsw i8 %3, 97
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ instance1(int /*<<< orphan*/);
int /*<<< orphan*/ instance2(int /*<<< orphan*/);
int /*<<< orphan*/ instance3(int /*<<< orphan*/);
int /*<<< orphan*/ instance4(int /*<<< orphan*/);
int /*<<< orphan*/ instance5(int /*<<< orphan*/);
int main() {
__CPROVER_ASYNC_0:
  instance1(0);
__CPROVER_ASYNC_1:
  instance2(0);
__CPROVER_ASYNC_2:
  instance3(0);
__CPROVER_ASYNC_3:
  instance4(0);
__CPROVER_ASYNC_4:
  instance5(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1070 <instance1@plt>
xor    %edi,%edi
call   1040 <instance2@plt>
xor    %edi,%edi
call   1050 <instance3@plt>
xor    %edi,%edi
call   1030 <instance4@plt>
xor    %edi,%edi
call   1060 <instance5@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1070 <instance1@plt>
xor    %edi,%edi
call   1040 <instance2@plt>
xor    %edi,%edi
call   1050 <instance3@plt>
xor    %edi,%edi
call   1030 <instance4@plt>
xor    %edi,%edi
call   1060 <instance5@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
%3 = call i32 @instance1(i32 0)
br label %4
4: ; preds = %2
%5 = call i32 @instance2(i32 0)
br label %6
6: ; preds = %4
%7 = call i32 @instance3(i32 0)
br label %8
8: ; preds = %6
%9 = call i32 @instance4(i32 0)
br label %10
10: ; preds = %8
%11 = call i32 @instance5(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @instance1(i32 0)
%2 = tail call i32 @instance2(i32 0)
%3 = tail call i32 @instance3(i32 0)
%4 = tail call i32 @instance4(i32 0)
%5 = tail call i32 @instance5(i32 0)
ret i32 0
}
int chunkCoord(int absolute) {
  int relative;
  relative = (absolute < 0) ? ((absolute / 3) - 1) : (absolute / 3);
  return relative;
}


x86 assembly (clang, -O0):
<chunkCoord>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1127 <chunkCoord+0x27>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <chunkCoord+0x35>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chunkCoord>:
test   %edi,%edi
js     1114 <chunkCoord+0x14>
mov    %edi,%ecx
mov    $0xaaaaaaab,%eax
imul   %rcx,%rax
shr    $0x21,%rax
ret
neg    %edi
mov    $0xaaaaaaab,%eax
imul   %rdi,%rax
shr    $0x21,%rax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @chunkCoord(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sub i32 0, %0
%5 = udiv i32 %4, 3
%6 = xor i32 %5, -1
br label %9
7: ; preds = %1
%8 = udiv i32 %0, 3
br label %9
9: ; preds = %7, %3
%10 = phi i32 [ %6, %3 ], [ %8, %7 ]
ret i32 %10
}
void exit_mps() {}


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

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

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

LLVM IR (-O2):
define void @exit_mps() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
void llshift(long long a, int b) {
  printf("%llx\n", a << b);
  printf("%llx\n", a >> b);
  printf("%llx\n", (unsigned long long)a >> b);
}


x86 assembly (clang, -O0):
<llshift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
shl    %cl,%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
sar    %cl,%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
shr    %cl,%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llshift>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdi,%rsi
mov    %ebp,%ecx
shl    %cl,%rsi
lea    0xed8(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rsi
mov    %ebp,%ecx
sar    %cl,%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %ebp,%ecx
shr    %cl,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%llx\0A\00"
define void @llshift(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = shl i64 %5, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %8)
%10 = load i64, i64* %3
%11 = load i32, i32* %4
%12 = zext i32 %11 to i64
%13 = ashr i64 %10, %12
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = load i64, i64* %3
%16 = load i32, i32* %4
%17 = zext i32 %16 to i64
%18 = lshr i64 %15, %17
%19 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %18)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%llx\0A\00"
define void @llshift(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = shl i64 %0, %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = ashr i64 %0, %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %6)
%8 = lshr i64 %0, %3
%9 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %8)
ret void
}