xunge/DecIR huggingface dataset:
/* Type definitions */
struct hc {
  int dummy;
};

/* Variables and functions */
unsigned char *hc_read_all_len(struct hc *, int /*<<< orphan*/ *);
unsigned char *hc_read_all(struct hc *hc) { return hc_read_all_len(hc, NULL); }


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

x86 assembly (clang, -O2):
<hc_read_all>:
xor    %esi,%esi
jmp    1030 <hc_read_all_len@plt>

LLVM IR (-O0):
%struct.hc = type { i32 }
define i8* @hc_read_all(%struct.hc* %0) {
%2 = alloca %struct.hc*
store %struct.hc* %0, %struct.hc** %2
%3 = load %struct.hc*, %struct.hc** %2
%4 = call i8* @hc_read_all_len(%struct.hc* %3, i32* null)
ret i8* %4
}

LLVM IR (-O2):
%struct.hc = type { i32 }
define i8* @hc_read_all(%struct.hc* %0) {
%2 = tail call i8* @hc_read_all_len(%struct.hc* %0, i32* null)
ret i8* %2
}
/* Variables and functions */
unsigned char strtol(char *, int /*<<< orphan*/, int);
unsigned char convertBinToByte(char *binary) {
  unsigned char c;
  c = strtol(binary, 0, 2);
  return (c);
}


x86 assembly (clang, -O0):
<convertBinToByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <strtol@plt>
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertBinToByte>:
xor    %esi,%esi
mov    $0x2,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define zeroext i8 @convertBinToByte(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call zeroext i8 @strtol(i8* %4, i32 0, i32 2)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @convertBinToByte(i8* %0) {
%2 = tail call zeroext i8 @strtol(i8* %0, i32 0, i32 2)
ret i8 %2
}
long double longdouble_ignoring_signedshortint(long double x,
                                               signed short int y) {
  return x;
}


x86 assembly (clang, -O0):
<longdouble_ignoring_signedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %ax,-0x12(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<longdouble_ignoring_signedshortint>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @longdouble_ignoring_signedshortint(x86_fp80 %0, i16 signext %1) {
%3 = alloca x86_fp80
%4 = alloca i16
store x86_fp80 %0, x86_fp80* %3
store i16 %1, i16* %4
%5 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @longdouble_ignoring_signedshortint(x86_fp80 returned %0, i16 signext %1) {
ret x86_fp80 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ write(int, char *, int);
void sendResponse(int sockfd, char *response) {
  printf("[Socket Reporter] Enviando: '%s'\n", response);
  write(sockfd, response, 255);
}


x86 assembly (clang, -O0):
<sendResponse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0xff,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendResponse>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0xff,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"[Socket Reporter] Enviando: '%s'\0A\00"
define void @sendResponse(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @write(i32 %7, i8* %8, i32 255)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"[Socket Reporter] Enviando: '%s'\0A\00"
define void @sendResponse(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 255)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ must_fail(char *, int);
void *realloc(void *, int);
void *must_realloc(void *ptr, int size) {
  void *mem = realloc(ptr, size);
  if (!mem)
    must_fail("realloc", size);
  return mem;
}


x86 assembly (clang, -O0):
<must_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1159 <must_realloc+0x39>
mov    -0xc(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <must_fail@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<must_realloc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <must_realloc+0x20>
lea    0xec7(%rip),%rdi
mov    %ebp,%esi
call   1030 <must_fail@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"realloc\00"
define i8* @must_realloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @must_fail(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void vo_unlock(void) {}


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

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

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

LLVM IR (-O2):
define void @vo_unlock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_is_recv_enable(int);
int /*<<< orphan*/ serial_send_byte(int, int);
int xmodem_wait(void) {
  long cnt = 0;
  while (!serial_is_recv_enable(1)) {
    if (++cnt >= 2000000) {
      cnt = 0;
      serial_send_byte(1, 0x15);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<xmodem_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <serial_is_recv_enable@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114f <xmodem_wait+0x2f>
jmp    1183 <xmodem_wait+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x1e8480,%rax
jl     117e <xmodem_wait+0x5e>
movq   $0x0,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x15,%esi
call   1040 <serial_send_byte@plt>
jmp    1130 <xmodem_wait+0x10>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmodem_wait>:
push   %rbx
mov    $0x1,%edi
call   1030 <serial_is_recv_enable@plt>
test   %eax,%eax
je     1133 <xmodem_wait+0x13>
xor    %eax,%eax
pop    %rbx
ret
xor    %ebx,%ebx
jmp    115f <xmodem_wait+0x3f>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    $0x15,%esi
call   1040 <serial_send_byte@plt>
xor    %ebx,%ebx
mov    $0x1,%edi
call   1030 <serial_is_recv_enable@plt>
test   %eax,%eax
jne    112f <xmodem_wait+0xf>
cmp    $0x1e847f,%rbx
jge    1140 <xmodem_wait+0x20>
add    $0x1,%rbx
jmp    1151 <xmodem_wait+0x31>

LLVM IR (-O0):
define i32 @xmodem_wait() {
%1 = alloca i64
store i64 0, i64* %1
br label %2
2: ; preds = %12, %0
%3 = call i32 @serial_is_recv_enable(i32 1)
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = load i64, i64* %1
%8 = add nsw i64 %7, 1
store i64 %8, i64* %1
%9 = icmp sge i64 %8, 2000000
br i1 %9, label %10, label %12
10: ; preds = %6
store i64 0, i64* %1
%11 = call i32 @serial_send_byte(i32 1, i32 21)
br label %12
12: ; preds = %10, %6
br label %2
13: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @xmodem_wait() {
%1 = tail call i32 @serial_is_recv_enable(i32 1)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %13
3: ; preds = %0, %9
%4 = phi i64 [ %10, %9 ], [ 0, %0 ]
%5 = add nsw i64 %4, 1
%6 = icmp sgt i64 %4, 1999998
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @serial_send_byte(i32 1, i32 21)
br label %9
9: ; preds = %7, %3
%10 = phi i64 [ 0, %7 ], [ %5, %3 ]
%11 = tail call i32 @serial_is_recv_enable(i32 1)
%12 = icmp eq i32 %11, 0
br i1 %12, label %3, label %13
13: ; preds = %9, %0
ret i32 0
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t F_dict_fnv32_s(const char *str) {
  register uint32_t hash = 2166136261U;
  while (*str) {
    hash ^= *str++;
    hash *= 16777619U;
  }
  return hash;
}


x86 assembly (clang, -O0):
<F_dict_fnv32_s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x811c9dc5,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1143 <F_dict_fnv32_s+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x1000193,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <F_dict_fnv32_s+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_dict_fnv32_s>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <F_dict_fnv32_s+0x27>
add    $0x1,%rdi
mov    $0x811c9dc5,%eax
nop
movsbl %cl,%ecx
xor    %eax,%ecx
imul   $0x1000193,%ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <F_dict_fnv32_s+0x10>
ret
mov    $0x811c9dc5,%eax
ret

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

LLVM IR (-O2):
define i32 @F_dict_fnv32_s(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ -2128831035, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = xor i32 %6, %9
%11 = mul i32 %10, 16777619
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ -2128831035, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void letThemPeace(void *ptr) {
  if (ptr != NULL)
    free(ptr);
}


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

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

LLVM IR (-O0):
define void @letThemPeace(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 @letThemPeace(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
}
/* Type definitions */
struct esp_rest {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ esp_rest_request(struct esp_rest *, char const *, char *,
                                    char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void esp_rest_del(struct esp_rest *er, const char *path, const char *data) {
  esp_rest_request(er, path, "DELETE", data, strlen(data));
}


x86 assembly (clang, -O0):
<esp_rest_del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    %eax,%r8d
lea    0xe95(%rip),%rdx
call   1030 <esp_rest_request@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esp_rest_del>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rdx,%rdi
call   1040 <strlen@plt>
lea    0xec3(%rip),%rdx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rcx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <esp_rest_request@plt>

LLVM IR (-O0):
%struct.esp_rest = type { i32 }
@.str = [7 x i8] c"DELETE\00"
define void @esp_rest_del(%struct.esp_rest* %0, i8* %1, i8* %2) {
%4 = alloca %struct.esp_rest*
%5 = alloca i8*
%6 = alloca i8*
store %struct.esp_rest* %0, %struct.esp_rest** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.esp_rest*, %struct.esp_rest** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = load i8*, i8** %6
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @esp_rest_request(%struct.esp_rest* %7, i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.esp_rest = type { i32 }
@.str = [7 x i8] c"DELETE\00"
define void @esp_rest_del(%struct.esp_rest* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %2)
%5 = tail call i32 @esp_rest_request(%struct.esp_rest* %0, i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_help() {
  printf("usage: parse_dump [dumpfile]\r\n");
  printf("example: ./parse_dump ramdump\r\n");
}


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

x86 assembly (clang, -O2):
<show_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"usage: parse_dump [dumpfile]\0D\0A\00"
@.str.1 = [32 x i8] c"example: ./parse_dump ramdump\0D\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"usage: parse_dump [dumpfile]\0D\00"
@str.2 = [31 x i8] c"example: ./parse_dump ramdump\0D\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
double sinc(double);
double lanzcos(double index) { return sinc(index); }


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

x86 assembly (clang, -O2):
<lanzcos>:
jmp    1030 <sinc@plt>

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

LLVM IR (-O2):
define double @lanzcos(double %0) {
%2 = tail call double @sinc(double %0)
ret double %2
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int);
int sre_toupper(int c) {
  if (islower(c))
    return toupper(c);
  else
    return c;
}


x86 assembly (clang, -O0):
<sre_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     114d <sre_toupper+0x2d>
mov    -0x8(%rbp),%edi
call   1040 <toupper@plt>
mov    %eax,-0x4(%rbp)
jmp    1153 <sre_toupper+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sre_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
test   %rax,%rax
je     1135 <sre_toupper+0x15>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <toupper@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sre_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @islower(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @toupper(i32 %8)
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @sre_toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @toupper(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void print_total(const int total) { printf("Your Total: %d\n\n", total); }


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"Your Total: %d\0A\0A\00"
define void @print_total(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void set_PDSlevel(unsigned char *pds, int type, int value) {
  pds[9] = type;
  pds[10] = (value >> 8) & 255;
  pds[11] = value & 255;
}


x86 assembly (clang, -O0):
<set_PDSlevel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x9(%rax)
mov    -0x10(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xa(%rax)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0xb(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_PDSlevel>:
mov    %sil,0x9(%rdi)
mov    %dh,0xa(%rdi)
mov    %dl,0xb(%rdi)
ret

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

LLVM IR (-O2):
define void @set_PDSlevel(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = trunc i32 %1 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 9
store i8 %4, i8* %5
%6 = lshr i32 %2, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 10
store i8 %7, i8* %8
%9 = trunc i32 %2 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 11
store i8 %9, i8* %10
ret void
}
/* Variables and functions */
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int accept_socket(int socket) { return accept(socket, NULL, NULL); }


x86 assembly (clang, -O0):
<accept_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <accept@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_socket>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <accept@plt>

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

LLVM IR (-O2):
define i32 @accept_socket(i32 %0) {
%2 = tail call i32 @accept(i32 %0, i32* null, i32* null)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void colorBlu() { printf("%s", "\x1B[34m"); }


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

x86 assembly (clang, -O2):
<colorBlu>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"\1B[34m\00"
define void @colorBlu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"\1B[34m\00"
define void @colorBlu() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *calloc(unsigned int, unsigned int);
void *zalloc(void *opaque, unsigned int items, unsigned int size) {
  return calloc(items, size);
}


x86 assembly (clang, -O0):
<zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <calloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zalloc>:
mov    %esi,%edi
mov    %edx,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @zalloc(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* %5
%8 = load i32, i32* %6
%9 = call i8* @calloc(i32 %7, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @zalloc(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i8* @calloc(i32 %1, i32 %2)
ret i8* %4
}
void should_not_give_error(char *const w) { w[0] = 'a'; }


x86 assembly (clang, -O0):
<should_not_give_error>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<should_not_give_error>:
movb   $0x61,(%rdi)
ret

LLVM IR (-O0):
define void @should_not_give_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 97, i8* %4
ret void
}

LLVM IR (-O2):
define void @should_not_give_error(i8* nocapture writeonly %0) {
store i8 97, i8* %0
ret void
}
int test_imm_7Euint8_reg(unsigned char val) {
  return ((val) & (0x7E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Euint8_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, 126
%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_7Euint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 126
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int /*<<< orphan*/ printf(char *, int const);
int main(int argc, char *argv[]) {
  const int limit = 10;
  int i = 8;
  const int *limitp = &limit;
  int *p = &i;
  char **str;
  const char **cstr;
  limitp = p;
  limitp = &i;
  int a = 10;
  const int ca = a;
  a = ca;
  foo(a);
  const int *const cpc = &limit;
  printf("const int * const cpc = %d", *cpc);
  int *const *pcp;
  int **const cpp;
  int *const cp = &i;
  pcp = &cp;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0x8,-0x18(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0xa,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%edi
call   1040 <foo@plt>
lea    -0x14(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%esi
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
lea    -0x18(%rbp),%rax
mov    %rax,-0x60(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0x50(%rbp)
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"const int * const cpc = %d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8**
%11 = alloca i8**
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32**
%16 = alloca i32**
%17 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
store i32 8, i32* %7
store i32* %6, i32** %8
store i32* %7, i32** %9
%18 = load i32*, i32** %9
store i32* %18, i32** %8
store i32* %7, i32** %8
store i32 10, i32* %12
%19 = load i32, i32* %12
store i32 %19, i32* %13
%20 = load i32, i32* %13
store i32 %20, i32* %12
%21 = load i32, i32* %12
%22 = call i32 @foo(i32 %21)
store i32* %6, i32** %14
%23 = load i32*, i32** %14
%24 = load i32, i32* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %24)
store i32* %7, i32** %17
store i32** %17, i32*** %15
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"const int * const cpc = %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
void Rename_SRT_ASC_NSEQ(ii, jj) int ii, jj;
{
  int i, j;
  i = ii;
  while (i < jj) {
    Rename_MIN_IDX_NSEQ(&j, i, jj);
    Rename_SWP_NSEQ(i, j);
    i = i + 1;
  };
}


x86 assembly (clang, -O0):
<Rename_SRT_ASC_NSEQ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116c <Rename_SRT_ASC_NSEQ+0x4c>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <Rename_MIN_IDX_NSEQ@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   1030 <Rename_SWP_NSEQ@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <Rename_SRT_ASC_NSEQ+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rename_SRT_ASC_NSEQ>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
cmp    %esi,%edi
jge    1162 <Rename_SRT_ASC_NSEQ+0x42>
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xc(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <Rename_MIN_IDX_NSEQ@plt>
mov    0xc(%rsp),%esi
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <Rename_SWP_NSEQ@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1140 <Rename_SRT_ASC_NSEQ+0x20>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Rename_SRT_ASC_NSEQ(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp slt i32 %0, %1
br i1 %5, label %6, label %13
6: ; preds = %2, %6
%7 = phi i32 [ %11, %6 ], [ %0, %2 ]
%8 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @Rename_MIN_IDX_NSEQ to i32 (i32*, i32, i32, ...)*)(i32* %3, i32 %7, i32 %1)
%9 = load i32, i32* %3
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @Rename_SWP_NSEQ to i32 (i32, i32, ...)*)(i32 %7, i32 %9)
%11 = add i32 %7, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
scalar_t__ memcpy(void *, char const *, size_t);
int strlen(char const *);
void *xmalloc(size_t);
char *__attribute__((__malloc__)) xstrdup(const char *str) {
  size_t size = strlen(str) + 1;
  void *ptr = xmalloc(size);
  return (char *)memcpy(ptr, str, size);
}


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

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

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

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @xmalloc(i64 %4)
%6 = tail call i64 @memcpy(i8* %5, i8* %0, i64 %4)
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
void b_file_delete(unsigned char *name) {
  asm volatile("call 0x001001A0" : : "S"(name));
}


x86 assembly (clang, -O0):
<b_file_delete>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
call   1001a0 <completed.0+0xfc180>
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_file_delete>:
mov    %rdi,%rsi
call   1001a0 <completed.0+0xfc180>
ret

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

LLVM IR (-O2):
define void @b_file_delete(i8* %0) {
tail call void asm sideeffect "call 0x001001A0", "{si},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Variables and functions */
void win_get_exe_file(const char *argv0, char *p, size_t p_len) {}


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

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

LLVM IR (-O0):
define void @win_get_exe_file(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @win_get_exe_file(i8* nocapture %0, i8* nocapture %1, i64 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
char *read_int32(char *buf, int32_t *val) {
  int32_t tmp = ntohl(*((int32_t *)buf));
  memcpy(val, &tmp, 4);
  return buf + 4;
}


x86 assembly (clang, -O0):
<read_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <ntohl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1040 <ntohl@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @read_int32(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = call i32 @ntohl(i32 %8)
store i32 %9, i32* %5
%10 = load i32*, i32** %4
%11 = call i32 @memcpy(i32* %10, i32* %5, i32 4)
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 4
ret i8* %13
}

LLVM IR (-O2):
define i8* @read_int32(i8* %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @ntohl(i32 %6)
store i32 %7, i32* %3
%8 = call i32 @memcpy(i32* %1, i32* %3, i32 4)
%9 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %9
}
/* Variables and functions */
int sqrt(unsigned int const);
unsigned int estAportee(const unsigned int distanceLig,
                        const unsigned int distanceCol,
                        const unsigned int portee) {
  int distance;
  distance = sqrt(distanceLig * distanceLig + distanceCol * distanceCol);
  return distance <= portee;
}


x86 assembly (clang, -O0):
<estAportee>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
imul   -0x4(%rbp),%edi
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
add    %eax,%edi
call   1030 <sqrt@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estAportee>:
push   %rbx
mov    %edx,%ebx
imul   %edi,%edi
imul   %esi,%esi
add    %esi,%edi
call   1030 <sqrt@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setbe  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @estAportee(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %4
%10 = mul i32 %8, %9
%11 = load i32, i32* %5
%12 = load i32, i32* %5
%13 = mul i32 %11, %12
%14 = add i32 %10, %13
%15 = call i32 @sqrt(i32 %14)
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = load i32, i32* %6
%18 = icmp ule i32 %16, %17
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @estAportee(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %0, %0
%5 = mul i32 %1, %1
%6 = add i32 %5, %4
%7 = tail call i32 @sqrt(i32 %6)
%8 = icmp ule i32 %7, %2
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
struct dirent {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
struct dirent *readdir(int /*<<< orphan*/ *);
struct dirent *ext_readdir(DIR *dir) {
  return readdir(dir);
}


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

x86 assembly (clang, -O2):
<ext_readdir>:
jmp    1030 <readdir@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define %struct.dirent* @ext_readdir(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call %struct.dirent* @readdir(i32* %3)
ret %struct.dirent* %4
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define %struct.dirent* @ext_readdir(i32* %0) {
%2 = tail call %struct.dirent* @readdir(i32* %0)
ret %struct.dirent* %2
}
struct b6_dref *__b6_splay_to_thread(const struct b6_dref *dref) {
  return (struct b6_dref *)((unsigned long int)dref | 1);
}


x86 assembly (clang, -O0):
<__b6_splay_to_thread>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
or     $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__b6_splay_to_thread>:
mov    %rdi,%rax
or     $0x1,%rax
ret

LLVM IR (-O0):
%struct.b6_dref = type opaque
define %struct.b6_dref* @__b6_splay_to_thread(%struct.b6_dref* %0) {
%2 = alloca %struct.b6_dref*
store %struct.b6_dref* %0, %struct.b6_dref** %2
%3 = load %struct.b6_dref*, %struct.b6_dref** %2
%4 = ptrtoint %struct.b6_dref* %3 to i64
%5 = or i64 %4, 1
%6 = inttoptr i64 %5 to %struct.b6_dref*
ret %struct.b6_dref* %6
}

LLVM IR (-O2):
%struct.b6_dref = type opaque
define %struct.b6_dref* @__b6_splay_to_thread(%struct.b6_dref* %0) {
%2 = ptrtoint %struct.b6_dref* %0 to i64
%3 = or i64 %2, 1
%4 = inttoptr i64 %3 to %struct.b6_dref*
ret %struct.b6_dref* %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int hammingWeight(uint32_t n) {
  int ret;
  for (ret = 0; n; (ret += n & 0x01), n >>= 1)
    ;
  return ret;
}


x86 assembly (clang, -O0):
<hammingWeight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1137 <hammingWeight+0x37>
jmp    111d <hammingWeight+0x1d>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <hammingWeight+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hammingWeight>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <hammingWeight+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
sar    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <hammingWeight+0x10>
ret

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

LLVM IR (-O2):
define i32 @hammingWeight(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = ashr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
double SHRT_MAX;
double SHRT_MIN;
short clampToShort(double d) {
  if (d > SHRT_MAX)
    return SHRT_MAX;
  if (d < SHRT_MIN)
    return SHRT_MIN;
  return (short)d;
}


x86 assembly (clang, -O0):
<clampToShort>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    0x2ec3(%rip),%rax
ucomisd (%rax),%xmm0
jbe    1137 <clampToShort+0x37>
mov    0x2eb2(%rip),%rax
movsd  (%rax),%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,-0x2(%rbp)
jmp    1176 <clampToShort+0x76>
movsd  -0x10(%rbp),%xmm1
mov    0x2e9d(%rip),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1169 <clampToShort+0x69>
mov    0x2e88(%rip),%rax
movsd  (%rax),%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,-0x2(%rbp)
jmp    1176 <clampToShort+0x76>
movsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampToShort>:
mov    0x2ed1(%rip),%rax
movsd  (%rax),%xmm1
mov    0x2ece(%rip),%rax
movsd  (%rax),%xmm2
maxsd  %xmm0,%xmm2
movapd %xmm1,%xmm3
cmpltsd %xmm0,%xmm3
movapd %xmm3,%xmm0
andnpd %xmm2,%xmm0
andpd  %xmm1,%xmm3
orpd   %xmm0,%xmm3
cvttsd2si %xmm3,%eax
ret

LLVM IR (-O0):
@SHRT_MAX = global double 0.000000e+00
@SHRT_MIN = global double 0.000000e+00
define signext i16 @clampToShort(double %0) {
%2 = alloca i16
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = load double, double* @SHRT_MAX
%6 = fcmp ogt double %4, %5
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load double, double* @SHRT_MAX
%9 = fptosi double %8 to i16
store i16 %9, i16* %2
br label %20
10: ; preds = %1
%11 = load double, double* %3
%12 = load double, double* @SHRT_MIN
%13 = fcmp olt double %11, %12
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load double, double* @SHRT_MIN
%16 = fptosi double %15 to i16
store i16 %16, i16* %2
br label %20
17: ; preds = %10
%18 = load double, double* %3
%19 = fptosi double %18 to i16
store i16 %19, i16* %2
br label %20
20: ; preds = %17, %14, %7
%21 = load i16, i16* %2
ret i16 %21
}

LLVM IR (-O2):
@SHRT_MAX = global double 0.000000e+00
@SHRT_MIN = global double 0.000000e+00
define signext i16 @clampToShort(double %0) {
%2 = load double, double* @SHRT_MAX
%3 = fcmp olt double %2, %0
%4 = load double, double* @SHRT_MIN
%5 = fcmp ogt double %4, %0
%6 = select i1 %5, double %4, double %0
%7 = select i1 %3, double %2, double %6
%8 = fptosi double %7 to i16
ret i16 %8
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void le_to_u32(uint32_t *dst, uint8_t *src) {
  *dst = (((uint32_t)src[3]) << 24) | (((uint32_t)src[2]) << 16) |
         (((uint32_t)src[1]) << 8) | (uint32_t)src[0];
}


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

x86 assembly (clang, -O2):
<le_to_u32>:
mov    0x18(%rsi),%eax
shl    $0x18,%eax
mov    0x8(%rsi),%ecx
mov    0x10(%rsi),%edx
shl    $0x10,%edx
or     %eax,%edx
shl    $0x8,%ecx
or     %edx,%ecx
or     (%rsi),%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @le_to_u32(i32* %0, i64* %1) {
%3 = alloca i32*
%4 = alloca i64*
store i32* %0, i32** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 3
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 24
%10 = load i64*, i64** %4
%11 = getelementptr inbounds i64, i64* %10, i64 2
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %9, %14
%16 = load i64*, i64** %4
%17 = getelementptr inbounds i64, i64* %16, i64 1
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = shl i32 %19, 8
%21 = or i32 %15, %20
%22 = load i64*, i64** %4
%23 = getelementptr inbounds i64, i64* %22, i64 0
%24 = load i64, i64* %23
%25 = trunc i64 %24 to i32
%26 = or i32 %21, %25
%27 = load i32*, i32** %3
store i32 %26, i32* %27
ret void
}

LLVM IR (-O2):
define void @le_to_u32(i32* nocapture writeonly %0, i64* nocapture %1) {
%3 = getelementptr inbounds i64, i64* %1, i64 3
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = shl i32 %5, 24
%7 = getelementptr inbounds i64, i64* %1, i64 2
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 16
%11 = or i32 %10, %6
%12 = getelementptr inbounds i64, i64* %1, i64 1
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i64, i64* %1
%18 = trunc i64 %17 to i32
%19 = or i32 %16, %18
store i32 %19, i32* %0
ret void
}
const char *Concat_Description(void) {
  return "The `Concat` class is implemented by objects that can have other "
         "objects "
         "either _appended_ to their, on _concatenated_ to them. For example "
         "collections or strings.";
}


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

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

LLVM IR (-O0):
@.str = [164 x i8] c"The `Concat` class is implemented by objects that can have other objects either _appended_ to their, on _concatenated_ to them. For example collections or strings.\00"
define i8* @Concat_Description() {
ret i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [164 x i8] c"The `Concat` class is implemented by objects that can have other objects either _appended_ to their, on _concatenated_ to them. For example collections or strings.\00"
define i8* @Concat_Description() {
ret i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ readnext(int);
void op_rdnxint() { readnext(3); }


x86 assembly (clang, -O0):
<op_rdnxint>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <readnext@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_rdnxint>:
mov    $0x3,%edi
jmp    1030 <readnext@plt>

LLVM IR (-O0):
define void @op_rdnxint() {
%1 = call i32 @readnext(i32 3)
ret void
}

LLVM IR (-O2):
define void @op_rdnxint() {
%1 = tail call i32 @readnext(i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void deallocate(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<deallocate>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @deallocate(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int level2(int, int);
__attribute__((no)) int level1(int a, int b) { return level2(a / b, a % b); }


x86 assembly (clang, -O0):
<level1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edi
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%esi
call   1030 <level2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<level1>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%edi
mov    %edx,%esi
jmp    1030 <level2@plt>

LLVM IR (-O0):
define i32 @level1(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 = sdiv i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
%11 = call i32 @level2(i32 %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @level1(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = srem i32 %0, %1
%5 = tail call i32 @level2(i32 %3, i32 %4)
ret i32 %5
}