xunge/DecIR huggingface dataset:
number(str) char *str;
{
  register n, c;
  register char *s;
  n = 0;
  s = str;
  while (c = *s++) {
    if (c < '0' || c > '9')
      return (0);
    n = n * 10 + c - '0';
  }
  return (n);
}


x86 assembly (clang, -O0):
<number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     1167 <number+0x67>
cmpl   $0x30,-0x18(%rbp)
jl     1149 <number+0x49>
cmpl   $0x39,-0x18(%rbp)
jle    1155 <number+0x55>
movl   $0x0,-0x4(%rbp)
jmp    116d <number+0x6d>
imul   $0xa,-0x14(%rbp),%eax
add    -0x18(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <number+0x17>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number>:
mov    (%rdi),%cl
test   %cl,%cl
je     1130 <number+0x30>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    -0x3a(%rcx),%edx
cmp    $0xf6,%dl
jb     1130 <number+0x30>
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <number+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @number(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i32 0, i32* %4
%7 = load i8*, i8** %3
store i8* %7, i8** %6
br label %8
8: ; preds = %21, %1
%9 = load i8*, i8** %6
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %6
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
store i32 %12, i32* %5
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %27
14: ; preds = %8
%15 = load i32, i32* %5
%16 = icmp slt i32 %15, 48
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %5
%19 = icmp sgt i32 %18, 57
br i1 %19, label %20, label %21
20: ; preds = %17, %14
store i32 0, i32* %2
br label %29
21: ; preds = %17
%22 = load i32, i32* %4
%23 = mul nsw i32 %22, 10
%24 = load i32, i32* %5
%25 = add nsw i32 %23, %24
%26 = sub nsw i32 %25, 48
store i32 %26, i32* %4
br label %8
27: ; preds = %8
%28 = load i32, i32* %4
store i32 %28, i32* %2
br label %29
29: ; preds = %27, %20
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @number(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %16, %11 ], [ %2, %1 ]
%6 = phi i8* [ %8, %11 ], [ %0, %1 ]
%7 = phi i32 [ %15, %11 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = add i8 %5, -58
%10 = icmp ult i8 %9, -10
br i1 %10, label %18, label %11
11: ; preds = %4
%12 = zext i8 %5 to i32
%13 = mul nsw i32 %7, 10
%14 = add i32 %13, -48
%15 = add i32 %14, %12
%16 = load i8, i8* %8
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %4
18: ; preds = %4, %11, %1
%19 = phi i32 [ 0, %1 ], [ %15, %11 ], [ 0, %4 ]
ret i32 %19
}
int READ_UINT16(void *addr) {
  unsigned char *buf = addr;
  return (buf[0] << 8) | buf[1];
}


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

x86 assembly (clang, -O2):
<READ_UINT16>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @READ_UINT16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char *, struct stat *);
bool file_exists(char *fn) {
  struct stat stat_buf;
  return (stat(fn, &stat_buf) == 0) && S_ISREG(stat_buf.st_mode);
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <file_exists+0x3d>
mov    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <file_exists+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(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
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
int hv_max_i(int x, int y) { return (x >= y) ? x : y; }


x86 assembly (clang, -O0):
<hv_max_i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1121 <hv_max_i+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <hv_max_i+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hv_max_i>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @hv_max_i(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
struct hash_control {
  int dummy;
};

/* Variables and functions */
char *hash_find(struct hash_control *, char const *);
char *lookup_transitem(struct hash_control *p, const char *msgid) {
  char *t;
  if (p == NULL || msgid == NULL)
    return NULL;
  t = hash_find(p, msgid);
  return t;
}


x86 assembly (clang, -O0):
<lookup_transitem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <lookup_transitem+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1143 <lookup_transitem+0x33>
movq   $0x0,-0x8(%rbp)
jmp    115c <lookup_transitem+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <hash_find@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup_transitem>:
test   %rdi,%rdi
je     111f <lookup_transitem+0xf>
test   %rsi,%rsi
je     111f <lookup_transitem+0xf>
jmp    1030 <hash_find@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.hash_control = type { i32 }
define i8* @lookup_transitem(%struct.hash_control* %0, i8* %1) {
%3 = icmp eq %struct.hash_control* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @hash_find(%struct.hash_control* %0, i8* %1)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ null, %2 ]
ret i8* %9
}
int fun1154() { return 1154; }


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

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

LLVM IR (-O0):
define i32 @fun1154() {
ret i32 1154
}

LLVM IR (-O2):
define i32 @fun1154() {
ret i32 1154
}
void ASN1_ENUMERATED_get(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_ENUMERATED_get() {
ret void
}
void __DELETE_java_util_HashMap(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_util_HashMap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_util_HashMap(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int japi_alertbox(int, char *, char *, char *);
int j_alertbox(int arg0, char *arg1, char *arg2, char *arg3) {
  return (japi_alertbox(arg0, arg1, arg2, arg3));
}


x86 assembly (clang, -O0):
<j_alertbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <japi_alertbox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_alertbox>:
jmp    1030 <japi_alertbox@plt>

LLVM IR (-O0):
define i32 @j_alertbox(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @japi_alertbox(i32 %9, i8* %10, i8* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @j_alertbox(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @japi_alertbox(i32 %0, i8* %1, i8* %2, i8* %3)
ret i32 %5
}
int sub(int num2, int num1) { return (num1 - num2); }


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

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

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

LLVM IR (-O2):
define i32 @sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
unsigned char *base16_decode(unsigned char *, size_t *, unsigned char const *,
                             size_t);
unsigned char *decode_buffer_base16(unsigned char *out, size_t *out_len,
                                    const unsigned char *in, size_t in_len) {
  return base16_decode(out, out_len, in, in_len);
}


x86 assembly (clang, -O0):
<decode_buffer_base16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <base16_decode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_buffer_base16>:
jmp    1030 <base16_decode@plt>

LLVM IR (-O0):
define i8* @decode_buffer_base16(i8* %0, i64* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64* %1, i64** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64*, i64** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i8* @base16_decode(i8* %9, i64* %10, i8* %11, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @decode_buffer_base16(i8* %0, i64* %1, i8* %2, i64 %3) {
%5 = tail call i8* @base16_decode(i8* %0, i64* %1, i8* %2, i64 %3)
ret i8* %5
}
void curve25519_clamp(unsigned char *privkey) {
  privkey[0] &= 248;
  privkey[31] &= 127;
  privkey[31] |= 64;
}


x86 assembly (clang, -O0):
<curve25519_clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
and    $0xf8,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x1f(%rax),%ecx
and    $0x7f,%ecx
mov    %cl,0x1f(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x1f(%rax),%ecx
or     $0x40,%ecx
mov    %cl,0x1f(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<curve25519_clamp>:
andb   $0xf8,(%rdi)
mov    0x1f(%rdi),%al
and    $0x3f,%al
or     $0x40,%al
mov    %al,0x1f(%rdi)
ret

LLVM IR (-O0):
define void @curve25519_clamp(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 = zext i8 %5 to i32
%7 = and i32 %6, 248
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 31
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = and i32 %12, 127
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 31
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %18, 64
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
ret void
}

LLVM IR (-O2):
define void @curve25519_clamp(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -8
store i8 %3, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 31
%5 = load i8, i8* %4
%6 = and i8 %5, 63
%7 = or i8 %6, 64
store i8 %7, i8* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_rotone(char *);
int main(int argc, char **argv) {
  if (argc != 2) {
    ft_putchar('\n');
    return (0);
  }
  ft_rotone(argv[1]);
  ft_putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1156 <main+0x36>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
movl   $0x0,-0x4(%rbp)
jmp    1174 <main+0x54>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <ft_rotone@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    112f <main+0xf>
mov    0x8(%rsi),%rdi
call   1030 <ft_rotone@plt>
mov    $0xa,%edi
call   1040 <ft_putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @ft_rotone(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
scalar_t__ mychar2int(char const);
int myatoi(const char *s) {
  int v = 0;
  for (; *s; s++) {
    v *= 10;
    v += mychar2int(*s);
  }
  return v;
}


x86 assembly (clang, -O0):
<myatoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <myatoi+0x51>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <mychar2int@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <myatoi+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myatoi>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%cl
test   %cl,%cl
je     114d <myatoi+0x3d>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rax,%rax,4),%r14d
movsbl %cl,%edi
call   1030 <mychar2int@plt>
lea    (%rax,%r14,2),%eax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <myatoi+0x20>
jmp    114f <myatoi+0x3f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @myatoi(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 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = mul nsw i32 %6, 10
%9 = tail call i64 @mychar2int(i8 signext %5)
%10 = trunc i64 %9 to i32
%11 = add i32 %8, %10
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ f(int /*<<< orphan*/, int, int);
void testTortureExecute(void) {
  f(0, 1, 1);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 @f(i32 0, i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @f(i32 0, i32 1, i32 1)
ret void
}
/* Variables and functions */
int FE_OVERFLOW;
int FE_UNDERFLOW;
int /*<<< orphan*/ feclearexcept(int const);
double fenv_test(double a, double b) {
  const int range_problem = FE_OVERFLOW | FE_UNDERFLOW;
  feclearexcept(range_problem);
  return a * b;
}


x86 assembly (clang, -O0):
<fenv_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    0x2eb6(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <feclearexcept@plt>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fenv_test>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    0x2eb1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1030 <feclearexcept@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@FE_OVERFLOW = global i32 0
@FE_UNDERFLOW = global i32 0
define double @fenv_test(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
store double %1, double* %4
%6 = load i32, i32* @FE_OVERFLOW
%7 = load i32, i32* @FE_UNDERFLOW
%8 = or i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @feclearexcept(i32 %9)
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fmul double %11, %12
ret double %13
}

LLVM IR (-O2):
@FE_OVERFLOW = global i32 0
@FE_UNDERFLOW = global i32 0
define double @fenv_test(double %0, double %1) {
%3 = load i32, i32* @FE_OVERFLOW
%4 = load i32, i32* @FE_UNDERFLOW
%5 = or i32 %4, %3
%6 = tail call i32 @feclearexcept(i32 %5)
%7 = fmul double %0, %1
ret double %7
}
void f0(void) { extern int x6; }


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

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

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

LLVM IR (-O2):
define void @f0() {
ret void
}
unsigned char ds1337_set_alarm1(unsigned char hour, unsigned char minutes,
                                unsigned char seconds, unsigned char day) {
  return 1;
}


x86 assembly (clang, -O0):
<ds1337_set_alarm1>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
mov    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @ds1337_set_alarm1(i8 zeroext %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
ret i8 1
}

LLVM IR (-O2):
define zeroext i8 @ds1337_set_alarm1(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
ret i8 1
}
/* Variables and functions */
int has_valid_chars(char const *, char *);
int semver_is_number(const char *s) { return has_valid_chars(s, "0123456789"); }


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

x86 assembly (clang, -O2):
<semver_is_number>:
lea    0xee9(%rip),%rsi
jmp    1030 <has_valid_chars@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define i32 @semver_is_number(i8* %0) {
%2 = tail call i32 @has_valid_chars(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
void foo042(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo042(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
void cd(char *pathname) { chdir(pathname); }


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

x86 assembly (clang, -O2):
<cd>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define void @cd(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_video();
int /*<<< orphan*/ puts(char *);
int main() {
  init_video();
  puts("Hello world");
  for (;;)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <init_video@plt>
lea    0xec3(%rip),%rdi
call   1040 <puts@plt>
jmp    1142 <main+0x22>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init_video@plt>
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init_video()
%3 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %4, %0
br label %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define i32 @main() {
%1 = tail call i32 (...) @init_video()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
br label %3
}
/* Variables and functions */
size_t clamps(size_t v, size_t min, size_t max) {
  if (v < min) {
    return min;
  } else if (v > max) {
    return max;
  }
  return v;
}


x86 assembly (clang, -O0):
<clamps>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    112b <clamps+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <clamps+0x53>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    1146 <clamps+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <clamps+0x53>
jmp    114b <clamps+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamps>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovbe %rdi,%rax
cmp    %rsi,%rdi
cmovb  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @clamps(i64 %0, i64 %1, i64 %2) {
%4 = icmp ult i64 %0, %1
%5 = icmp ugt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ print(char);
void MAIN() { print("123"[-1]); }


x86 assembly (clang, -O0):
<MAIN>:
push   %rbp
mov    %rsp,%rbp
movsbl 0xee4(%rip),%edi
call   1030 <print@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
define void @MAIN() {
%1 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 -1)
%2 = call i32 @print(i8 signext %1)
ret void
}

LLVM IR (-O2):
define void @MAIN() {
%1 = tail call i32 @print(i8 signext undef)
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
int countSpaces(char *line) {
  int returnMe = 0;
  char *ptr;
  ptr = line;
  while (strlen(ptr) > 0) {
    if (*ptr == ' ')
      returnMe++;
    ptr = ptr + 1;
  }
  return returnMe;
}


x86 assembly (clang, -O0):
<countSpaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jle    1168 <countSpaces+0x58>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1157 <countSpaces+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112b <countSpaces+0x1b>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countSpaces>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
jle    114e <countSpaces+0x3e>
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
cmpb   $0x20,-0x1(%rbx)
sete   %al
add    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x1,%rbx
test   %rax,%rax
jg     1130 <countSpaces+0x20>
jmp    1150 <countSpaces+0x40>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @countSpaces(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1, %4
%5 = phi i8* [ %11, %4 ], [ %0, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = load i8, i8* %5
%8 = icmp eq i8 %7, 32
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %6, %9
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = tail call i64 @strlen(i8* dereferenceable(1) %11)
%13 = icmp sgt i64 %12, 0
br i1 %13, label %4, label %14
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
unsigned short get16bit(unsigned char *b) { return (b[0] << 8) | b[1]; }


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

x86 assembly (clang, -O2):
<get16bit>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @get16bit(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 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %7, %11
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @get16bit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ ws_poll(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ ws_sync();
void display_sync(void) {
  ws_poll(NULL, 0);
  ws_sync();
}


x86 assembly (clang, -O0):
<display_sync>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1040 <ws_poll@plt>
mov    $0x0,%al
call   1030 <ws_sync@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_sync>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1040 <ws_poll@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <ws_sync@plt>

LLVM IR (-O0):
define void @display_sync() {
%1 = call i32 @ws_poll(i32* null, i32 0)
%2 = call i32 (...) @ws_sync()
ret void
}

LLVM IR (-O2):
define void @display_sync() {
%1 = tail call i32 @ws_poll(i32* null, i32 0)
%2 = tail call i32 (...) @ws_sync()
ret void
}
int iscntrl(int c) { return (0 <= c && c <= '\037') || c == '\177'; }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jg     1121 <iscntrl+0x21>
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112b <iscntrl+0x2b>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 0, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 31
br i1 %7, label %11, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 127
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void GC_push_all_stacks() {
  void *p;
  asm("movl %%fs:0x4,%%eax" : "=a"(p));
  GC_push_all_stack(&p, p);
}


x86 assembly (clang, -O0):
<GC_push_all_stacks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %fs:0x4,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <GC_push_all_stack@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GC_push_all_stacks>:
push   %rax
mov    %fs:0x4,%eax
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <GC_push_all_stack@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @GC_push_all_stacks() {
%1 = alloca i8*
%2 = call i8* asm "movl %fs:0x4,%eax", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 (i8**, i8*, ...) bitcast (i32 (...)* @GC_push_all_stack to i32 (i8**, i8*, ...)*)(i8** %1, i8* %3)
ret void
}

LLVM IR (-O2):
define void @GC_push_all_stacks() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = tail call i8* asm "movl %fs:0x4,%eax", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i8* %3, i8** %1
%4 = call i32 (i8**, i8*, ...) bitcast (i32 (...)* @GC_push_all_stack to i32 (i8**, i8*, ...)*)(i8** %1, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
void mode_quit() {
  refresh();
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<mode_quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <refresh@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<mode_quit>:
push   %rax
xor    %eax,%eax
call   1030 <refresh@plt>
xor    %eax,%eax
call   1040 <endwin@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @mode_quit() {
%1 = call i32 (...) @refresh()
%2 = call i32 (...) @endwin()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @mode_quit() {
%1 = tail call i32 (...) @refresh()
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 @exit(i32 0)
unreachable
}
int myexp2(int n) { return (n > 0 ? 2 * myexp2(n - 1) : 1); }


x86 assembly (clang, -O0):
<myexp2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113b <myexp2+0x2b>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <myexp2@plt>
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <myexp2+0x38>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <myexp2+0x38>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myexp2>:
test   %edi,%edi
jle    1124 <myexp2+0x14>
push   %rax
add    $0xffffffff,%edi
call   1030 <myexp2@plt>
add    %eax,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @myexp2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1, %5
%4 = phi i32 [ %8, %5 ], [ 1, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @myexp2(i32 %6)
%8 = shl nsw i32 %7, 1
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, ...);
int main(void) {
  unsigned int a, b, c;
  a = 22000;
  b = 28400000;
  c = 29300000000;
  printf("sizeof(uint): %d\n", sizeof(unsigned int));
  printf("a: %d, b: %d, c: %d\n", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x55f0,-0x8(%rbp)
movl   $0x1b15980,-0xc(%rbp)
movl   $0xd26a8500,-0x10(%rbp)
lea    0xec5(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x55f0,%esi
mov    $0x1b15980,%edx
mov    $0xd26a8500,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"sizeof(uint): %d\0A\00"
@.str.1 = [21 x i8] c"a: %d, b: %d, c: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 22000, i32* %2
store i32 28400000, i32* %3
store i32 -764771072, i32* %4
%5 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"sizeof(uint): %d\0A\00"
@.str.1 = [21 x i8] c"a: %d, b: %d, c: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 22000, i32 28400000, i32 -764771072)
ret i32 0
}
void RTRandBytes(void) {}


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

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

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

LLVM IR (-O2):
define void @RTRandBytes() {
ret void
}
int test_imm_D9uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xD9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D9uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 217
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void traitement_signal(int sig) {
  printf("child_sig:%d \n", sig);
  while (waitpid(-1, NULL, WNOHANG))
    ;
}


x86 assembly (clang, -O0):
<traitement_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <waitpid@plt>
cmp    $0x0,%rax
je     1160 <traitement_signal+0x40>
jmp    113a <traitement_signal+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traitement_signal>:
push   %rbx
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb2(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <waitpid@plt>
test   %rax,%rax
jne    1140 <traitement_signal+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"child_sig:%d \0A\00"
@WNOHANG = global i32 0
define void @traitement_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i64 @waitpid(i32 -1, i32* null, i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"child_sig:%d \0A\00"
@WNOHANG = global i32 0
define void @traitement_signal(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %3
3: ; preds = %3, %1
%4 = load i32, i32* @WNOHANG
%5 = tail call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3
ret void
}
int dup2(oldd, newd) {
  oldd |= 64;
  return __xdup(oldd, newd);
}


x86 assembly (clang, -O0):
<dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     $0x40,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <__xdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup2>:
or     $0x40,%edi
xor    %eax,%eax
jmp    1030 <__xdup@plt>

LLVM IR (-O0):
define i32 @dup2(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 = or i32 %5, 64
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @__xdup to i32 (i32, i32, ...)*)(i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @dup2(i32 %0, i32 %1) {
%3 = or i32 %0, 64
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @__xdup to i32 (i32, i32, ...)*)(i32 %3, i32 %1)
ret i32 %4
}
/* Type definitions */
struct ac_callback {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _callback_extra_free(struct ac_callback *);
int /*<<< orphan*/ assert(struct ac_callback *);
int /*<<< orphan*/ free(struct ac_callback *);
void callback_free(struct ac_callback *callback) {
  assert(callback);
  _callback_extra_free(callback);
  free(callback);
}


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

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

LLVM IR (-O0):
%struct.ac_callback = type { i32 }
define void @callback_free(%struct.ac_callback* %0) {
%2 = alloca %struct.ac_callback*
store %struct.ac_callback* %0, %struct.ac_callback** %2
%3 = load %struct.ac_callback*, %struct.ac_callback** %2
%4 = call i32 @assert(%struct.ac_callback* %3)
%5 = load %struct.ac_callback*, %struct.ac_callback** %2
%6 = call i32 @_callback_extra_free(%struct.ac_callback* %5)
%7 = load %struct.ac_callback*, %struct.ac_callback** %2
%8 = call i32 @free(%struct.ac_callback* %7)
ret void
}

LLVM IR (-O2):
%struct.ac_callback = type { i32 }
define void @callback_free(%struct.ac_callback* %0) {
%2 = tail call i32 @assert(%struct.ac_callback* %0)
%3 = tail call i32 @_callback_extra_free(%struct.ac_callback* %0)
%4 = tail call i32 @free(%struct.ac_callback* %0)
ret void
}
char *strerror(int errnum) {
  extern char *sys_errlist[];
  extern int sys_nerr;
  if (errnum > 0 && errnum < sys_nerr) {
    return sys_errlist[errnum];
  }
  return (char *)"Unknown error type";
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    113b <strerror+0x3b>
mov    -0xc(%rbp),%eax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%eax
jge    113b <strerror+0x3b>
movslq -0xc(%rbp),%rcx
mov    0x2eca(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <strerror+0x46>
lea    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
lea    0xef9(%rip),%rax
test   %edi,%edi
jle    1123 <strerror+0x23>
mov    0x2ed6(%rip),%rcx
cmp    %edi,(%rcx)
jle    1123 <strerror+0x23>
mov    %edi,%eax
mov    0x2ed9(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
@.str = [19 x i8] c"Unknown error type\00"
define i8* @strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %3
%8 = load i32, i32* @sys_nerr
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %12
%14 = load i8*, i8** %13
store i8* %14, i8** %2
br label %16
15: ; preds = %6, %1
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
16: ; preds = %15, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
@.str = [19 x i8] c"Unknown error type\00"
define i8* @strerror(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = load i32, i32* @sys_nerr
%4 = icmp sgt i32 %3, %0
%5 = select i1 %2, i1 %4, i1 false
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = zext i32 %0 to i64
%8 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %7
%9 = load i8*, i8** %8
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %9, %6 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %11
}