xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
const char *register_of_size(size_t size) {
  switch (size) {
  case 2:
    return "ax";
  case 4:
    return "eax";
  case 8:
    return "rax";
  default:
    abort();
  }
}


x86 assembly (clang, -O0):
<register_of_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
sub    $0x2,%rax
je     1159 <register_of_size+0x49>
jmp    1133 <register_of_size+0x23>
mov    -0x18(%rbp),%rax
sub    $0x4,%rax
je     1169 <register_of_size+0x59>
jmp    1146 <register_of_size+0x36>
mov    -0x18(%rbp),%rax
sub    $0x8,%rax
je     1179 <register_of_size+0x69>
jmp    1189 <register_of_size+0x79>
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1190 <register_of_size+0x80>
lea    0xe90(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1190 <register_of_size+0x80>
lea    0xe84(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1190 <register_of_size+0x80>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_of_size>:
cmp    $0x2,%rdi
je     112a <register_of_size+0x1a>
cmp    $0x8,%rdi
je     1132 <register_of_size+0x22>
cmp    $0x4,%rdi
jne    113a <register_of_size+0x2a>
lea    0xed7(%rip),%rax
ret
lea    0xed0(%rip),%rax
ret
lea    0xecb(%rip),%rax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ax\00"
@.str.1 = [4 x i8] c"eax\00"
@.str.2 = [4 x i8] c"rax\00"
define i8* @register_of_size(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
switch i64 %4, label %8 [
i64 2, label %5
i64 4, label %6
i64 8, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %10
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %7, %6, %5
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"ax\00"
@.str.1 = [4 x i8] c"eax\00"
@.str.2 = [4 x i8] c"rax\00"
define i8* @register_of_size(i64 %0) {
switch i64 %0, label %4 [
i64 2, label %6
i64 4, label %2
i64 8, label %3
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1, %3, %2
%7 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ ics_printf(char *, int);
void ics_update_width(int new_width) {
  ics_printf("set width %d\n", new_width);
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"set width %d\0A\00"
define void @ics_update_width(i32 %0) {
%2 = tail call i32 @ics_printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int test_imm_3Cuint8_reg(unsigned char val) {
  return ((val) & (-0x3C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Cuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffc4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_3Cuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -60
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freeMap(char *savemap) {
  if (savemap != NULL)
    free(savemap);
}


x86 assembly (clang, -O0):
<freeMap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <freeMap+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeMap>:
test   %rdi,%rdi
je     111a <freeMap+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @freeMap(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @freeMap(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void op_nop(void *_a, void *_b) {}


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

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

LLVM IR (-O0):
define void @op_nop(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 @op_nop(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
long long strtoll(char const *, char **, int);
long long c_strtoll(const char *nptr, char **endptr, int base) {
  return strtoll(nptr, endptr, base);
}


x86 assembly (clang, -O0):
<c_strtoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtoll@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_strtoll>:
jmp    1030 <strtoll@plt>

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

LLVM IR (-O2):
define i64 @c_strtoll(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtoll(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
char *__scream_to_upper(char const *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
void scream_println(const char *text) {
  char *upper_text = __scream_to_upper(text);
  printf("%s\n", upper_text);
  free(upper_text);
}


x86 assembly (clang, -O0):
<scream_println>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <__scream_to_upper@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scream_println>:
push   %rbx
call   1050 <__scream_to_upper@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @scream_println(i8* %0) {
%2 = tail call i8* @__scream_to_upper(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Type definitions */
struct sockaddr {
  int /*<<< orphan*/ sa_family;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ sa;

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ sendto(int, void const *, size_t, int, struct sockaddr *,
                          int);
ssize_t send(int socket, const void *buffer, size_t length, int flags) {
  struct sockaddr sa;
  sa.sa_family = AF_UNSPEC;
  return sendto(socket, buffer, length, flags, &sa, sizeof(sa));
}


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
lea    -0x20(%rbp),%r8
mov    $0x4,%r9d
call   1030 <sendto@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    %rsp,%r8
mov    $0x4,%r9d
call   1030 <sendto@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@AF_UNSPEC = global i32 0
define i32 @send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca %struct.sockaddr
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%10 = load i32, i32* @AF_UNSPEC
%11 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %9, i32 0, i32 0
store i32 %10, i32* %11
%12 = load i32, i32* %5
%13 = load i8*, i8** %6
%14 = load i64, i64* %7
%15 = load i32, i32* %8
%16 = call i32 @sendto(i32 %12, i8* %13, i64 %14, i32 %15, %struct.sockaddr* %9, i32 4)
ret i32 %16
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@AF_UNSPEC = global i32 0
define i32 @send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca %struct.sockaddr
%6 = bitcast %struct.sockaddr* %5 to i8*
%7 = load i32, i32* @AF_UNSPEC
%8 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %5, i64 0, i32 0
store i32 %7, i32* %8
%9 = call i32 @sendto(i32 %0, i8* %1, i64 %2, i32 %3, %struct.sockaddr* %5, i32 4)
ret i32 %9
}
/* Variables and functions */
char EOF;
char fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char readCharFromUser() {
  char buffer[2];
  char ch;
  fgets(buffer, 2, stdin);
  while (true) {
    ch = fgetc(stdin);
    if (ch == '\n' || ch == EOF) {
      break;
    }
  }
  return buffer[0];
}


x86 assembly (clang, -O0):
<readCharFromUser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x2(%rbp),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%esi
call   1040 <fgets@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
cmp    $0xa,%eax
je     1173 <readCharFromUser+0x53>
movsbl -0x3(%rbp),%eax
mov    0x2e78(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1178 <readCharFromUser+0x58>
jmp    117d <readCharFromUser+0x5d>
jmp    113f <readCharFromUser+0x1f>
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readCharFromUser>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
mov    (%r14),%edx
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1040 <fgets@plt>
mov    0x2e9c(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14),%edi
call   1030 <fgetc@plt>
cmp    $0xa,%al
je     1160 <readCharFromUser+0x40>
cmp    (%rbx),%al
jne    1150 <readCharFromUser+0x30>
mov    0x6(%rsp),%al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i8 0
define signext i8 @readCharFromUser() {
%1 = alloca [2 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 2, i32 %4)
br label %6
6: ; preds = %0, %19
%7 = load i32, i32* @stdin
%8 = call signext i8 @fgetc(i32 %7)
store i8 %8, i8* %2
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 10
br i1 %11, label %18, label %12
12: ; preds = %6
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = load i8, i8* @EOF
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %14, %16
br i1 %17, label %18, label %19
18: ; preds = %12, %6
br label %20
19: ; preds = %12
br label %6
20: ; preds = %18
%21 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%22 = load i8, i8* %21
ret i8 %22
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i8 0
define signext i8 @readCharFromUser() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 2, i32 %3)
br label %5
5: ; preds = %5, %0
%6 = load i32, i32* @stdin
%7 = call signext i8 @fgetc(i32 %6)
%8 = icmp eq i8 %7, 10
%9 = load i8, i8* @EOF
%10 = icmp eq i8 %7, %9
%11 = select i1 %8, i1 true, i1 %10
br i1 %11, label %12, label %5
12: ; preds = %5
%13 = load i8, i8* %2
ret i8 %13
}
void set_bit(unsigned char *str, int bit_number, int state) {
  if (state)
    str[bit_number / 8] |= 1 << (bit_number % 8);
  else
    str[bit_number / 8] &= ~(1 << (bit_number % 8));
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1156 <set_bit+0x56>
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
jmp    1192 <set_bit+0x92>
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    $0x1,%esi
shl    %cl,%esi
xor    $0xffffffff,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
and    %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%r8d
shl    %cl,%r8d
lea    0x7(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
sar    $0x3,%ecx
movslq %ecx,%rsi
mov    (%rdi,%rsi,1),%cl
mov    %r8d,%eax
not    %al
and    %cl,%al
or     %r8b,%cl
test   %edx,%edx
movzbl %al,%eax
movzbl %cl,%ecx
cmove  %eax,%ecx
mov    %cl,(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @set_bit(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %3
%10 = load i32, i32* %5
%11 = srem i32 %10, 8
%12 = shl i32 1, %11
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = sdiv i32 %14, 8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = or i32 %19, %12
%21 = trunc i32 %20 to i8
store i8 %21, i8* %17
br label %36
22: ; preds = %3
%23 = load i32, i32* %5
%24 = srem i32 %23, 8
%25 = shl i32 1, %24
%26 = xor i32 %25, -1
%27 = load i8*, i8** %4
%28 = load i32, i32* %5
%29 = sdiv i32 %28, 8
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %27, i64 %30
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = and i32 %33, %26
%35 = trunc i32 %34 to i8
store i8 %35, i8* %31
br label %36
36: ; preds = %22, %9
ret void
}

LLVM IR (-O2):
define void @set_bit(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = and i32 %1, 7
%6 = shl nuw nsw i32 1, %5
%7 = sdiv i32 %1, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = trunc i32 %6 to i8
%12 = xor i8 %11, -1
%13 = and i8 %10, %12
%14 = or i8 %10, %11
%15 = select i1 %4, i8 %13, i8 %14
store i8 %15, i8* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int funcB(int a, int b) {
  printf("Hello from funcB 1\n");
  return a * b;
}


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

x86 assembly (clang, -O2):
<funcB>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
imul   %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Hello from funcB 1\0A\00"
define i32 @funcB(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
@str = [19 x i8] c"Hello from funcB 1\00"
define i32 @funcB(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = mul nsw i32 %1, %0
ret i32 %4
}
void fa182(void) {
a:
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
p0D:
  goto p0D;
  goto a;
P0D:
  goto P0D;
}


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

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

LLVM IR (-O0):
define void @fa182() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %0
br label %8
8: ; preds = %8, %7
br label %8
9: ; No predecessors!
br label %10
10: ; preds = %10, %9
br label %10
11: ; preds = %11
br label %11
12: ; No predecessors!
br label %13
13: ; preds = %13, %12
br label %13
14: ; preds = %14
br label %14
15: ; preds = %15
br label %15
16: ; No predecessors!
br label %17
17: ; preds = %17, %16
br label %17
18: ; No predecessors!
br label %19
19: ; preds = %19, %18
br label %19
20: ; preds = %20
br label %20
21: ; No predecessors!
br label %22
22: ; preds = %22, %21
br label %22
23: ; preds = %23
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa182() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
char getClass(int);
int /*<<< orphan*/ printf(char *, char);
int getMask(int byte) {
  printf("%c\n", getClass(byte));
  return (getClass(byte) - 'A') * 8;
}


x86 assembly (clang, -O0):
<getMask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <getClass@plt>
lea    0xec6(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <getClass@plt>
movsbl %al,%eax
sub    $0x41,%eax
shl    $0x3,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMask>:
push   %rbx
mov    %edi,%ebx
call   1040 <getClass@plt>
movsbl %al,%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <getClass@plt>
movsbl %al,%eax
lea    -0x208(,%rax,8),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
define i32 @getMask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call signext i8 @getClass(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = load i32, i32* %2
%7 = call signext i8 @getClass(i32 %6)
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 65
%10 = mul nsw i32 %9, 8
ret i32 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @getMask(i32 %0) {
%2 = tail call signext i8 @getClass(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %2)
%4 = tail call signext i8 @getClass(i32 %0)
%5 = sext i8 %4 to i32
%6 = shl nsw i32 %5, 3
%7 = add nsw i32 %6, -520
ret i32 %7
}
/* Variables and functions */
int fdt_path_offset_namelen(void const *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int fdt_path_offset(const void *fdt, const char *path) {
  return fdt_path_offset_namelen(fdt, path, strlen(path));
}


x86 assembly (clang, -O0):
<fdt_path_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <fdt_path_offset_namelen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdt_path_offset>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fdt_path_offset_namelen@plt>

LLVM IR (-O0):
define i32 @fdt_path_offset(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @fdt_path_offset_namelen(i8* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @fdt_path_offset(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @fdt_path_offset_namelen(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
float _nearbyintf(float);
float nearbyintf(float x) { return _nearbyintf(x); }


x86 assembly (clang, -O0):
<nearbyintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <_nearbyintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nearbyintf>:
jmp    1030 <_nearbyintf@plt>

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

LLVM IR (-O2):
define float @nearbyintf(float %0) {
%2 = tail call float @_nearbyintf(float %0)
ret float %2
}
int test_imm_94int64_midword_reg(long long val) {
  return ((val >> 16) & (0x94 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_94int64_midword_reg>:
test   $0x940000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_94int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 148
%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_94int64_midword_reg(i64 %0) {
%2 = and i64 %0, 9699328
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int serialInit2(void) {
  (*(volatile unsigned int *)((0x3FF0000 + 0xE000)) = (0x03));
  (*(volatile unsigned int *)((0x3FF0000 + 0xE004)) = (0x09));
  (*(volatile unsigned int *)((0x3FF0000 + 0xE014)) = (0x500));
  return 0;
}


x86 assembly (clang, -O0):
<serialInit2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3ffe000,%eax
movl   $0x3,(%rax)
mov    $0x3ffe004,%eax
movl   $0x9,(%rax)
mov    $0x3ffe014,%eax
movl   $0x500,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialInit2>:
movl   $0x3,0x3ffe000
movl   $0x9,0x3ffe004
movl   $0x500,0x3ffe014
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @serialInit2() {
store volatile i32 3, i32* inttoptr (i64 67100672 to i32*)
store volatile i32 9, i32* inttoptr (i64 67100676 to i32*)
store volatile i32 1280, i32* inttoptr (i64 67100692 to i32*)
ret i32 0
}

LLVM IR (-O2):
define i32 @serialInit2() {
store volatile i32 3, i32* inttoptr (i64 67100672 to i32*)
store volatile i32 9, i32* inttoptr (i64 67100676 to i32*)
store volatile i32 1280, i32* inttoptr (i64 67100692 to i32*)
ret i32 0
}
void hfixedwidth_(i) int *i;
{ hfixedwidth(*i); }


x86 assembly (clang, -O0):
<hfixedwidth_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <hfixedwidth@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hfixedwidth_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <hfixedwidth@plt>

LLVM IR (-O0):
define void @hfixedwidth_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @hfixedwidth to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @hfixedwidth_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @hfixedwidth to i32 (i32, ...)*)(i32 %2)
ret void
}
int intdecreasing(const void *a, const void *b) {
  return (*(int *)b - *(int *)a);
}


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

x86 assembly (clang, -O2):
<intdecreasing>:
mov    (%rsi),%eax
sub    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @intdecreasing(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @intdecreasing(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int do_860() { return 860; }


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

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

LLVM IR (-O0):
define i32 @do_860() {
ret i32 860
}

LLVM IR (-O2):
define i32 @do_860() {
ret i32 860
}
int div(int x, int y) {
  if (y == 0) {
    return y;
  } else {
    return (x / y);
  }
}


x86 assembly (clang, -O0):
<div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111f <div+0x1f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1129 <div+0x29>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<div>:
test   %esi,%esi
je     110a <div+0xa>
mov    %edi,%eax
cltd
idiv   %esi
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @div(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i32 %0, %1
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, int);
void lookpointer4_(char *ppp) { lookNarray(ppp, 4); }


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

x86 assembly (clang, -O2):
<lookpointer4_>:
mov    $0x4,%esi
jmp    1030 <lookNarray@plt>

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

LLVM IR (-O2):
define void @lookpointer4_(i8* %0) {
%2 = tail call i32 @lookNarray(i8* %0, i32 4)
ret void
}
void TIMER_RJ_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @TIMER_RJ_intr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strchr(char const *, char);
int check_interrogation(const char *str) {
  return !!strchr(str, '?') || !!strchr(str, '#');
}


x86 assembly (clang, -O0):
<check_interrogation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3f,%esi
call   1030 <strchr@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    1155 <check_interrogation+0x45>
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_interrogation>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3f,%esi
call   1030 <strchr@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     112b <check_interrogation+0x1b>
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x23,%esi
call   1030 <strchr@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @check_interrogation(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strchr(i8* %3, i8 signext 63)
%5 = icmp ne i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strchr(i8* %7, i8 signext 35)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = xor i1 %10, true
br label %12
12: ; preds = %6, %1
%13 = phi i1 [ true, %1 ], [ %11, %6 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @check_interrogation(i8* %0) {
%2 = tail call i32 @strchr(i8* %0, i8 signext 63)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @strchr(i8* %0, i8 signext 35)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int ffloat_cmp(const float a, const float b) {
  if (a < b - 0.0001) {
    return -1;
  } else if (a > b - 0.0001 && a < b + 0.0001) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<ffloat_cmp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed8(%rip),%xmm2
subsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <ffloat_cmp+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a5 <ffloat_cmp+0xa5>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xea4(%rip),%xmm2
subsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    119e <ffloat_cmp+0x9e>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe7c(%rip),%xmm2
addsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    119e <ffloat_cmp+0x9e>
movl   $0x0,-0x4(%rbp)
jmp    11a5 <ffloat_cmp+0xa5>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffloat_cmp>:
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movsd  0xef0(%rip),%xmm2
addsd  %xmm1,%xmm2
mov    $0xffffffff,%eax
ucomisd %xmm0,%xmm2
ja     113a <ffloat_cmp+0x3a>
ucomisd %xmm2,%xmm0
setbe  %al
addsd  0xeda(%rip),%xmm1
ucomisd %xmm0,%xmm1
setbe  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ffloat_cmp(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = load float, float* %5
%9 = fpext float %8 to double
%10 = fsub double %9, 1.000000e-04
%11 = fcmp olt double %7, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %29
13: ; preds = %2
%14 = load float, float* %4
%15 = fpext float %14 to double
%16 = load float, float* %5
%17 = fpext float %16 to double
%18 = fsub double %17, 1.000000e-04
%19 = fcmp ogt double %15, %18
br i1 %19, label %20, label %28
20: ; preds = %13
%21 = load float, float* %4
%22 = fpext float %21 to double
%23 = load float, float* %5
%24 = fpext float %23 to double
%25 = fadd double %24, 1.000000e-04
%26 = fcmp olt double %22, %25
br i1 %26, label %27, label %28
27: ; preds = %20
store i32 0, i32* %3
br label %29
28: ; preds = %20, %13
store i32 1, i32* %3
br label %29
29: ; preds = %28, %27, %12
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @ffloat_cmp(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fpext float %1 to double
%5 = fadd double %4, -1.000000e-04
%6 = fcmp ogt double %5, %3
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = fcmp uge double %5, %3
%9 = fadd double %4, 1.000000e-04
%10 = fcmp ule double %9, %3
%11 = or i1 %8, %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %2
%14 = phi i32 [ -1, %2 ], [ %12, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ overflow_1();
int /*<<< orphan*/ overflow_2();
int /*<<< orphan*/ overflow_3();
int main() {
  overflow_1();
  overflow_2();
  overflow_3();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <overflow_1@plt>
mov    $0x0,%al
call   1030 <overflow_2@plt>
mov    $0x0,%al
call   1040 <overflow_3@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @overflow_1()
%2 = call i32 (...) @overflow_2()
%3 = call i32 (...) @overflow_3()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @overflow_1()
%2 = tail call i32 (...) @overflow_2()
%3 = tail call i32 (...) @overflow_3()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __get_cpuid(int, unsigned int *, unsigned int *,
                               unsigned int *, unsigned int *);
int /*<<< orphan*/ do_test();
int main() {
  unsigned int eax, ebx, ecx, edx;
  if (!__get_cpuid(1, &eax, &ebx, &ecx, &edx))
    return 0;
  if ((ecx & ((1 << 28) | (1 << 1))) == ((1 << 28) | (1 << 1))) {
    do_test();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <__get_cpuid@plt>
cmp    $0x0,%eax
jne    115e <main+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    117f <main+0x5f>
mov    -0x10(%rbp),%eax
and    $0x10000002,%eax
cmp    $0x10000002,%eax
jne    1178 <main+0x58>
mov    $0x0,%al
call   1040 <do_test@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x1,%edi
call   1030 <__get_cpuid@plt>
test   %eax,%eax
je     115a <main+0x3a>
mov    0x8(%rsp),%eax
not    %eax
test   $0x10000002,%eax
jne    115a <main+0x3a>
xor    %eax,%eax
call   1040 <do_test@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @__get_cpuid(i32 1, i32* %2, i32* %3, i32* %4, i32* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %0
store i32 0, i32* %1
br label %16
9: ; preds = %0
%10 = load i32, i32* %4
%11 = and i32 %10, 268435458
%12 = icmp eq i32 %11, 268435458
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (...) @do_test()
br label %15
15: ; preds = %13, %9
store i32 0, i32* %1
br label %16
16: ; preds = %15, %8
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @__get_cpuid(i32 1, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = icmp eq i32 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %0
%12 = load i32, i32* %3
%13 = and i32 %12, 268435458
%14 = icmp eq i32 %13, 268435458
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 (...) @do_test()
br label %17
17: ; preds = %11, %15, %0
ret i32 0
}
/* Variables and functions */
scalar_t__ signbit(float);
int __ocl_signbit_float(float src) { return signbit(src) ? 1 : 0; }


x86 assembly (clang, -O0):
<__ocl_signbit_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <signbit@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_signbit_float>:
push   %rax
call   1030 <signbit@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__ocl_signbit_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @signbit(float %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @__ocl_signbit_float(float %0) {
%2 = tail call i64 @signbit(float %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
void time_to_tm(time_t totalsecs, int offset, struct tm *result) {
  if (result != NULL)
    *result = *localtime(&totalsecs);
}


x86 assembly (clang, -O0):
<time_to_tm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1149 <time_to_tm+0x39>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    (%rcx),%ecx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_to_tm>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
test   %rdx,%rdx
je     112f <time_to_tm+0x1f>
mov    %rdx,%rbx
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @time_to_tm(i32 %0, i32 %1, %struct.tm* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.tm*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.tm* %2, %struct.tm** %6
%7 = load %struct.tm*, %struct.tm** %6
%8 = icmp ne %struct.tm* %7, null
br i1 %8, label %9, label %14
9: ; preds = %3
%10 = load %struct.tm*, %struct.tm** %6
%11 = call %struct.tm* @localtime(i32* %4)
%12 = bitcast %struct.tm* %10 to i8*
%13 = bitcast %struct.tm* %11 to i8*
br label %14
14: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @time_to_tm(i32 %0, i32 %1, %struct.tm* writeonly %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = icmp eq %struct.tm* %2, null
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = call %struct.tm* @localtime(i32* %4)
%8 = getelementptr %struct.tm, %struct.tm* %7, i64 0, i32 0
%9 = getelementptr %struct.tm, %struct.tm* %2, i64 0, i32 0
%10 = load i32, i32* %8
store i32 %10, i32* %9
br label %11
11: ; preds = %6, %3
ret void
}
const char *get_name(void) { return "WavPack decoder v0.2"; }


x86 assembly (clang, -O0):
<get_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"WavPack decoder v0.2\00"
define i8* @get_name() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [21 x i8] c"WavPack decoder v0.2\00"
define i8* @get_name() {
ret i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
unsigned short bytes2ushort(char *);
unsigned short dataLen(char *packet) { return bytes2ushort(&packet[6]); }


x86 assembly (clang, -O0):
<dataLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
call   1030 <bytes2ushort@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dataLen>:
add    $0x6,%rdi
jmp    1030 <bytes2ushort@plt>

LLVM IR (-O0):
define zeroext i16 @dataLen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 6
%5 = call zeroext i16 @bytes2ushort(i8* %4)
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @dataLen(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 6
%3 = tail call zeroext i16 @bytes2ushort(i8* %2)
ret i16 %3
}
int fun118() { return 118; }


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

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

LLVM IR (-O0):
define i32 @fun118() {
ret i32 118
}

LLVM IR (-O2):
define i32 @fun118() {
ret i32 118
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main1() {
  struct {
    char ca[16];
  } s;
  int i;
  for (i = 0; i < 16; i++) {
    s.ca[i] = 5;
  }
  for (i = 0; i < 16; i++) {
    if (s.ca[i] != 5)
      abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    1140 <main1+0x30>
movslq -0x14(%rbp),%rax
movb   $0x5,-0x10(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111f <main1+0xf>
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    117d <main1+0x6d>
movslq -0x14(%rbp),%rax
movsbl -0x10(%rbp,%rax,1),%eax
cmp    $0x5,%eax
je     116a <main1+0x5a>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    116f <main1+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <main1+0x37>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { [16 x i8] }
define i32 @main1() {
%1 = alloca %struct.anon
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 16
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 %9
store i8 5, i8* %10
br label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
store i32 0, i32* %2
br label %15
15: ; preds = %29, %14
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 16
br i1 %17, label %18, label %32
18: ; preds = %15
%19 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
%20 = load i32, i32* %2
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [16 x i8], [16 x i8]* %19, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 5
br i1 %25, label %26, label %28
26: ; preds = %18
%27 = call i32 (...) @abort()
unreachable
28: ; preds = %18
br label %29
29: ; preds = %28
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %2
br label %15
32: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
define i32 @main1() {
ret i32 0
}
void ff_hevc_put_hevc_uni_pel_pixels8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_pel_pixels8_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(int argc, char *argv[]) {
  assert(argc > 0);
  printf("Usage:\n");
  printf("%s <filename> [name] [col wrap]\n", argv[0]);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
test   %edi,%edi
setg   %al
mov    %eax,%edi
call   1050 <assert@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xea8(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [33 x i8] c"%s <filename> [name] [col wrap]\0A\00"
define void @usage(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %12)
ret void
}

LLVM IR (-O2):
@.str.1 = [33 x i8] c"%s <filename> [name] [col wrap]\0A\00"
@str = [7 x i8] c"Usage:\00"
define void @usage(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%7 = load i8*, i8** %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_I2C_BUS1_SCL_PIN() { clear_io_bit(0x34, 4); }


x86 assembly (clang, -O0):
<TOSH_CLR_I2C_BUS1_SCL_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
mov    $0x4,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_I2C_BUS1_SCL_PIN>:
mov    $0x34,%edi
mov    $0x4,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_I2C_BUS1_SCL_PIN() {
%1 = call i32 @clear_io_bit(i32 52, i32 4)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_I2C_BUS1_SCL_PIN() {
%1 = tail call i32 @clear_io_bit(i32 52, i32 4)
ret void
}