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

/* Variables and functions */
int32_t crop_i32(int32_t val, int32_t min, int32_t max) {
  if (val < min)
    return min;
  if (val > max)
    return max;
  return val;
}


x86 assembly (clang, -O0):
<crop_i32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    112b <crop_i32+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <crop_i32+0x4e>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1146 <crop_i32+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <crop_i32+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crop_i32>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @crop_i32(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_display {
  int dummy;
};

/* Variables and functions */
void *wl_proxy_get_user_data(struct wl_proxy *);
void *wl_display_get_user_data(struct wl_display *wl_display) {
  return wl_proxy_get_user_data((struct wl_proxy *)wl_display);
}


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

x86 assembly (clang, -O2):
<wl_display_get_user_data>:
jmp    1030 <wl_proxy_get_user_data@plt>

LLVM IR (-O0):
%struct.wl_display = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_display_get_user_data(%struct.wl_display* %0) {
%2 = alloca %struct.wl_display*
store %struct.wl_display* %0, %struct.wl_display** %2
%3 = load %struct.wl_display*, %struct.wl_display** %2
%4 = bitcast %struct.wl_display* %3 to %struct.wl_proxy*
%5 = call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.wl_display = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_display_get_user_data(%struct.wl_display* %0) {
%2 = bitcast %struct.wl_display* %0 to %struct.wl_proxy*
%3 = tail call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %2)
ret i8* %3
}
/* Variables and functions */
scalar_t__ strcasecmp(char *, char const *);
int is_valid_cgi_pattern(const char *cgi) {
  return strcasecmp("cgi", cgi) == 0 || strcasecmp("php", cgi) == 0;
}


x86 assembly (clang, -O0):
<is_valid_cgi_pattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <strcasecmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1158 <is_valid_cgi_pattern+0x48>
mov    -0x8(%rbp),%rsi
lea    0xebb(%rip),%rdi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_cgi_pattern>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1144 <is_valid_cgi_pattern+0x34>
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <strcasecmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cgi\00"
@.str.1 = [4 x i8] c"php\00"
define i32 @is_valid_cgi_pattern(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = icmp eq i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"cgi\00"
@.str.1 = [4 x i8] c"php\00"
define i32 @is_valid_cgi_pattern(i8* nocapture %0) {
%2 = tail call i64 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcasecmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
long long read(int, void *, long long);
int minipmi_read(int fd, void *buf, long long count) {
  long long i;
  while (count > 0) {
    i = read(fd, buf, count);
    buf = (void *)(((char *)buf) + count);
    count = count - i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<minipmi_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jle    115f <minipmi_read+0x4f>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1123 <minipmi_read+0x13>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipmi_read>:
push   %rbp
push   %r14
push   %rbx
test   %rdx,%rdx
jle    1145 <minipmi_read+0x35>
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <read@plt>
add    %rbx,%r14
sub    %rax,%rbx
jg     1130 <minipmi_read+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @minipmi_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = icmp sgt i64 %2, 0
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i8* [ %9, %5 ], [ %1, %3 ]
%7 = phi i64 [ %10, %5 ], [ %2, %3 ]
%8 = tail call i64 @read(i32 %0, i8* %6, i64 %7)
%9 = getelementptr inbounds i8, i8* %6, i64 %7
%10 = sub nsw i64 %7, %8
%11 = icmp sgt i64 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %5, %3
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
double const longBitsToDouble(int);
__attribute__((always_)) const double pow2i(int q) {
  return longBitsToDouble(((int64_t)(q + 0x3ff)) << 52);
}


x86 assembly (clang, -O0):
<pow2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x3ff,%edi
mov    $0x34,%ecx
shl    %cl,%edi
call   1030 <longBitsToDouble@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2i>:
jmp    1030 <longBitsToDouble@plt>

LLVM IR (-O0):
define double @pow2i(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1023
%5 = shl i32 %4, 52
%6 = call double @longBitsToDouble(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @pow2i(i32 %0) {
%2 = tail call double @longBitsToDouble(i32 poison)
ret double %2
}
/* Type definitions */
struct cec_msg {
  int /*<<< orphan*/ *msg;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
void cec_ops_deck_control(const struct cec_msg *msg, __u8 *deck_control_mode) {
  *deck_control_mode = msg->msg[2];
}


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

x86 assembly (clang, -O2):
<cec_ops_deck_control>:
mov    (%rdi),%rax
mov    0x8(%rax),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
%struct.cec_msg = type { i32* }
define void @cec_ops_deck_control(%struct.cec_msg* %0, i32* %1) {
%3 = alloca %struct.cec_msg*
%4 = alloca i32*
store %struct.cec_msg* %0, %struct.cec_msg** %3
store i32* %1, i32** %4
%5 = load %struct.cec_msg*, %struct.cec_msg** %3
%6 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %5, i32 0, i32 0
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
%struct.cec_msg = type { i32* }
define void @cec_ops_deck_control(%struct.cec_msg* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds %struct.cec_msg, %struct.cec_msg* %0, i64 0, i32 0
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
store i32 %6, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(int /*<<< orphan*/, int);
void ft_putstr_fd(char const *s, int fd) {
  while (*s)
    ft_putchar_fd(*s++, fd);
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <ft_putstr_fd+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    -0xc(%rbp),%esi
call   1030 <ft_putchar_fd@plt>
jmp    111f <ft_putstr_fd+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <ft_putstr_fd+0x35>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <ft_putchar_fd@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr_fd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @ft_putchar_fd(i32 %9, i32 %1)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
void kasan_free_pages(struct page *page, unsigned int order) {}


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

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

LLVM IR (-O0):
%struct.page = type opaque
define void @kasan_free_pages(%struct.page* %0, i32 %1) {
%3 = alloca %struct.page*
%4 = alloca i32
store %struct.page* %0, %struct.page** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.page = type opaque
define void @kasan_free_pages(%struct.page* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
usage() {
  (void)fprintf(stderr, "usage:\t%s\n\t%s\n\t%s\n",
                "pathname [-n] variable ...", "pathname [-n] -a",
                "pathname [-n] -A");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xed8(%rip),%rdx
lea    0xeec(%rip),%rcx
lea    0xef6(%rip),%r8
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xedb(%rip),%rdx
lea    0xeef(%rip),%rcx
lea    0xef9(%rip),%r8
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"usage:\09%s\0A\09%s\0A\09%s\0A\00"
@.str.1 = [27 x i8] c"pathname [-n] variable ...\00"
@.str.2 = [17 x i8] c"pathname [-n] -a\00"
@.str.3 = [17 x i8] c"pathname [-n] -A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"usage:\09%s\0A\09%s\0A\09%s\0A\00"
@.str.1 = [27 x i8] c"pathname [-n] variable ...\00"
@.str.2 = [17 x i8] c"pathname [-n] -a\00"
@.str.3 = [17 x i8] c"pathname [-n] -A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int ft_isalpha(int c) {
  if (c <= 0132 && c >= 0101)
    return (1);
  else if (c <= 0172 && c >= 0141)
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <ft_isalpha+0x27>
cmpl   $0x41,-0x8(%rbp)
jl     1127 <ft_isalpha+0x27>
movl   $0x1,-0x4(%rbp)
jmp    114e <ft_isalpha+0x4e>
cmpl   $0x7a,-0x8(%rbp)
jg     1147 <ft_isalpha+0x47>
cmpl   $0x61,-0x8(%rbp)
jl     1147 <ft_isalpha+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <ft_isalpha+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isalpha(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 90
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %18
10: ; preds = %6, %1
%11 = load i32, i32* %3
%12 = icmp sle i32 %11, 122
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 97
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %2
br label %18
17: ; preds = %13, %10
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned char EEPROM_read(int addr) {}


x86 assembly (clang, -O0):
<EEPROM_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @EEPROM_read(i32 %0) {
ret i8 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
void GetDateTime1(time_t sec) {
  printf("GetDateTime1:\t");
  printf("%s", ctime(&sec));
}


x86 assembly (clang, -O0):
<GetDateTime1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDateTime1>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
lea    0xecb(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"GetDateTime1:\09\00"
@.str.1 = [3 x i8] c"%s\00"
define void @GetDateTime1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i8* @ctime(i32* %2)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"GetDateTime1:\09\00"
@.str.1 = [3 x i8] c"%s\00"
define void @GetDateTime1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i8* @ctime(i32* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int S_IRGRP;
int main(void) { return S_IRGRP; }


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

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@S_IRGRP = global i32 0
define i32 @main() {
%1 = load i32, i32* @S_IRGRP
ret i32 %1
}
/* Type definitions */
struct l_class_OC_Subsmall_X {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _ZN10Subsmall_XD2Ev(struct l_class_OC_Subsmall_X *);
void _ZN10Subsmall_XD1Ev(struct l_class_OC_Subsmall_X *llvm_cbe_this) {
  struct l_class_OC_Subsmall_X *llvm_cbe_this_2e_addr;
  struct l_class_OC_Subsmall_X *llvm_cbe_this1;
  *(&llvm_cbe_this_2e_addr) = llvm_cbe_this;
  llvm_cbe_this1 = *(&llvm_cbe_this_2e_addr);
  _ZN10Subsmall_XD2Ev(llvm_cbe_this1);
  return;
}


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

x86 assembly (clang, -O2):
<_ZN10Subsmall_XD1Ev>:
jmp    1030 <_ZN10Subsmall_XD2Ev@plt>

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

LLVM IR (-O2):
%struct.l_class_OC_Subsmall_X = type { i32 }
define void @_ZN10Subsmall_XD1Ev(%struct.l_class_OC_Subsmall_X* %0) {
%2 = tail call i32 @_ZN10Subsmall_XD2Ev(%struct.l_class_OC_Subsmall_X* %0)
ret void
}
void handle_37(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_37(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ waitForInput();
void storeUserInteger(int *integer) {
  scanf("%i", integer);
  waitForInput();
  return;
}


x86 assembly (clang, -O0):
<storeUserInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <scanf@plt>
mov    $0x0,%al
call   1030 <waitForInput@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<storeUserInteger>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <scanf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <waitForInput@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define void @storeUserInteger(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = call i32 (...) @waitForInput()
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define void @storeUserInteger(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = tail call i32 (...) @waitForInput()
ret void
}
/* Type definitions */
struct sbuf {
  int dummy;
};

/* Variables and functions */
int lbuffer_write(int /*<<< orphan*/ *, int, struct sbuf *, int *);
int buffer_write(int fd, struct sbuf *buf, int *buferr) {
  return lbuffer_write(NULL, fd, buf, buferr);
}


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

x86 assembly (clang, -O2):
<buffer_write>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <lbuffer_write@plt>

LLVM IR (-O0):
%struct.sbuf = type { i32 }
define i32 @buffer_write(i32 %0, %struct.sbuf* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sbuf*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sbuf* %1, %struct.sbuf** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load %struct.sbuf*, %struct.sbuf** %5
%9 = load i32*, i32** %6
%10 = call i32 @lbuffer_write(i32* null, i32 %7, %struct.sbuf* %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.sbuf = type { i32 }
define i32 @buffer_write(i32 %0, %struct.sbuf* %1, i32* %2) {
%4 = tail call i32 @lbuffer_write(i32* null, i32 %0, %struct.sbuf* %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
char gcharplus(char x, char y) {
  x += y;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<gcharplus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%ecx
movsbl -0x1(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
jne    1144 <gcharplus+0x34>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcharplus>:
push   %rbx
mov    %esi,%ebx
add    %dil,%bl
jne    111f <gcharplus+0xf>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @gcharplus(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = add nsw i32 %8, %6
%10 = trunc i32 %9 to i8
store i8 %10, i8* %3
%11 = load i8, i8* %3
%12 = icmp ne i8 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = call i32 @foo(i8* null)
br label %15
15: ; preds = %13, %2
%16 = load i8, i8* %3
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @gcharplus(i8 signext %0, i8 signext %1) {
%3 = add i8 %1, %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i8 %3
}
int isOp(char c) { return c == '+' || c == '-' || c == '/' || c == '*'; }


x86 assembly (clang, -O0):
<isOp>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x2(%rbp)
je     114d <isOp+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     114d <isOp+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x2(%rbp)
je     114d <isOp+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x2a,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOp>:
cmp    $0x2f,%dil
ja     1120 <isOp+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0xa80000000000,%rdx
bt     %rcx,%rdx
jae    1120 <isOp+0x20>
ret
xor    %eax,%eax
cmp    $0x2a,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isOp(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 43
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 47
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 42
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isOp(i8 signext %0) {
switch i8 %0, label %2 [
i8 47, label %5
i8 45, label %5
i8 43, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 42
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int creat(char *, int);
int /*<<< orphan*/ syssuerr(char *, char *);
int ecreat(char *path, int perms) {
  int fd;
  if (-1 == (fd = creat(path, perms)))
    syssuerr("%s: ecreat: creat failed",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/"
             "trip/iwave/sucore/src/syscalls.c");
  return fd;
}


x86 assembly (clang, -O0):
<ecreat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <creat@plt>
mov    %eax,%ecx
mov    %ecx,-0x10(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1160 <ecreat+0x40>
lea    0xeac(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1030 <syssuerr@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecreat>:
push   %rbx
call   1040 <creat@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1140 <ecreat+0x20>
lea    0xecc(%rip),%rdi
lea    0xede(%rip),%rsi
call   1030 <syssuerr@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"%s: ecreat: creat failed\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c\00"
define i32 @ecreat(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 = load i32, i32* %4
%8 = call i32 @creat(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = icmp eq i32 -1, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @syssuerr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@.str = [25 x i8] c"%s: ecreat: creat failed\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/syscalls.c\00"
define i32 @ecreat(i8* %0, i32 %1) {
%3 = tail call i32 @creat(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @syssuerr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 %3
}
void f(int *x, int *y, int *z) {
  *x = 3;
  if (3 > *x)
    return;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x8(%rbp),%rcx
mov    $0x3,%eax
cmp    (%rcx),%eax
jle    1130 <f+0x30>
jmp    1130 <f+0x30>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movl   $0x3,(%rdi)
ret

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

LLVM IR (-O2):
define void @f(i32* nocapture writeonly %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
store i32 3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BITHLm(int);
void BIT1HLm() { BITHLm(0x02); }


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

x86 assembly (clang, -O2):
<BIT1HLm>:
mov    $0x2,%edi
jmp    1030 <BITHLm@plt>

LLVM IR (-O0):
define void @BIT1HLm() {
%1 = call i32 @BITHLm(i32 2)
ret void
}

LLVM IR (-O2):
define void @BIT1HLm() {
%1 = tail call i32 @BITHLm(i32 2)
ret void
}
void area(int radius, float *ar) { *ar = 3.1414 * radius * radius; }


x86 assembly (clang, -O0):
<area>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xee8(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<area>:
cvtsi2sd %edi,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @area(i32 %0, float* %1) {
%3 = alloca i32
%4 = alloca float*
store i32 %0, i32* %3
store float* %1, float** %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = fmul double 3.141400e+00, %6
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = fmul double %7, %9
%11 = fptrunc double %10 to float
%12 = load float*, float** %4
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @area(i32 %0, float* nocapture writeonly %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, 3.141400e+00
%5 = fmul double %4, %3
%6 = fptrunc double %5 to float
store float %6, float* %1
ret void
}
SP_CASE(imacro, imetamacro_concat) {
  int ij = -123;
  SP_TRUE(ij == -123);
}


x86 assembly (clang, -O0):
<SP_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xffffff85,-0x10(%rbp)
cmpl   $0xffffff85,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <SP_TRUE@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SP_CASE>:
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <SP_TRUE@plt>

LLVM IR (-O0):
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 -123, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, -123
%9 = zext i1 %8 to i32
%10 = call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 1)
ret i32 undef
}
void MSP430ClockM$MSP430ClockInit$initTimerA(void) {
  MSP430ClockM$MSP430ClockInit$default$initTimerA();
}


x86 assembly (clang, -O0):
<MSP430ClockM$MSP430ClockInit$initTimerA>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <MSP430ClockM$MSP430ClockInit$default$initTimerA@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MSP430ClockM$MSP430ClockInit$initTimerA>:
xor    %eax,%eax
jmp    1030 <MSP430ClockM$MSP430ClockInit$default$initTimerA@plt>

LLVM IR (-O0):
define void @"MSP430ClockM$MSP430ClockInit$initTimerA"() {
%1 = call i32 (...) @"MSP430ClockM$MSP430ClockInit$default$initTimerA"()
ret void
}

LLVM IR (-O2):
define void @"MSP430ClockM$MSP430ClockInit$initTimerA"() {
%1 = tail call i32 (...) @"MSP430ClockM$MSP430ClockInit$default$initTimerA"()
ret void
}
extern void __outlc_p(unsigned int value, unsigned short port) {
  __asm__ __volatile__("out"
                       "l"
                       " %"
                       "0,%"
                       ""
                       "1"
                       :
                       : "a"(value), "id"(port));
  __asm__ __volatile__("outb %al,$0x80");
}


x86 assembly (clang, -O0):
<__outlc_p>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x6(%rbp),%dx
out    %eax,(%dx)
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outlc_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %eax,(%dx)
out    %al,$0x80
ret

LLVM IR (-O0):
define void @__outlc_p(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @__outlc_p(i32 %0, i16 zeroext %1) {
tail call void asm sideeffect "outl $0,$1", "{ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0, i16 %1)
tail call void asm sideeffect "outb %al,$$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateRTCSSMatchSet(uint32_t ui32Match, uint32_t ui32Value) {
  ;
  (*((volatile unsigned long *)(0x400FC028))) = ui32Value << 16;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateRTCSSMatchSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
movslq %eax,%rcx
mov    $0x400fc028,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateRTCSSMatchSet>:
shl    $0x10,%esi
movslq %esi,%rax
mov    %rax,0x400fc028
40
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateRTCSSMatchSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = sext i32 %6 to i64
store volatile i64 %7, i64* inttoptr (i64 1074774056 to i64*)
%8 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateRTCSSMatchSet(i32 %0, i32 %1) {
%3 = shl i32 %1, 16
%4 = sext i32 %3 to i64
store volatile i64 %4, i64* inttoptr (i64 1074774056 to i64*)
%5 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
void glutIconifyWindow(void) {}


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

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

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

LLVM IR (-O2):
define void @glutIconifyWindow() {
ret void
}
int test_imm_6Eint64_lowword_reg(long long val) {
  return ((val) & (0x6E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Eint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 110
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void ol_backend_kelvin_tanner_uninit(struct ol_backend_kelvin_s *self) {
  (void)(self);
}


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

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

LLVM IR (-O0):
%struct.ol_backend_kelvin_s = type opaque
define void @ol_backend_kelvin_tanner_uninit(%struct.ol_backend_kelvin_s* %0) {
%2 = alloca %struct.ol_backend_kelvin_s*
store %struct.ol_backend_kelvin_s* %0, %struct.ol_backend_kelvin_s** %2
%3 = load %struct.ol_backend_kelvin_s*, %struct.ol_backend_kelvin_s** %2
ret void
}

LLVM IR (-O2):
%struct.ol_backend_kelvin_s = type opaque
define void @ol_backend_kelvin_tanner_uninit(%struct.ol_backend_kelvin_s* nocapture %0) {
ret void
}
/* Variables and functions */
double M(double, double, double);
double V(double r) { return 0.7366 * M(r, 2.325, 1.919); }


x86 assembly (clang, -O0):
<V>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
movsd  0xede(%rip),%xmm2
call   1030 <M@plt>
movaps %xmm0,%xmm1
movsd  0xebe(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<V>:
push   %rax
movsd  0xee7(%rip),%xmm1
movsd  0xee7(%rip),%xmm2
call   1030 <M@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @V(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @M(double %3, double 2.325000e+00, double 1.919000e+00)
%5 = fmul double 7.366000e-01, %4
ret double %5
}

LLVM IR (-O2):
define double @V(double %0) {
%2 = tail call double @M(double %0, double 2.325000e+00, double 1.919000e+00)
%3 = fmul double %2, 7.366000e-01
ret double %3
}
/* Type definitions */
struct hitArgs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pthread_detach(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
int /*<<< orphan*/ webhit(struct hitArgs *);
void *threadMain(void *targs) {
  struct hitArgs *args = (struct hitArgs *)targs;
  pthread_detach(pthread_self());
  webhit(args);
  return NULL;
}


x86 assembly (clang, -O0):
<threadMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%edi
call   1030 <pthread_detach@plt>
mov    -0x10(%rbp),%rdi
call   1050 <webhit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threadMain>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
mov    %eax,%edi
call   1030 <pthread_detach@plt>
mov    %rbx,%rdi
call   1050 <webhit@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.hitArgs = type { i32 }
define i8* @threadMain(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.hitArgs*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.hitArgs*
store %struct.hitArgs* %5, %struct.hitArgs** %3
%6 = call i32 (...) @pthread_self()
%7 = call i32 @pthread_detach(i32 %6)
%8 = load %struct.hitArgs*, %struct.hitArgs** %3
%9 = call i32 @webhit(%struct.hitArgs* %8)
ret i8* null
}

LLVM IR (-O2):
%struct.hitArgs = type { i32 }
define noalias i8* @threadMain(i8* %0) {
%2 = bitcast i8* %0 to %struct.hitArgs*
%3 = tail call i32 (...) @pthread_self()
%4 = tail call i32 @pthread_detach(i32 %3)
%5 = tail call i32 @webhit(%struct.hitArgs* %2)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ __cpuid_count(unsigned int, unsigned int, unsigned int,
                                 unsigned int, unsigned int, unsigned int);
void getCpuidEx(unsigned int eaxIn, unsigned int ecxIn, unsigned int data[4]) {
  __cpuid_count(eaxIn, ecxIn, data[0], data[1], data[2], data[3]);
}


x86 assembly (clang, -O0):
<getCpuidEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%r8d
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%r9d
call   1030 <__cpuid_count@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCpuidEx>:
mov    (%rdx),%eax
mov    0x4(%rdx),%ecx
mov    0x8(%rdx),%r8d
mov    0xc(%rdx),%r9d
mov    %eax,%edx
jmp    1030 <__cpuid_count@plt>

LLVM IR (-O0):
define void @getCpuidEx(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = load i32*, i32** %6
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = load i32*, i32** %6
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = load i32*, i32** %6
%19 = getelementptr inbounds i32, i32* %18, i64 3
%20 = load i32, i32* %19
%21 = call i32 @__cpuid_count(i32 %7, i32 %8, i32 %11, i32 %14, i32 %17, i32 %20)
ret void
}

LLVM IR (-O2):
define void @getCpuidEx(i32 %0, i32 %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = getelementptr inbounds i32, i32* %2, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %2, i64 2
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %2, i64 3
%10 = load i32, i32* %9
%11 = tail call i32 @__cpuid_count(i32 %0, i32 %1, i32 %4, i32 %6, i32 %8, i32 %10)
ret void
}
void UsageFault_Handler() {
  for (;;)
    ;
}


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

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

LLVM IR (-O0):
define void @UsageFault_Handler() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @UsageFault_Handler() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_73() {
  Assert_real((isqrt(73) == 8),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              370, ("Integer square root of 73 should be 8"));
}


x86 assembly (clang, -O0):
<t_sqrt_73>:
push   %rbp
mov    %rsp,%rbp
mov    $0x49,%edi
call   1030 <isqrt@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x172,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_73>:
push   %rax
mov    $0x49,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x172,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 73 should be 8\00"
define void @t_sqrt_73() {
%1 = call i32 @isqrt(i32 73)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 370, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 73 should be 8\00"
define void @t_sqrt_73() {
%1 = tail call i32 @isqrt(i32 73)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 370, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void U010ToAB30() {}


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

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

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

LLVM IR (-O2):
define void @U010ToAB30() {
ret void
}
unsigned new_label(void) {
  static unsigned label_count = 1;
  return label_count++;
}


x86 assembly (clang, -O0):
<new_label>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0b(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_label>:
mov    0x2f1a(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f11(%rip)
ret

LLVM IR (-O0):
@new_label.label_count = internal global i32 1
define i32 @new_label() {
%1 = load i32, i32* @new_label.label_count
%2 = add i32 %1, 1
store i32 %2, i32* @new_label.label_count
ret i32 %1
}

LLVM IR (-O2):
@new_label.label_count = internal unnamed_addr global i32 1
define i32 @new_label() {
%1 = load i32, i32* @new_label.label_count
%2 = add i32 %1, 1
store i32 %2, i32* @new_label.label_count
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_cmd(void *data) { free(data); }


x86 assembly (clang, -O0):
<free_cmd>:
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):
<free_cmd>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_cmd(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 @free_cmd(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}