xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ cgi_error(char *, size_t, size_t);
int /*<<< orphan*/ exit(int);
void *cgi_malloc(size_t cnt, size_t size) {
  void *buf = calloc(cnt, size);
  if (buf == NULL) {
    cgi_error("calloc failed for %d values of size %d", cnt, size);
    exit(1);
  }
  return buf;
}


x86 assembly (clang, -O0):
<cgi_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117a <cgi_malloc+0x4a>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe95(%rip),%rdi
call   1030 <cgi_error@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgi_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <calloc@plt>
test   %rax,%rax
je     114c <cgi_malloc+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <cgi_error@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"calloc failed for %d values of size %d\00"
define i8* @cgi_malloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = call i32 @cgi_error(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %12, i64 %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [39 x i8] c"calloc failed for %d values of size %d\00"
define noalias i8* @cgi_malloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @cgi_error(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage(char const *);
int badusage(const char *exename) {
  fprintf(stderr, "Wrong parameters\n");
  usage(exename);
  return 1;
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <usage@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badusage>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <usage@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Wrong parameters\0A\00"
define i32 @badusage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @usage(i8* %5)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Wrong parameters\0A\00"
define i32 @badusage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @usage(i8* %0)
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
struct TYPE_4__ {
  TYPE_1__ xselectionrequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xselectionrequest_type(void *_p, int _v) {
  ((XEvent *)_p)->xselectionrequest.type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xselectionrequest_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xselectionrequest_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xselectionrequest_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
int new_command(int i, char *cmd) {
  ft_putstr("\033[1;35m");
  ft_putchar(cmd[i]);
  ft_putstr("\033[0m");
  return (0);
}


x86 assembly (clang, -O0):
<new_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <ft_putstr@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
lea    0xeb5(%rip),%rdi
call   1040 <ft_putstr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_command>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
call   1040 <ft_putstr@plt>
movslq %ebp,%rax
movsbl (%rbx,%rax,1),%edi
call   1030 <ft_putchar@plt>
lea    0xec1(%rip),%rdi
call   1040 <ft_putstr@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[1;35m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define i32 @new_command(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @ft_putstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %4
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = call i32 @ft_putchar(i8 signext %10)
%12 = call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[1;35m\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define i32 @new_command(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @ft_putchar(i8 signext %6)
%8 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct epoll_event {
  int dummy;
};
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int syscall(int, int, struct epoll_event *, int, int,
            int /*<<< orphan*/ const *, int);
int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to,
                const sigset_t *sigs) {
  return syscall(346, fd, ev, cnt, to, sigs, 8);
}


x86 assembly (clang, -O0):
<epoll_pwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x20(%rbp),%r9
mov    $0x15a,%edi
movl   $0x8,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoll_pwait>:
push   %rax
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
movl   $0x8,(%rsp)
mov    $0x15a,%edi
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
define i32 @epoll_pwait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca %struct.epoll_event*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
store i32 %0, i32* %6
store %struct.epoll_event* %1, %struct.epoll_event** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load %struct.epoll_event*, %struct.epoll_event** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32*, i32** %10
%16 = call i32 @syscall(i32 346, i32 %11, %struct.epoll_event* %12, i32 %13, i32 %14, i32* %15, i32 8)
ret i32 %16
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
define i32 @epoll_pwait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3, i32* %4) {
%6 = tail call i32 @syscall(i32 346, i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3, i32* %4, i32 8)
ret i32 %6
}
int test_imm_C6int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xC6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C6int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 12976128
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ I2CAL_output_clock(int);
int /*<<< orphan*/ I2CAL_output_data(int);
void SendI2CStop(void) {
  I2CAL_output_data(0);
  I2CAL_output_clock(1);
  I2CAL_output_data(1);
}


x86 assembly (clang, -O0):
<SendI2CStop>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <I2CAL_output_data@plt>
mov    $0x1,%edi
call   1040 <I2CAL_output_clock@plt>
mov    $0x1,%edi
call   1030 <I2CAL_output_data@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SendI2CStop>:
push   %rax
xor    %edi,%edi
call   1030 <I2CAL_output_data@plt>
mov    $0x1,%edi
call   1040 <I2CAL_output_clock@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <I2CAL_output_data@plt>

LLVM IR (-O0):
define void @SendI2CStop() {
%1 = call i32 @I2CAL_output_data(i32 0)
%2 = call i32 @I2CAL_output_clock(i32 1)
%3 = call i32 @I2CAL_output_data(i32 1)
ret void
}

LLVM IR (-O2):
define void @SendI2CStop() {
%1 = tail call i32 @I2CAL_output_data(i32 0)
%2 = tail call i32 @I2CAL_output_clock(i32 1)
%3 = tail call i32 @I2CAL_output_data(i32 1)
ret void
}
/* Variables and functions */
float expf(float);
__attribute__((__weak__, __always___)) float softboundcets_expf(float x) {
  return expf(x);
}


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

x86 assembly (clang, -O2):
<softboundcets_expf>:
jmp    1030 <expf@plt>

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

LLVM IR (-O2):
define weak float @softboundcets_expf(float %0) {
%2 = tail call float @expf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ errnoThrow(int);
unsigned int fflush(int /*<<< orphan*/);
unsigned int putchar(unsigned int);
int /*<<< orphan*/ stdout;
void Sys_PutChar(unsigned c) {
  unsigned ret;
  ret = putchar(c);
  errnoThrow(ret != c);
  ret = fflush(stdout);
  errnoThrow(ret != 0);
}


x86 assembly (clang, -O0):
<Sys_PutChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <errnoThrow@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <errnoThrow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sys_PutChar>:
push   %rbx
mov    %edi,%ebx
call   1030 <putchar@plt>
xor    %edi,%edi
cmp    %ebx,%eax
setne  %dil
call   1050 <errnoThrow@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %edi,%edi
test   %eax,%eax
setne  %dil
pop    %rbx
jmp    1050 <errnoThrow@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @Sys_PutChar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @putchar(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %6, %7
%9 = zext i1 %8 to i32
%10 = call i32 @errnoThrow(i32 %9)
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @errnoThrow(i32 %15)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @Sys_PutChar(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
%3 = icmp ne i32 %2, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @errnoThrow(i32 %4)
%6 = load i32, i32* @stdout
%7 = tail call i32 @fflush(i32 %6)
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @errnoThrow(i32 %9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int path_exist(char *path) {
  FILE *file;
  int retval = 0;
  file = fopen(path, "r");
  retval = (file != NULL);
  fclose(file);
  return retval;
}


x86 assembly (clang, -O0):
<path_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_exist>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @path_exist(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
store i32 %9, i32* %4
%10 = load i32*, i32** %3
%11 = call i32 @fclose(i32* %10)
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @path_exist(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @fclose(i32* %2)
ret i32 %4
}
/* Type definitions */
struct bufferevent_openssl {
  int dummy;
};
struct bufferevent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ consider_reading(struct bufferevent_openssl *);
void be_openssl_readcb(struct bufferevent *bev_base, void *ctx) {
  struct bufferevent_openssl *bev_ssl = ctx;
  consider_reading(bev_ssl);
}


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

x86 assembly (clang, -O2):
<be_openssl_readcb>:
mov    %rsi,%rdi
jmp    1030 <consider_reading@plt>

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
%struct.bufferevent_openssl = type { i32 }
define void @be_openssl_readcb(%struct.bufferevent* %0, i8* %1) {
%3 = alloca %struct.bufferevent*
%4 = alloca i8*
%5 = alloca %struct.bufferevent_openssl*
store %struct.bufferevent* %0, %struct.bufferevent** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.bufferevent_openssl*
store %struct.bufferevent_openssl* %7, %struct.bufferevent_openssl** %5
%8 = load %struct.bufferevent_openssl*, %struct.bufferevent_openssl** %5
%9 = call i32 @consider_reading(%struct.bufferevent_openssl* %8)
ret void
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
%struct.bufferevent_openssl = type { i32 }
define void @be_openssl_readcb(%struct.bufferevent* nocapture readnone %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.bufferevent_openssl*
%4 = tail call i32 @consider_reading(%struct.bufferevent_openssl* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enter_critical(int);
int /*<<< orphan*/ exit_critical(int);
void decrease(int thread, int iterations, volatile int *data) {
  for (int i = 0; i < iterations; i++) {
    int a;
    enter_critical(thread);
    a = *data;
    a--;
    *data = a;
    exit_critical(thread);
  }
}


x86 assembly (clang, -O0):
<decrease>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117e <decrease+0x5e>
mov    -0x4(%rbp),%edi
call   1030 <enter_critical@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
call   1040 <exit_critical@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <decrease+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrease>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <decrease+0x27>
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
nop
mov    %ebx,%edi
call   1030 <enter_critical@plt>
addl   $0xffffffff,(%r14)
mov    %ebx,%edi
call   1040 <exit_critical@plt>
add    $0xffffffff,%ebp
jne    1130 <decrease+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @decrease(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i32 0, i32* %7
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load i32, i32* %4
%15 = call i32 @enter_critical(i32 %14)
%16 = load i32*, i32** %6
%17 = load volatile i32, i32* %16
store i32 %17, i32* %8
%18 = load i32, i32* %8
%19 = add nsw i32 %18, -1
store i32 %19, i32* %8
%20 = load i32, i32* %8
%21 = load i32*, i32** %6
store volatile i32 %20, i32* %21
%22 = load i32, i32* %4
%23 = call i32 @exit_critical(i32 %22)
br label %24
24: ; preds = %13
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %9
27: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @decrease(i32 %0, i32 %1, i32* %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %6, label %5
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i32 [ %12, %6 ], [ 0, %3 ]
%8 = tail call i32 @enter_critical(i32 %0)
%9 = load volatile i32, i32* %2
%10 = add nsw i32 %9, -1
store volatile i32 %10, i32* %2
%11 = tail call i32 @exit_critical(i32 %0)
%12 = add nuw nsw i32 %7, 1
%13 = icmp eq i32 %12, %1
br i1 %13, label %5, label %6
}
/* Type definitions */
struct xmp_context {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ptdt_load(struct xmp_context *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/);
void get_ptdt(struct xmp_context *ctx, int size, FILE *f) {
  ptdt_load(ctx, f, 0);
}


x86 assembly (clang, -O0):
<get_ptdt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <ptdt_load@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ptdt>:
mov    %rdx,%rsi
xor    %edx,%edx
jmp    1030 <ptdt_load@plt>

LLVM IR (-O0):
%struct.xmp_context = type { i32 }
define void @get_ptdt(%struct.xmp_context* %0, i32 %1, i32* %2) {
%4 = alloca %struct.xmp_context*
%5 = alloca i32
%6 = alloca i32*
store %struct.xmp_context* %0, %struct.xmp_context** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load %struct.xmp_context*, %struct.xmp_context** %4
%8 = load i32*, i32** %6
%9 = call i32 @ptdt_load(%struct.xmp_context* %7, i32* %8, i32 0)
ret void
}

LLVM IR (-O2):
%struct.xmp_context = type { i32 }
define void @get_ptdt(%struct.xmp_context* %0, i32 %1, i32* %2) {
%4 = tail call i32 @ptdt_load(%struct.xmp_context* %0, i32* %2, i32 0)
ret void
}
/* Type definitions */
struct userlist_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int userlist_cmdline_parser_required(struct userlist_args_info *args_info,
                                     const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
%struct.userlist_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @userlist_cmdline_parser_required(%struct.userlist_args_info* %0, i8* %1) {
%3 = alloca %struct.userlist_args_info*
%4 = alloca i8*
store %struct.userlist_args_info* %0, %struct.userlist_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.userlist_args_info*, %struct.userlist_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.userlist_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @userlist_cmdline_parser_required(%struct.userlist_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x70() {
  Assert_real((isspace(112) == 0),
              "/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/ctype/test_isspace.c",
              565, ("isspace should be 0 for p"));
}


x86 assembly (clang, -O0):
<t_isspace_0x70>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x235,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x70>:
push   %rax
mov    $0x70,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x235,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for p\00"
define void @t_isspace_0x70() {
%1 = call i64 @isspace(i32 112)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 565, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for p\00"
define void @t_isspace_0x70() {
%1 = tail call i64 @isspace(i32 112)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 565, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
short test_170_14(short *mem) {
  short newval = 5;
  short prevval;
  __atomic_exchange(mem + 0, &newval, &prevval, 4);
  return prevval;
}


x86 assembly (clang, -O0):
<test_170_14>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movw   $0x5,-0xa(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xa(%rbp),%ax
xchg   %ax,(%rcx)
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_170_14>:
mov    $0x5,%ax
xchg   %ax,(%rdi)
ret

LLVM IR (-O0):
define signext i16 @test_170_14(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
store i16 5, i16* %3
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 0
%7 = load i16, i16* %3
%8 = atomicrmw xchg i16* %6, i16 %7 acq_rel
store i16 %8, i16* %4
%9 = load i16, i16* %4
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @test_170_14(i16* nocapture %0) {
%2 = atomicrmw xchg i16* %0, i16 5 acq_rel
ret i16 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(void *, int, int, int /*<<< orphan*/ *);
void vlink_put(FILE *fptr, int channel, int length, void *data) {
  fputc('$', fptr);
  fputc(channel, fptr);
  fputc(length >> 8, fptr);
  fputc(length & 0xFF, fptr);
  fwrite(data, length, 1, fptr);
}


x86 assembly (clang, -O0):
<vlink_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x24,%edi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x10(%rbp),%edi
sar    $0x8,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x10(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlink_put>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%ebp
mov    %esi,%r15d
mov    %rdi,%rbx
mov    $0x24,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    %ebp,%edi
sar    $0x8,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
movzbl %bpl,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
define void @vlink_put(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32*, i32** %5
%10 = call i32 @fputc(i32 36, i32* %9)
%11 = load i32, i32* %6
%12 = load i32*, i32** %5
%13 = call i32 @fputc(i32 %11, i32* %12)
%14 = load i32, i32* %7
%15 = ashr i32 %14, 8
%16 = load i32*, i32** %5
%17 = call i32 @fputc(i32 %15, i32* %16)
%18 = load i32, i32* %7
%19 = and i32 %18, 255
%20 = load i32*, i32** %5
%21 = call i32 @fputc(i32 %19, i32* %20)
%22 = load i8*, i8** %8
%23 = load i32, i32* %7
%24 = load i32*, i32** %5
%25 = call i32 @fwrite(i8* %22, i32 %23, i32 1, i32* %24)
ret void
}

LLVM IR (-O2):
define void @vlink_put(i32* nocapture %0, i32 %1, i32 %2, i8* nocapture %3) {
%5 = tail call i32 @fputc(i32 36, i32* %0)
%6 = tail call i32 @fputc(i32 %1, i32* %0)
%7 = ashr i32 %2, 8
%8 = tail call i32 @fputc(i32 %7, i32* %0)
%9 = and i32 %2, 255
%10 = tail call i32 @fputc(i32 %9, i32* %0)
%11 = tail call i32 @fwrite(i8* %3, i32 %2, i32 1, i32* %0)
ret void
}
double var_uraeph(int ura) {
  const double ura_value[] = {2.4,   3.4,   4.85,   6.85,   9.65,
                              13.65, 24.0,  48.0,   96.0,   192.0,
                              384.0, 768.0, 1536.0, 3072.0, 6144.0};
  return ura < 0 || 15 < ura ? 6144.0 : ((ura_value[ura]) * (ura_value[ura]));
}


x86 assembly (clang, -O0):
<var_uraeph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xee7(%rip),%rsi
mov    $0x78,%edx
call   1030 <memcpy@plt>
cmpl   $0x0,-0x4(%rbp)
jl     114b <var_uraeph+0x3b>
mov    $0xf,%eax
cmp    -0x4(%rbp),%eax
jge    1160 <var_uraeph+0x50>
movsd  0xead(%rip),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
jmp    117c <var_uraeph+0x6c>
movslq -0x4(%rbp),%rax
movsd  -0x80(%rbp,%rax,8),%xmm0
movslq -0x4(%rbp),%rax
mulsd  -0x80(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<var_uraeph>:
cmp    $0xf,%edi
jbe    110e <var_uraeph+0xe>
movsd  0xef3(%rip),%xmm0
ret
mov    %edi,%eax
lea    0xef9(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
@__const.var_uraeph.ura_value = [15 x double] [double 2.400000e+00, double 3.400000e+00, double 4.850000e+00, double 6.850000e+00, double 9.650000e+00, double 1.365000e+01, double 2.400000e+01, double 4.800000e+01, double 9.600000e+01, double 1.920000e+02, double 3.840000e+02, double 7.680000e+02, double 1.536000e+03, double 3.072000e+03, double 6.144000e+03]
define double @var_uraeph(i32 %0) {
%2 = alloca i32
%3 = alloca [15 x double]
store i32 %0, i32* %2
%4 = bitcast [15 x double]* %3 to i8*
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 15, %8
br i1 %9, label %10, label %11
10: ; preds = %7, %1
br label %21
11: ; preds = %7
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [15 x double], [15 x double]* %3, i64 0, i64 %13
%15 = load double, double* %14
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [15 x double], [15 x double]* %3, i64 0, i64 %17
%19 = load double, double* %18
%20 = fmul double %15, %19
br label %21
21: ; preds = %11, %10
%22 = phi double [ 6.144000e+03, %10 ], [ %20, %11 ]
ret double %22
}

LLVM IR (-O2):
@__const.var_uraeph.ura_value = [15 x double] [double 2.400000e+00, double 3.400000e+00, double 4.850000e+00, double 6.850000e+00, double 9.650000e+00, double 1.365000e+01, double 2.400000e+01, double 4.800000e+01, double 9.600000e+01, double 1.920000e+02, double 3.840000e+02, double 7.680000e+02, double 1.536000e+03, double 3.072000e+03, double 6.144000e+03]
define double @var_uraeph(i32 %0) {
%2 = icmp ugt i32 %0, 15
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = zext i32 %0 to i64
%5 = getelementptr inbounds [15 x double], [15 x double]* @__const.var_uraeph.ura_value, i64 0, i64 %4
%6 = load double, double* %5
%7 = fmul double %6, %6
br label %8
8: ; preds = %1, %3
%9 = phi double [ %7, %3 ], [ 6.144000e+03, %1 ]
ret double %9
}
/* Variables and functions */
void *stu_alloc(size_t);
int /*<<< orphan*/ stu_memzero(void *, size_t);
void *stu_calloc(size_t size) {
  void *p;
  p = stu_alloc(size);
  if (p) {
    stu_memzero(p, size);
  }
  return p;
}


x86 assembly (clang, -O0):
<stu_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <stu_alloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1151 <stu_calloc+0x31>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <stu_memzero@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stu_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <stu_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113f <stu_calloc+0x1f>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <stu_memzero@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @stu_calloc(i64 %0) {
%2 = tail call i8* @stu_alloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @stu_memzero(i8* %2, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ dap_write_word(int, int);
void target_lock(void) { dap_write_word(0x41004000, 0x0000a545); }


x86 assembly (clang, -O0):
<target_lock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41004000,%edi
mov    $0xa545,%esi
call   1030 <dap_write_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<target_lock>:
mov    $0x41004000,%edi
mov    $0xa545,%esi
jmp    1030 <dap_write_word@plt>

LLVM IR (-O0):
define void @target_lock() {
%1 = call i32 @dap_write_word(i32 1090535424, i32 42309)
ret void
}

LLVM IR (-O2):
define void @target_lock() {
%1 = tail call i32 @dap_write_word(i32 1090535424, i32 42309)
ret void
}
/* Type definitions */
struct vbi {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vbi_send(struct vbi *, int, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/);
void vbi_reset(struct vbi *vbi) { vbi_send(vbi, 8, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<vbi_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <vbi_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vbi_reset>:
mov    $0x8,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <vbi_send@plt>

LLVM IR (-O0):
%struct.vbi = type { i32 }
define void @vbi_reset(%struct.vbi* %0) {
%2 = alloca %struct.vbi*
store %struct.vbi* %0, %struct.vbi** %2
%3 = load %struct.vbi*, %struct.vbi** %2
%4 = call i32 @vbi_send(%struct.vbi* %3, i32 8, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.vbi = type { i32 }
define void @vbi_reset(%struct.vbi* %0) {
%2 = tail call i32 @vbi_send(%struct.vbi* %0, i32 8, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int hex_decode(int /*<<< orphan*/, char const *, void *, size_t);
__attribute__((always_)) int base16_decode(const char *encoded, void *data,
                                           size_t len) {
  return hex_decode(0, encoded, data, len);
}


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

x86 assembly (clang, -O2):
<base16_decode>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <hex_decode@plt>

LLVM IR (-O0):
define i32 @base16_decode(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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @hex_decode(i32 0, i8* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @base16_decode(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @hex_decode(i32 0, i8* %0, i8* %1, i64 %2)
ret i32 %4
}
int test_imm_EFint16_mem(short *val) {
  return ((*val) & (0xEF << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_EFint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 239
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int foo(int X) { return X <= 0 ? -X : X; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     111e <foo+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <foo+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int test_imm_93uint32_mem(unsigned int *val) {
  return ((*val) & (0x93 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_93uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 147
%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_93uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 147
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int ext_nid;
};
typedef TYPE_1__ X509V3_EXT_METHOD;

/* Variables and functions */
int ext_cmp(const X509V3_EXT_METHOD *const *a,
            const X509V3_EXT_METHOD *const *b) {
  return ((*a)->ext_nid - (*b)->ext_nid);
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
define i32 @ext_cmp(%struct.TYPE_4__** %0, %struct.TYPE_4__** %1) {
%3 = alloca %struct.TYPE_4__**
%4 = alloca %struct.TYPE_4__**
store %struct.TYPE_4__** %0, %struct.TYPE_4__*** %3
store %struct.TYPE_4__** %1, %struct.TYPE_4__*** %4
%5 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %3
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %4
%10 = load %struct.TYPE_4__*, %struct.TYPE_4__** %9
%11 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
define i32 @ext_cmp(%struct.TYPE_4__** nocapture %0, %struct.TYPE_4__** nocapture %1) {
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %0
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %1
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sub nsw i32 %5, %8
ret i32 %9
}
void BN_reciprocal(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_reciprocal() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int int64_t;

/* Variables and functions */
int _pbcV_encode(int, int /*<<< orphan*/ *);
int _pbcV_zigzag(int64_t n, uint8_t buffer[10]) {
  n = (n << 1) ^ (n >> 63);
  return _pbcV_encode(n, buffer);
}


x86 assembly (clang, -O0):
<_pbcV_zigzag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%edx
mov    $0x3f,%ecx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <_pbcV_encode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pbcV_zigzag>:
jmp    1030 <_pbcV_encode@plt>

LLVM IR (-O0):
define i32 @_pbcV_zigzag(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 = shl i32 %5, 1
%7 = load i32, i32* %3
%8 = ashr i32 %7, 63
%9 = xor i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32*, i32** %4
%12 = call i32 @_pbcV_encode(i32 %10, i32* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @_pbcV_zigzag(i32 %0, i32* %1) {
%3 = tail call i32 @_pbcV_encode(i32 poison, i32* %1)
ret i32 %3
}
/* Variables and functions */
int top(int);
int main(int argc, char **argv) { return top(argc); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <top@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @top(i32 %0)
ret i32 %3
}
int max1363_initialize_ring(struct iio_ring_buffer *ring) { return 0; }


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

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

LLVM IR (-O0):
%struct.iio_ring_buffer = type opaque
define i32 @max1363_initialize_ring(%struct.iio_ring_buffer* %0) {
%2 = alloca %struct.iio_ring_buffer*
store %struct.iio_ring_buffer* %0, %struct.iio_ring_buffer** %2
ret i32 0
}

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define i32 @max1363_initialize_ring(%struct.iio_ring_buffer* nocapture readnone %0) {
ret i32 0
}
unsigned int f58(unsigned int x, unsigned long int y) {
  return (x << ((-y) & (8 * sizeof(unsigned int) - 1))) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f58>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f58>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f58(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = sub i64 0, %6
%8 = and i64 %7, 31
%9 = trunc i64 %8 to i32
%10 = shl i32 %5, %9
%11 = load i32, i32* %3
%12 = load i64, i64* %4
%13 = trunc i64 %12 to i32
%14 = lshr i32 %11, %13
%15 = xor i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f58(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = sub i32 0, %3
%5 = and i32 %4, 31
%6 = shl i32 %0, %5
%7 = lshr i32 %0, %3
%8 = xor i32 %6, %7
ret i32 %8
}
/* Variables and functions */
int isdigit(int);
__attribute__((regparm(0))) int(_win_isdigit)(int c) { return isdigit(c); }


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

x86 assembly (clang, -O2):
<_win_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @_win_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void store_load_barrier(void) { return; }


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

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

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

LLVM IR (-O2):
define void @store_load_barrier() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fio_abs_read_32(int /*<<< orphan*/ *, long, int);
float fio_abs_read_float32(FILE *f, long offset, int is_big_endian) {
  int val;
  float *p, q;
  val = fio_abs_read_32(f, offset, is_big_endian);
  p = (float *)(&val);
  q = *p;
  return q;
}


x86 assembly (clang, -O0):
<fio_abs_read_float32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <fio_abs_read_32@plt>
mov    %eax,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fio_abs_read_float32>:
push   %rax
call   1030 <fio_abs_read_32@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fio_abs_read_float32(i32* %0, i64 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca float*
%9 = alloca float
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%10 = load i32*, i32** %4
%11 = load i64, i64* %5
%12 = load i32, i32* %6
%13 = call i32 @fio_abs_read_32(i32* %10, i64 %11, i32 %12)
store i32 %13, i32* %7
%14 = bitcast i32* %7 to float*
store float* %14, float** %8
%15 = load float*, float** %8
%16 = load float, float* %15
store float %16, float* %9
%17 = load float, float* %9
ret float %17
}

LLVM IR (-O2):
define float @fio_abs_read_float32(i32* %0, i64 %1, i32 %2) {
%4 = tail call i32 @fio_abs_read_32(i32* %0, i64 %1, i32 %2)
%5 = bitcast i32 %4 to float
ret float %5
}
signed int signedint_ignoring_longdouble(signed int x, long double y) {
  return x;
}


x86 assembly (clang, -O0):
<signedint_ignoring_longdouble>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %edi,-0x4(%rbp)
fstpt  -0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @signedint_ignoring_longdouble(i32 returned %0, x86_fp80 %1) {
ret i32 %0
}