xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ memchr(char const *, char, size_t);
size_t strnlen(const char *string, size_t max) {
  const char *end = (const char *)memchr(string, '\0', max);
  return end ? (size_t)(end - string) : max;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1152 <strnlen+0x42>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
jmp    115a <strnlen+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memchr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
test   %rax,%rax
cmove  %r14,%rcx
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i64 @memchr(i8* %6, i8 signext 0, i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
br label %20
18: ; preds = %2
%19 = load i64, i64* %4
br label %20
20: ; preds = %18, %12
%21 = phi i64 [ %17, %12 ], [ %19, %18 ]
ret i64 %21
}

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = tail call i64 @memchr(i8* %0, i8 signext 0, i64 %1)
%4 = icmp eq i64 %3, 0
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %3, %5
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
/* Variables and functions */
bool nrf52_errata_76(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_76() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PF_PACKET;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ perror(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int raw_socket_init(int sniff_proto) {
  int rsck;
  if ((rsck = socket(PF_PACKET, SOCK_RAW, htons(sniff_proto))) < 0)
    perror("socket() failure: ");
  return rsck;
}


x86 assembly (clang, -O0):
<raw_socket_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <htons@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    %eax,%edx
call   1050 <socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1180 <raw_socket_init+0x50>
lea    0xe85(%rip),%rdi
call   1040 <perror@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_socket_init>:
push   %rbp
push   %rbx
push   %rax
mov    0x2eb6(%rip),%rax
mov    (%rax),%ebx
mov    0x2e9d(%rip),%rax
mov    (%rax),%ebp
call   1030 <htons@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1164 <raw_socket_init+0x34>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe95(%rip),%rdi
call   1040 <perror@plt>
jmp    115b <raw_socket_init+0x2b>

LLVM IR (-O0):
@PF_PACKET = global i32 0
@SOCK_RAW = global i32 0
@.str = [19 x i8] c"socket() failure: \00"
define i32 @raw_socket_init(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @PF_PACKET
%5 = load i32, i32* @SOCK_RAW
%6 = load i32, i32* %2
%7 = call i32 @htons(i32 %6)
%8 = call i32 @socket(i32 %4, i32 %5, i32 %7)
store i32 %8, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@PF_PACKET = global i32 0
@SOCK_RAW = global i32 0
@.str = [19 x i8] c"socket() failure: \00"
define i32 @raw_socket_init(i32 %0) {
%2 = load i32, i32* @PF_PACKET
%3 = load i32, i32* @SOCK_RAW
%4 = tail call i32 @htons(i32 %0)
%5 = tail call i32 @socket(i32 %2, i32 %3, i32 %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret i32 %5
}
int ft_isblank(char c) {
  if (c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1158 <ft_isblank+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     1158 <ft_isblank+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1158 <ft_isblank+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xb,%eax
je     1158 <ft_isblank+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xc,%eax
je     1158 <ft_isblank+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
jne    1164 <ft_isblank+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <ft_isblank+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isblank>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%cl
jae    110e <ft_isblank+0xe>
ret
cmp    $0x20,%dil
je     110d <ft_isblank+0xd>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ft_isblank(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %27, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 9
br i1 %10, label %27, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 10
br i1 %14, label %27, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 11
br i1 %18, label %27, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 12
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 13
br i1 %26, label %27, label %28
27: ; preds = %23, %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %29
28: ; preds = %23
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @ft_isblank(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 13, label %3
i8 12, label %3
i8 11, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *sha224_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_sha224(unsigned char *out, FILE *fp) {
  return sha224_file(out, fp);
}


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

x86 assembly (clang, -O2):
<hash_file_sha224>:
jmp    1030 <sha224_file@plt>

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

LLVM IR (-O2):
define i8* @hash_file_sha224(i8* %0, i32* %1) {
%3 = tail call i8* @sha224_file(i8* %0, i32* %1)
ret i8* %3
}
/* Type definitions */
struct drone {
  int dummy;
};

/* Variables and functions */
struct drone *drone_alloc();
int /*<<< orphan*/ drone_init(struct drone *);
struct drone *drone_default(void) {
  static struct drone *d;
  if (NULL == d) {
    d = drone_alloc();
    drone_init(d);
  }
  return d;
}


x86 assembly (clang, -O0):
<drone_default>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
cmp    0x2f0b(%rip),%rax
jne    114d <drone_default+0x2d>
mov    $0x0,%al
call   1040 <drone_alloc@plt>
mov    %rax,0x2ef7(%rip)
mov    0x2ef0(%rip),%rdi
call   1030 <drone_init@plt>
mov    0x2ee4(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<drone_default>:
push   %rax
mov    0x2f10(%rip),%rax
test   %rax,%rax
je     112f <drone_default+0xf>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <drone_alloc@plt>
mov    %rax,0x2efb(%rip)
mov    %rax,%rdi
call   1030 <drone_init@plt>
mov    0x2eec(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.drone = type { i32 }
@drone_default.d = internal global %struct.drone* null
define %struct.drone* @drone_default() {
%1 = load %struct.drone*, %struct.drone** @drone_default.d
%2 = icmp eq %struct.drone* null, %1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call %struct.drone* (...) @drone_alloc()
store %struct.drone* %4, %struct.drone** @drone_default.d
%5 = load %struct.drone*, %struct.drone** @drone_default.d
%6 = call i32 @drone_init(%struct.drone* %5)
br label %7
7: ; preds = %3, %0
%8 = load %struct.drone*, %struct.drone** @drone_default.d
ret %struct.drone* %8
}

LLVM IR (-O2):
%struct.drone = type { i32 }
@drone_default.d = internal unnamed_addr global %struct.drone* null
define %struct.drone* @drone_default() {
%1 = load %struct.drone*, %struct.drone** @drone_default.d
%2 = icmp eq %struct.drone* %1, null
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call %struct.drone* (...) @drone_alloc()
store %struct.drone* %4, %struct.drone** @drone_default.d
%5 = tail call i32 @drone_init(%struct.drone* %4)
%6 = load %struct.drone*, %struct.drone** @drone_default.d
br label %7
7: ; preds = %3, %0
%8 = phi %struct.drone* [ %6, %3 ], [ %1, %0 ]
ret %struct.drone* %8
}
/* Variables and functions */
int read_value_from_fcd(int, unsigned char *);
int fcdppGetMixerGain(unsigned char *state) {
  return read_value_from_fcd(154, state);
}


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

x86 assembly (clang, -O2):
<fcdppGetMixerGain>:
mov    %rdi,%rsi
mov    $0x9a,%edi
jmp    1030 <read_value_from_fcd@plt>

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

LLVM IR (-O2):
define i32 @fcdppGetMixerGain(i8* %0) {
%2 = tail call i32 @read_value_from_fcd(i32 154, i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ nrf_802154_energy_detected(int /*<<< orphan*/);
void nrf_802154_notify_energy_detected(uint8_t result) {
  nrf_802154_energy_detected(result);
}


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

x86 assembly (clang, -O2):
<nrf_802154_notify_energy_detected>:
jmp    1030 <nrf_802154_energy_detected@plt>

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

LLVM IR (-O2):
define void @nrf_802154_notify_energy_detected(i32 %0) {
%2 = tail call i32 @nrf_802154_energy_detected(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int vx, vy;
  vx = 57;
  vy = vx + 10;
  printf("vx的值是%d\n", vx);
  printf("vy的值是%d\n", vy);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x39,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
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    $0x39,%esi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x43,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"vx\E7\9A\84\E5\80\BC\E6\98\AF%d\0A\00"
@.str.1 = [15 x i8] c"vy\E7\9A\84\E5\80\BC\E6\98\AF%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 57, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 10
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"vx\E7\9A\84\E5\80\BC\E6\98\AF%d\0A\00"
@.str.1 = [15 x i8] c"vy\E7\9A\84\E5\80\BC\E6\98\AF%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 57)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 67)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ ungetch(char);
void ungets(char s[]) {
  int len;
  len = strlen(s);
  while (len > 0)
    ungetch(s[--len]);
}


x86 assembly (clang, -O0):
<ungets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1160 <ungets+0x40>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <ungetch@plt>
jmp    1138 <ungets+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ungets>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1157 <ungets+0x37>
mov    %eax,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
movsbl (%r14,%rax,1),%edi
call   1040 <ungetch@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1140 <ungets+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ungets(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @ungetch(i8 signext %11)
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %1
ret void
}
const char *x__level_as_str(int l) {
  switch (l) {
  case 0x01:
    return "CGP";
  default:
    return "???";
  }
}


x86 assembly (clang, -O0):
<x__level_as_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
jne    1128 <x__level_as_str+0x28>
jmp    1118 <x__level_as_str+0x18>
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1133 <x__level_as_str+0x33>
lea    0xed5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x__level_as_str>:
cmp    $0x1,%edi
lea    0xef6(%rip),%rcx
lea    0xef3(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"CGP\00"
@.str.1 = [4 x i8] c"???\00"
define i8* @x__level_as_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 1, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"CGP\00"
@.str.1 = [4 x i8] c"???\00"
define i8* @x__level_as_str(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void WatchdogLock(unsigned long ulBase) {
  DEBUG_ASSERT((ulBase == 0x40000000) || (ulBase == 0x40001000));
  (*((volatile unsigned long *)(ulBase + 0x00000C00))) = 0x00000001;
}


x86 assembly (clang, -O0):
<WatchdogLock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x40000000,-0x8(%rbp)
40
mov    %al,-0x9(%rbp)
je     113d <WatchdogLock+0x2d>
cmpq   $0x40001000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
movq   $0x1,0xc00(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogLock>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40000000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
movq   $0x1,0xc00(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @WatchdogLock(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1073741824
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 1073745920
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %2
%13 = add i64 %12, 3072
%14 = inttoptr i64 %13 to i64*
store volatile i64 1, i64* %14
ret void
}

LLVM IR (-O2):
define void @WatchdogLock(i64 %0) {
%2 = and i64 %0, -4097
%3 = icmp eq i64 %2, 1073741824
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 3072
%7 = inttoptr i64 %6 to i64*
store volatile i64 1, i64* %7
ret void
}
int add_stuff1(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<add_stuff1>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add_stuff1(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add_stuff1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int main() {
  register const unsigned char mask = 0x20;
  (*(volatile unsigned char *)(0x2009c040)) = mask;
  while (1) {
    (*(volatile unsigned char *)(0x2009c058)) = mask;
    (*(volatile unsigned char *)(0x2009c05c)) = mask;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x20,-0x5(%rbp)
mov    $0x2009c040,%eax
movb   $0x20,(%rax)
mov    $0x2009c058,%eax
movb   $0x20,(%rax)
mov    $0x2009c05c,%eax
movb   $0x20,(%rax)
jmp    1117 <main+0x17>

x86 assembly (clang, -O2):
<main>:
movb   $0x20,0x2009c040
20
nopl   0x0(%rax,%rax,1)
movb   $0x20,0x2009c058
20
movb   $0x20,0x2009c05c
20
jmp    1110 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 32, i8* %2
store volatile i8 32, i8* inttoptr (i64 537509952 to i8*)
br label %3
3: ; preds = %0, %3
store volatile i8 32, i8* inttoptr (i64 537509976 to i8*)
store volatile i8 32, i8* inttoptr (i64 537509980 to i8*)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
store volatile i8 32, i8* inttoptr (i64 537509952 to i8*)
br label %1
1: ; preds = %1, %0
store volatile i8 32, i8* inttoptr (i64 537509976 to i8*)
store volatile i8 32, i8* inttoptr (i64 537509980 to i8*)
br label %1
}
int rbtree_intcmp(const void *p1, const void *p2) {
  int i1, i2;
  i1 = *((int *)p1);
  i2 = *((int *)p2);
  if (i1 < i2) {
    return -1;
  } else if (i1 == i2) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<rbtree_intcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <rbtree_intcmp+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <rbtree_intcmp+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <rbtree_intcmp+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <rbtree_intcmp+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rbtree_intcmp>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @rbtree_intcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void packetio_tx_flat() {}


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

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

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

LLVM IR (-O2):
define void @packetio_tx_flat() {
ret void
}
int valid_digit(char *ip_str) {
  while (*ip_str) {
    if (*ip_str >= '0' && *ip_str <= '9')
      ++ip_str;
    else
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<valid_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1157 <valid_digit+0x57>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1146 <valid_digit+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     1146 <valid_digit+0x46>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1152 <valid_digit+0x52>
movl   $0x0,-0x4(%rbp)
jmp    115e <valid_digit+0x5e>
jmp    1108 <valid_digit+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_digit>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <valid_digit+0x23>
add    $0x1,%rdi
nop
add    $0xd0,%cl
cmp    $0xa,%cl
jae    1124 <valid_digit+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <valid_digit+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @valid_digit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = add i8 %8, -48
%11 = icmp ult i8 %10, 10
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %4, label %13
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
int main(void) {
  int a = 8;
  int s = 5;
#pragma acc parallel vector_length(N)
  {
    int i;
#pragma acc loop reduction(+ : s)
    for (i = 0; i < 11; ++i)
      s += a;
  }
  if (s != 5 + 11 * 8)
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xb,-0x10(%rbp)
jge    1155 <main+0x45>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
cmpl   $0x5d,-0xc(%rbp)
je     1164 <main+0x54>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
short horiz_mode_code_black(short runlen) {
  return (runlen < 64 ? runlen + 106 : (runlen / 64) + 169);
}


x86 assembly (clang, -O0):
<horiz_mode_code_black>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x40,%eax
jge    1127 <horiz_mode_code_black+0x27>
movswl -0x2(%rbp),%eax
add    $0x6a,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <horiz_mode_code_black+0x3b>
movswl -0x2(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
add    $0xa9,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<horiz_mode_code_black>:
movzwl %di,%ecx
lea    0x6a(%rdi),%edx
mov    %ecx,%eax
shr    $0x6,%eax
add    $0xa9,%eax
cmp    $0x40,%cx
cmovl  %edx,%eax
ret

LLVM IR (-O0):
define signext i16 @horiz_mode_code_black(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp slt i32 %4, 64
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = add nsw i32 %8, 106
br label %15
10: ; preds = %1
%11 = load i16, i16* %2
%12 = sext i16 %11 to i32
%13 = sdiv i32 %12, 64
%14 = add nsw i32 %13, 169
br label %15
15: ; preds = %10, %6
%16 = phi i32 [ %9, %6 ], [ %14, %10 ]
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define signext i16 @horiz_mode_code_black(i16 signext %0) {
%2 = icmp slt i16 %0, 64
%3 = add nsw i16 %0, 106
%4 = lshr i16 %0, 6
%5 = add nuw nsw i16 %4, 169
%6 = select i1 %2, i16 %3, i16 %5
ret i16 %6
}
void __attribute__((
    warning("curl_easy_setopt expects a long argument for this option")))
__attribute__((unused)) __attribute__((no)) _curl_easy_setopt_err_long(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_long() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void ff_hevc_put_hevc_uni_w_epel_v8_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_v8_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(int);
void main(void) {
  int i = 0;
  for (i = 1; i <= 4; i++) {
    switch (i) {
    case 1:
      print(1);
      break;
    case 2:
      print(2);
      break;
    case 3:
      print(1);
      break;
    case 4:
      print(4);
      break;
    default:
      break;
    }
  }
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jg     11ad <main+0x9d>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1195 <main+0x85>
mov    -0x10(%rbp),%rax
lea    0xeb0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1,%edi
call   1030 <print@plt>
jmp    119a <main+0x8a>
mov    $0x2,%edi
call   1030 <print@plt>
jmp    119a <main+0x8a>
mov    $0x1,%edi
call   1030 <print@plt>
jmp    119a <main+0x8a>
mov    $0x4,%edi
call   1030 <print@plt>
jmp    119a <main+0x8a>
jmp    119a <main+0x8a>
jmp    119f <main+0x8f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <main+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <print@plt>
mov    $0x2,%edi
call   1030 <print@plt>
mov    $0x1,%edi
call   1030 <print@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <print@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %1
br label %2
2: ; preds = %17, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 4
br i1 %4, label %5, label %20
5: ; preds = %2
%6 = load i32, i32* %1
switch i32 %6, label %15 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
]
7: ; preds = %5
%8 = call i32 @print(i32 1)
br label %16
9: ; preds = %5
%10 = call i32 @print(i32 2)
br label %16
11: ; preds = %5
%12 = call i32 @print(i32 1)
br label %16
13: ; preds = %5
%14 = call i32 @print(i32 4)
br label %16
15: ; preds = %5
br label %16
16: ; preds = %15, %13, %11, %9, %7
br label %17
17: ; preds = %16
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
br label %2
20: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @print(i32 1)
%2 = tail call i32 @print(i32 2)
%3 = tail call i32 @print(i32 1)
%4 = tail call i32 @print(i32 4)
ret void
}
__attribute__((vector_size(16))) int f3(__attribute__((vector_size(16))) int t,
                                        int a) {
  ((int *)&t)[3] = a;
  return t;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
movdqa %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
movdqa -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
movd   %edi,%xmm1
shufps $0xe4,%xmm0,%xmm1
shufps $0x24,%xmm1,%xmm0
ret

LLVM IR (-O0):
define <4 x i32> @f3(<4 x i32> %0, i32 %1) {
%3 = alloca <4 x i32>
%4 = alloca i32
store <4 x i32> %0, <4 x i32>* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = bitcast <4 x i32>* %3 to i32*
%7 = getelementptr inbounds i32, i32* %6, i64 3
store i32 %5, i32* %7
%8 = load <4 x i32>, <4 x i32>* %3
ret <4 x i32> %8
}

LLVM IR (-O2):
define <4 x i32> @f3(<4 x i32> %0, i32 %1) {
%3 = insertelement <4 x i32> %0, i32 %1, i64 3
ret <4 x i32> %3
}
/* Type definitions */
typedef int /*<<< orphan*/ processSize;
typedef int /*<<< orphan*/ blockSize;

/* Variables and functions */
int /*<<< orphan*/ worstFit(int *, int, int *, int);
int main() {
  int blockSize[] = {100, 500, 200, 300, 600};
  int processSize[] = {212, 417, 112, 426};
  int m = sizeof(blockSize) / sizeof(blockSize[0]);
  int n = sizeof(processSize) / sizeof(processSize[0]);
  worstFit(blockSize, m, processSize, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x5,-0x34(%rbp)
movl   $0x4,-0x38(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x34(%rbp),%esi
lea    -0x30(%rbp),%rdx
mov    -0x38(%rbp),%ecx
call   1030 <worstFit@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xef0(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    %rsp,%rdi
lea    0x20(%rsp),%rdx
mov    $0x5,%esi
mov    $0x4,%ecx
call   1030 <worstFit@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.blockSize = [5 x i32] [i32 100, i32 500, i32 200, i32 300, i32 600]
@__const.main.processSize = [4 x i32] [i32 212, i32 417, i32 112, i32 426]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca [4 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [5 x i32]* %2 to i8*
%7 = bitcast [4 x i32]* %3 to i8*
store i32 5, i32* %4
store i32 4, i32* %5
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %4
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%11 = load i32, i32* %5
%12 = call i32 @worstFit(i32* %8, i32 %9, i32* %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.blockSize = [5 x i32] [i32 100, i32 500, i32 200, i32 300, i32 600]
@__const.main.processSize = [4 x i32] [i32 212, i32 417, i32 112, i32 426]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 @worstFit(i32* %5, i32 5, i32* %6, i32 4)
ret i32 0
}
int countZeros(long n) {
  int count = 0;
  while (n) {
    if (!(n & 1)) {
      count++;
    }
    n = n >> 1;
  }
  return count;
}


x86 assembly (clang, -O0):
<countZeros>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1146 <countZeros+0x46>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    1135 <countZeros+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <countZeros+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countZeros>:
xor    %eax,%eax
test   %rdi,%rdi
je     1125 <countZeros+0x25>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
mov    %edi,%edx
not    %edx
and    $0x1,%edx
add    %edx,%eax
sar    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <countZeros+0x10>
ret

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

LLVM IR (-O2):
define i32 @countZeros(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = phi i64 [ %10, %3 ], [ %0, %1 ]
%6 = trunc i64 %5 to i32
%7 = and i32 %6, 1
%8 = xor i32 %7, 1
%9 = add nuw nsw i32 %8, %4
%10 = ashr i64 %5, 1
%11 = icmp ult i64 %5, 2
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
int main() { kill(1, SIGUSR1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
call   1030 <kill@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@SIGUSR1 = global i32 0
define i32 @main() {
%1 = load i32, i32* @SIGUSR1
%2 = call i32 @kill(i32 1, i32 %1)
ret i32 0
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
define i32 @main() {
%1 = load i32, i32* @SIGUSR1
%2 = tail call i32 @kill(i32 1, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
void fix_display(void) { setenv("DISPLAY", ":0", 1); }


x86 assembly (clang, -O0):
<fix_display>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee6(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_display>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <setenv@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"DISPLAY\00"
@.str.1 = [3 x i8] c":0\00"
define void @fix_display() {
%1 = call i32 @setenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"DISPLAY\00"
@.str.1 = [3 x i8] c":0\00"
define void @fix_display() {
%1 = tail call i32 @setenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ theFunc___0(int /*<<< orphan*/);
int main() {
  theFunc___0(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @theFunc___0(i32 0)
ret i32 0
}
void uDMAIntClear(unsigned long ulChanMask) {
  ;
  ;
  ;
  ;
  (*((volatile unsigned long *)(0x400FF504))) = ulChanMask;
}


x86 assembly (clang, -O0):
<uDMAIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400ff504,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAIntClear>:
mov    %rdi,0x400ff504
40
ret

LLVM IR (-O0):
define void @uDMAIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074787588 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAIntClear(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074787588 to i64*)
ret void
}
char *reiserfs_get_version_string(void) { return "ReiserFS version 3.5.18"; }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"ReiserFS version 3.5.18\00"
define i8* @reiserfs_get_version_string() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [24 x i8] c"ReiserFS version 3.5.18\00"
define i8* @reiserfs_get_version_string() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() { fprintf(stderr, "Usage:\n\thttpd <port>\n"); }


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Usage:\0A\09httpd <port>\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Usage:\0A\09httpd <port>\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
float mat2_determinant(float *dst) { return dst[0] * dst[3] - dst[2] * dst[1]; }


x86 assembly (clang, -O0):
<mat2_determinant>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat2_determinant>:
movss  0x4(%rdi),%xmm1
mulss  0x8(%rdi),%xmm1
movss  (%rdi),%xmm0
mulss  0xc(%rdi),%xmm0
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @mat2_determinant(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 3
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 2
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = fneg float %15
%17 = call float @llvm.fmuladd.f32(float %5, float %8, float %16)
ret float %17
}

LLVM IR (-O2):
define float @mat2_determinant(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 3
%4 = load float, float* %3
%5 = getelementptr inbounds float, float* %0, i64 2
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = fneg float %6
%10 = fmul float %8, %9
%11 = tail call float @llvm.fmuladd.f32(float %2, float %4, float %10)
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ read(int, char *, int);
void stub1();
void main() {
  char buf[0x4141];
  read(0x4242, buf, 0x4141);
  ((void (*)())buf)();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4150,%rsp
lea    -0x4150(%rbp),%rsi
mov    $0x4242,%edi
mov    $0x4141,%edx
call   1030 <read@plt>
lea    -0x4150(%rbp),%rcx
mov    $0x0,%al
call   *%rcx
add    $0x4150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x4150,%rsp
mov    %rsp,%rbx
mov    $0x4242,%edi
mov    %rbx,%rsi
mov    $0x4141,%edx
call   1030 <read@plt>
xor    %eax,%eax
call   *%rbx
add    $0x4150,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca [16705 x i8]
%2 = getelementptr inbounds [16705 x i8], [16705 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 16962, i8* %2, i32 16705)
%4 = getelementptr inbounds [16705 x i8], [16705 x i8]* %1, i64 0, i64 0
%5 = bitcast i8* %4 to void (...)*
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca [16705 x i8]
%2 = getelementptr inbounds [16705 x i8], [16705 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 16962, i8* %2, i32 16705)
%4 = bitcast [16705 x i8]* %1 to void (...)*
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t h265nal_get_layerid(const uint8_t *p_h265nal) {
  return ((p_h265nal[3] & 0x1) << 5) | ((p_h265nal[4] & 0xf8) >> 3);
}


x86 assembly (clang, -O0):
<h265nal_get_layerid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0x1,%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%ecx
and    $0xf8,%ecx
sar    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265nal_get_layerid>:
mov    0xc(%rdi),%ecx
mov    0x10(%rdi),%eax
shl    $0x5,%ecx
and    $0x20,%ecx
shr    $0x3,%eax
and    $0x1f,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @h265nal_get_layerid(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = shl i32 %3, 5
%5 = and i32 %4, 32
%6 = getelementptr inbounds i32, i32* %0, i64 4
%7 = load i32, i32* %6
%8 = lshr i32 %7, 3
%9 = and i32 %8, 31
%10 = or i32 %9, %5
ret i32 %10
}
int ld_bun_rc2(long double a1) { return !(__builtin_isunordered(a1, 100)); }


x86 assembly (clang, -O0):
<ld_bun_rc2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fucomip %st(0),%st
setp   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bun_rc2>:
fldt   0x8(%rsp)
xor    %eax,%eax
fucomip %st(0),%st
setnp  %al
ret

LLVM IR (-O0):
define i32 @ld_bun_rc2(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp uno x86_fp80 %3, 0xK4005C800000000000000
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ld_bun_rc2(x86_fp80 %0) {
%2 = fcmp ord x86_fp80 %0, 0xK00000000000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ MapErrorWindow(char *);
int /*<<< orphan*/ PrintErrorMessage(char *);
void Warning(char *msg) {
  MapErrorWindow("W A R N I N G");
  (void)PrintErrorMessage(msg);
}


x86 assembly (clang, -O0):
<Warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <MapErrorWindow@plt>
mov    -0x8(%rbp),%rdi
call   1040 <PrintErrorMessage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Warning>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <MapErrorWindow@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <PrintErrorMessage@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"W A R N I N G\00"
define void @Warning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @MapErrorWindow(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @PrintErrorMessage(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"W A R N I N G\00"
define void @Warning(i8* %0) {
%2 = tail call i32 @MapErrorWindow(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @PrintErrorMessage(i8* %0)
ret void
}