xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
scalar_t__ INT16_MAX;
scalar_t__ INT16_MIN;
int16_t __hsail_sat_sub_s16(int16_t a, int16_t b) {
  int32_t c = (int32_t)a - (int32_t)b;
  if (c > INT16_MAX)
    return INT16_MAX;
  else if (c < INT16_MIN)
    return INT16_MIN;
  else
    return c;
}


x86 assembly (clang, -O0):
<__hsail_sat_sub_s16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2ebd(%rip),%rcx
cmp    (%rcx),%rax
jle    113f <__hsail_sat_sub_s16+0x3f>
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <__hsail_sat_sub_s16+0x6e>
mov    -0x20(%rbp),%rax
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%rax
jge    1166 <__hsail_sat_sub_s16+0x66>
mov    0x2e7e(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <__hsail_sat_sub_s16+0x6e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hsail_sat_sub_s16>:
sub    %rsi,%rdi
mov    0x2ed6(%rip),%rcx
mov    0x2ec7(%rip),%rax
mov    (%rax),%rax
cmp    %rax,%rdi
cmovge %rdi,%rax
mov    (%rcx),%rcx
cmp    %rcx,%rdi
cmovg  %rcx,%rax
ret

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

LLVM IR (-O2):
@INT16_MAX = global i64 0
@INT16_MIN = global i64 0
define i64 @__hsail_sat_sub_s16(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = load i64, i64* @INT16_MAX
%5 = icmp sgt i64 %3, %4
%6 = load i64, i64* @INT16_MIN
%7 = icmp slt i64 %3, %6
%8 = select i1 %7, i64 %6, i64 %3
%9 = select i1 %5, i64 %4, i64 %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main() {
  putchar('X');
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x58,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 88)
ret i32 0
}
/* Variables and functions */
int EAGAIN;
int ENOBUFS;
int ENOMEM;
int EWOULDBLOCK;
bool io_should_wait(int error) {
  if (error == EAGAIN || error == EWOULDBLOCK || error == ENOMEM ||
      error == ENOBUFS) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<io_should_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2eaf(%rip),%rcx
cmp    (%rcx),%eax
je     114f <io_should_wait+0x4f>
mov    -0x8(%rbp),%eax
mov    0x2ead(%rip),%rcx
cmp    (%rcx),%eax
je     114f <io_should_wait+0x4f>
mov    -0x8(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
je     114f <io_should_wait+0x4f>
mov    -0x8(%rbp),%eax
mov    0x2eb1(%rip),%rcx
cmp    (%rcx),%eax
jne    115b <io_should_wait+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <io_should_wait+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_should_wait>:
mov    0x2eb9(%rip),%rax
cmp    %edi,(%rax)
sete   %al
mov    0x2ebd(%rip),%rcx
cmp    %edi,(%rcx)
sete   %cl
or     %al,%cl
mov    0x2eb7(%rip),%rax
cmp    %edi,(%rax)
sete   %al
mov    0x2ecb(%rip),%rdx
cmp    %edi,(%rdx)
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
@EAGAIN = global i32 0
@EWOULDBLOCK = global i32 0
@ENOMEM = global i32 0
@ENOBUFS = global i32 0
define i32 @io_should_wait(i32 %0) {
%2 = load i32, i32* @EAGAIN
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @EWOULDBLOCK
%5 = icmp eq i32 %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = load i32, i32* @ENOMEM
%8 = icmp eq i32 %7, %0
%9 = select i1 %6, i1 true, i1 %8
%10 = load i32, i32* @ENOBUFS
%11 = icmp eq i32 %10, %0
%12 = select i1 %9, i1 true, i1 %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ buffer_cleanup(int /*<<< orphan*/);
void _ensure_buffer_cleanup_copes_with_null_buffer(void) { buffer_cleanup(0); }


x86 assembly (clang, -O0):
<_ensure_buffer_cleanup_copes_with_null_buffer>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <buffer_cleanup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ensure_buffer_cleanup_copes_with_null_buffer>:
xor    %edi,%edi
jmp    1030 <buffer_cleanup@plt>

LLVM IR (-O0):
define void @_ensure_buffer_cleanup_copes_with_null_buffer() {
%1 = call i32 @buffer_cleanup(i32 0)
ret void
}

LLVM IR (-O2):
define void @_ensure_buffer_cleanup_copes_with_null_buffer() {
%1 = tail call i32 @buffer_cleanup(i32 0)
ret void
}
int kobject_add(struct kobject *x) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.kobject = type opaque
define i32 @kobject_add(%struct.kobject* %0) {
%2 = alloca %struct.kobject*
%3 = alloca i32
store %struct.kobject* %0, %struct.kobject** %2
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.kobject = type opaque
define i32 @kobject_add(%struct.kobject* nocapture readnone %0) {
ret i32 undef
}
void ay_image_window_close(int tag) {}


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

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

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

LLVM IR (-O2):
define void @ay_image_window_close(i32 %0) {
ret void
}
int is_ascii_uppercase_text(char in_c) {
  if ((in_c >= 0x41 && in_c <= 0x5A)) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_ascii_uppercase_text>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1130 <is_ascii_uppercase_text+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1130 <is_ascii_uppercase_text+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1137 <is_ascii_uppercase_text+0x37>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ascii_uppercase_text>:
add    $0xa5,%dil
xor    %eax,%eax
cmp    $0xe6,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_ascii_uppercase_text(i8 signext %0) {
%2 = add i8 %0, -91
%3 = icmp ult i8 %2, -26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", 3 > 5 ? 3 : 5);
  getchar();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 (...) @getchar()
ret i32 0
}
int main(void) {
  int x;
  (void)(x = 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void SUB_HOST_REG_L(int dst_reg, int src_reg) {
  addbyte(0x29);
  addbyte(0xc0 | dst_reg | (src_reg << 3));
}


x86 assembly (clang, -O0):
<SUB_HOST_REG_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x29,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
or     %eax,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SUB_HOST_REG_L>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x29,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0xc0,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @SUB_HOST_REG_L(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 41)
%6 = load i32, i32* %3
%7 = or i32 192, %6
%8 = load i32, i32* %4
%9 = shl i32 %8, 3
%10 = or i32 %7, %9
%11 = call i32 @addbyte(i32 %10)
ret void
}

LLVM IR (-O2):
define void @SUB_HOST_REG_L(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 41)
%4 = shl i32 %1, 3
%5 = or i32 %4, %0
%6 = or i32 %5, 192
%7 = tail call i32 @addbyte(i32 %6)
ret void
}
/* Variables and functions */
bool str_isempty(const char *c) { return c[0] == '\0'; }


x86 assembly (clang, -O0):
<str_isempty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_isempty>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @str_isempty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @str_isempty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void SCB_EnableICache(void) {}


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

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

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

LLVM IR (-O2):
define void @SCB_EnableICache() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void errnoexit(char *msg) { fprintf(stderr, "%s: %s\n", msg, strerror(errno)); }


x86 assembly (clang, -O0):
<errnoexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errnoexit>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebc(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @errnoexit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @errnoexit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret void
}
unsigned int f17(unsigned int x, unsigned int y) {
  return (x >> (8 * 4 - y)) ^ (x << y);
}


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

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

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

LLVM IR (-O2):
define i32 @f17(i32 %0, i32 %1) {
%3 = sub i32 32, %1
%4 = lshr i32 %0, %3
%5 = shl i32 %0, %1
%6 = xor i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int strlen(char *);
void trimN(char *riga) {
  int lung = strlen(riga);
  if (riga[lung - 1] == '\n')
    riga[lung - 1] = '\0';
}


x86 assembly (clang, -O0):
<trimN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1153 <trimN+0x43>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trimN>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1127 <trimN+0x17>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @trimN(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %5
br label %9
9: ; preds = %8, %1
ret void
}
/* Variables and functions */
double fabs(int);
int pow(double, int);
double f4(double x, double y) {
  return fabs((3. + x * x * (-6. + x * x)) / pow(y, 4.));
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeb6(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
movsd  -0x18(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <fabs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
push   %rax
mulsd  %xmm0,%xmm0
movsd  0xed3(%rip),%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  0xecb(%rip),%xmm2
movsd  %xmm2,(%rsp)
movaps %xmm1,%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
pop    %rax
jmp    1030 <fabs@plt>

LLVM IR (-O0):
define double @f4(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = fmul double %5, %6
%8 = load double, double* %3
%9 = load double, double* %3
%10 = call double @llvm.fmuladd.f64(double %8, double %9, double -6.000000e+00)
%11 = call double @llvm.fmuladd.f64(double %7, double %10, double 3.000000e+00)
%12 = load double, double* %4
%13 = call i32 @pow(double %12, i32 4)
%14 = sitofp i32 %13 to double
%15 = fdiv double %11, %14
%16 = fptosi double %15 to i32
%17 = call double @fabs(i32 %16)
ret double %17
}

LLVM IR (-O2):
define double @f4(double %0, double %1) {
%3 = fmul double %0, %0
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double -6.000000e+00)
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double 3.000000e+00)
%6 = tail call i32 @pow(double %1, i32 4)
%7 = sitofp i32 %6 to double
%8 = fdiv double %5, %7
%9 = fptosi double %8 to i32
%10 = tail call double @fabs(i32 %9)
ret double %10
}
/* Variables and functions */
scalar_t__ isprint(int);
int isgraph(int c) { return (c != 0x20) && isprint(c); }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113c <isgraph+0x2c>
mov    -0x4(%rbp),%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
xor    %eax,%eax
cmp    $0x20,%edi
je     112c <isgraph+0x1c>
push   %rax
call   1030 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @isgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 32
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i64 @isprint(i32 %6)
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = icmp eq i32 %0, 32
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @isprint(i32 %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
int __test_and_set_bit(long nr, volatile unsigned long *addr) {
  int oldbit;
  asm("bts %2,%1\n\t"
      "sbb %0,%0"
      : "=r"(oldbit), "+m"(*(volatile long *)(addr))
      : "Ir"(nr));
  return oldbit;
}


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

x86 assembly (clang, -O2):
<__test_and_set_bit>:
bts    %rdi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__test_and_set_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i32
store i64 %0, i64* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i64, i64* %3
%8 = call i32 asm "bts $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @__test_and_set_bit(i64 %0, i64* %1) {
%3 = tail call i32 asm "bts $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i64 %0, i64* elementtype(i64) %1)
ret i32 %3
}
int test_imm_8Auint8_mem(unsigned char *val) {
  return ((*val) & (-0x8A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_8Auint8_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, -138
%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_8Auint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 118
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void sha1hash_usage(void) {
  printf(("Usage: %s [OPTIONS] file\n"
          "  -h, --help                print this help and exit\n"
          "  -q, --quiet, --silent     do not print messages\n"
          "  -V, --version             print version number and exit\n"
          "  -v, --verbose             print verbose messages\n"
          "\n"
          "Report bugs to <%s>.\n"),
         "sha1hash", "david@syzdek.net");
  return;
}


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

x86 assembly (clang, -O2):
<sha1hash_usage>:
lea    0xee9(%rip),%rdi
lea    0xfe6(%rip),%rsi
lea    0xfe8(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [260 x i8] c"Usage: %s [OPTIONS] file\0A -h, --help print this help and exit\0A -q, --quiet, --silent do not print messages\0A -V, --version print version number and exit\0A -v, --verbose print verbose messages\0A\0AReport bugs to <%s>.\0A\00"
@.str.1 = [9 x i8] c"sha1hash\00"
@.str.2 = [17 x i8] c"david@syzdek.net\00"
define void @sha1hash_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([260 x i8], [260 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [260 x i8] c"Usage: %s [OPTIONS] file\0A -h, --help print this help and exit\0A -q, --quiet, --silent do not print messages\0A -V, --version print version number and exit\0A -v, --verbose print verbose messages\0A\0AReport bugs to <%s>.\0A\00"
@.str.1 = [9 x i8] c"sha1hash\00"
@.str.2 = [17 x i8] c"david@syzdek.net\00"
define void @sha1hash_usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([260 x i8], [260 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void pmon_inc(int flags) {}


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

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

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

LLVM IR (-O2):
define void @pmon_inc(i32 %0) {
ret void
}
int withinArray(int *intArray, int size, int *ptr) {
  int a = ptr;
  int b = intArray;
  int c = intArray + size + ~0;
  int d = a + ~b + 1;
  int e = c + ~a + 1;
  return d >> 31 == 0 & e >> 31 == 0;
}


x86 assembly (clang, -O0):
<withinArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0xfffffffffffffffc,%rax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
xor    $0xffffffff,%ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x1c(%rbp),%ecx
xor    $0xffffffff,%ecx
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
sar    $0x1f,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x2c(%rbp),%ecx
sar    $0x1f,%ecx
cmp    $0x0,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<withinArray>:
lea    (%rdi,%rsi,4),%eax
add    $0xfffffffc,%eax
not    %eax
add    %edx,%eax
mov    %edx,%ecx
not    %ecx
add    %edi,%ecx
and    %ecx,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @withinArray(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%12 = load i32*, i32** %6
%13 = ptrtoint i32* %12 to i32
store i32 %13, i32* %7
%14 = load i32*, i32** %4
%15 = ptrtoint i32* %14 to i32
store i32 %15, i32* %8
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = getelementptr inbounds i32, i32* %19, i64 -1
%21 = ptrtoint i32* %20 to i32
store i32 %21, i32* %9
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = xor i32 %23, -1
%25 = add nsw i32 %22, %24
%26 = add nsw i32 %25, 1
store i32 %26, i32* %10
%27 = load i32, i32* %9
%28 = load i32, i32* %7
%29 = xor i32 %28, -1
%30 = add nsw i32 %27, %29
%31 = add nsw i32 %30, 1
store i32 %31, i32* %11
%32 = load i32, i32* %10
%33 = ashr i32 %32, 31
%34 = icmp eq i32 %33, 0
%35 = zext i1 %34 to i32
%36 = load i32, i32* %11
%37 = ashr i32 %36, 31
%38 = icmp eq i32 %37, 0
%39 = zext i1 %38 to i32
%40 = and i32 %35, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @withinArray(i32* %0, i32 %1, i32* %2) {
%4 = ptrtoint i32* %2 to i64
%5 = trunc i64 %4 to i32
%6 = ptrtoint i32* %0 to i64
%7 = trunc i64 %6 to i32
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 -1
%11 = ptrtoint i32* %10 to i64
%12 = trunc i64 %11 to i32
%13 = xor i32 %5, -1
%14 = add i32 %13, %7
%15 = xor i32 %12, -1
%16 = add i32 %15, %5
%17 = and i32 %16, %14
%18 = lshr i32 %17, 31
ret i32 %18
}
/* Type definitions */
struct stat {
  long st_ino;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
long get_inode(const char *file_path) {
  struct stat buf;
  if (stat(file_path, &buf) == 0) {
    return buf.st_ino;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<get_inode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    1140 <get_inode+0x30>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1148 <get_inode+0x38>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_inode>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
neg    %rax
sbb    %rax,%rax
or     (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @get_inode(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i64, i64* %9
store i64 %10, i64* %2
br label %12
11: ; preds = %1
store i64 -1, i64* %2
br label %12
12: ; preds = %11, %8
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @get_inode(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = select i1 %5, i64 %7, i64 -1
ret i64 %8
}
imm0regx1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if (22 <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0regx1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movswl (%rax,%rcx,2),%ecx
mov    $0x16,%eax
cmp    %ecx,%eax
jg     1144 <imm0regx1+0x44>
movl   $0x1,-0x4(%rbp)
jmp    114b <imm0regx1+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0regx1>:
movslq %ecx,%rcx
xor    %eax,%eax
cmpw   $0x16,(%r9,%rcx,2)
setge  %al
ret

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

LLVM IR (-O2):
define i32 @imm0regx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i16, i16* %5, i64 %7
%9 = load i16, i16* %8
%10 = icmp sgt i16 %9, 21
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ __enable_fault_irq();
int /*<<< orphan*/ __enable_irq();
void Interrupts_Enable() {
  __enable_irq();
  __enable_fault_irq();
}


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

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

LLVM IR (-O0):
define void @Interrupts_Enable() {
%1 = call i32 (...) @__enable_irq()
%2 = call i32 (...) @__enable_fault_irq()
ret void
}

LLVM IR (-O2):
define void @Interrupts_Enable() {
%1 = tail call i32 (...) @__enable_irq()
%2 = tail call i32 (...) @__enable_fault_irq()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ tty_mode(int);
extern void signal_handler(int signum) {
  tty_mode(1);
  exit(2);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <tty_mode@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
mov    $0x1,%edi
call   1030 <tty_mode@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @tty_mode(i32 1)
%4 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
define void @signal_handler(i32 %0) {
%2 = tail call i32 @tty_mode(i32 1)
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int rand();
void generate_random_array(int arr[10000], int N) {
  int i;
  for (i = 0; i < N; i++) {
    arr[i] = rand() % 1000;
  }
}


x86 assembly (clang, -O0):
<generate_random_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <generate_random_array+0x4a>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <generate_random_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_random_array>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1162 <generate_random_array+0x52>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <generate_random_array+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @generate_random_array(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 1000
%10 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %9, i32* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *xmalloc(scalar_t__);
char *xstrdup(const char *str) {
  char *p = xmalloc(strlen(str) + 1);
  strcpy(p, str);
  return p;
}


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

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

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

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
__attribute__((no, noclone)) short foo10(short arg) {
  short ret = 1;
  if (arg + 1 < 0 || arg + 1 > ((!1) ? ((1 << (sizeof(char) * 8 - 1)) - 1)
                                     : ((1 << (sizeof(char) * 8)) - 1)))
    return ret;
  arg = arg + 1;
  ret = (unsigned char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo10>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
jl     1133 <foo10+0x33>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0xff,%eax
jle    1140 <foo10+0x40>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    115e <foo10+0x5e>
movswl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movzbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo10>:
lea    0x1(%rdi),%ecx
add    $0xffffff01,%edi
movzwl %di,%eax
cmp    $0xff00,%eax
mov    $0x1,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @foo10(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = add nsw i32 %6, 1
%8 = icmp slt i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %1
%10 = load i16, i16* %3
%11 = sext i16 %10 to i32
%12 = add nsw i32 %11, 1
%13 = icmp sgt i32 %12, 255
br i1 %13, label %14, label %16
14: ; preds = %9, %1
%15 = load i16, i16* %4
store i16 %15, i16* %2
br label %25
16: ; preds = %9
%17 = load i16, i16* %3
%18 = sext i16 %17 to i32
%19 = add nsw i32 %18, 1
%20 = trunc i32 %19 to i16
store i16 %20, i16* %3
%21 = load i16, i16* %3
%22 = trunc i16 %21 to i8
%23 = zext i8 %22 to i16
store i16 %23, i16* %4
%24 = load i16, i16* %3
store i16 %24, i16* %2
br label %25
25: ; preds = %16, %14
%26 = load i16, i16* %2
ret i16 %26
}

LLVM IR (-O2):
define signext i16 @foo10(i16 signext %0) {
%2 = add i16 %0, 1
%3 = add i16 %0, -255
%4 = icmp ult i16 %3, -256
%5 = select i1 %4, i16 1, i16 %2
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ findMajority(char *, int, char *);
int /*<<< orphan*/ printf(char *, char);
int main() {
  char m[14] = "AAACCBBCCCBCC";
  char majority;
  findMajority(m, 13, &majority);
  printf("Мажорант: %c\n", majority);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0x12(%rbp),%rdi
mov    $0xd,%esi
lea    -0x13(%rbp),%rdx
call   1040 <findMajority@plt>
lea    0xea7(%rip),%rdi
movsbl -0x13(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x43434243434342,%rax
mov    %rax,0xe(%rsp)
movabs $0x4342424343414141,%rax
42 42 43
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x7(%rsp),%rdx
mov    $0xd,%esi
call   1040 <findMajority@plt>
movsbl 0x7(%rsp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.m = [14 x i8] c"AAACCBBCCCBCC\00"
@.str = [22 x i8] c"\D0\9C\D0\B0\D0\B6\D0\BE\D1\80\D0\B0\D0\BD\D1\82: %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i8]
%3 = alloca i8
store i32 0, i32* %1
%4 = bitcast [14 x i8]* %2 to i8*
%5 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%6 = call i32 @findMajority(i8* %5, i32 13, i8* %3)
%7 = load i8, i8* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.m = [14 x i8] c"AAACCBBCCCBCC\00"
@.str = [22 x i8] c"\D0\9C\D0\B0\D0\B6\D0\BE\D1\80\D0\B0\D0\BD\D1\82: %c\0A\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%4 = call i32 @findMajority(i8* %3, i32 13, i8* %2)
%5 = load i8, i8* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8 signext %5)
ret i32 0
}
unsigned int p_mkhash(const void *_x) {
  char *x;
  unsigned int h;
  h = 0;
  x = (char *)_x;
  while (*x)
    h += *x++;
  return h % 256;
}


x86 assembly (clang, -O0):
<p_mkhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <p_mkhash+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <p_mkhash+0x17>
mov    -0x14(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<p_mkhash>:
mov    (%rdi),%al
test   %al,%al
je     1124 <p_mkhash+0x24>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movzbl %al,%eax
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <p_mkhash+0x10>
movzbl %cl,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @p_mkhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = zext i8 %5 to i32
%10 = add i32 %6, %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = and i32 %10, 255
br label %15
15: ; preds = %13, %1
%16 = phi i32 [ 0, %1 ], [ %14, %13 ]
ret i32 %16
}
void gtk_combo_box_get_row_span_column() {}


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

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

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

LLVM IR (-O2):
define void @gtk_combo_box_get_row_span_column() {
ret void
}
void initcolor(void) {}


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

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

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

LLVM IR (-O2):
define void @initcolor() {
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t ret = 0;
  while (s[ret])
    ++ret;
  return ret;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *memdup(const void *mem, size_t nmemb, size_t size) {
  void *p = malloc(nmemb * size);
  if (p)
    memcpy(p, mem, nmemb * size);
  return p;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1167 <memdup+0x47>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
imul   -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
imul   %rdx,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     114d <memdup+0x2d>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @memdup(i8* %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %7, %3
ret i8* %5
}