xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ x(int, void (*)(int));
void h(int i, ...) { x(i + 1, &h); }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    0x2eb8(%rip),%rsi
call   1030 <x@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
add    $0x1,%edi
mov    0x2ec6(%rip),%rsi
jmp    1030 <x@plt>

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

LLVM IR (-O2):
define void @h(i32 %0, ...) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @x(i32 %2, void (i32)* bitcast (void (i32, ...)* @h to void (i32)*))
ret void
}
/* Variables and functions */
unsigned char *base64_decode(unsigned char *, size_t *, unsigned char const *,
                             size_t);
unsigned char *decode_buffer_base64(unsigned char *out, size_t *out_len,
                                    const unsigned char *in, size_t in_len) {
  return base64_decode(out, out_len, in, in_len);
}


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

x86 assembly (clang, -O2):
<decode_buffer_base64>:
jmp    1030 <base64_decode@plt>

LLVM IR (-O0):
define i8* @decode_buffer_base64(i8* %0, i64* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64* %1, i64** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64*, i64** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i8* @base64_decode(i8* %9, i64* %10, i8* %11, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @decode_buffer_base64(i8* %0, i64* %1, i8* %2, i64 %3) {
%5 = tail call i8* @base64_decode(i8* %0, i64* %1, i8* %2, i64 %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ execv(char *, char **);
main() {
  char *args[] = {"/usr/bin/terminal", (char *)0};
  execv("/usr/bin/terminal", args);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2cf1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cee(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1030 <execv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeda(%rip),%rdi
mov    %rsp,%rsi
call   1030 <execv@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"/usr/bin/terminal\00"
@__const.main.args = [2 x i8*] [i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"/usr/bin/terminal\00"
@__const.main.args = [2 x i8*] [i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = call i32 @execv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Send1(int /*<<< orphan*/, int);
void LCD_X_WriteM01(unsigned char *pData, int NumBytes) {
  ;
  for (; NumBytes; NumBytes--) {
    Send1(*pData++, 1);
  };
}


x86 assembly (clang, -O0):
<LCD_X_WriteM01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1153 <LCD_X_WriteM01+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
mov    $0x1,%esi
call   1030 <Send1@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <LCD_X_WriteM01+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_X_WriteM01>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1148 <LCD_X_WriteM01+0x38>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%edi
mov    $0x1,%esi
call   1030 <Send1@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <LCD_X_WriteM01+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @LCD_X_WriteM01(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 = %14, %2
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
%11 = load i8, i8* %9
%12 = zext i8 %11 to i32
%13 = call i32 @Send1(i32 %12, i32 1)
br label %14
14: ; preds = %8
%15 = load i32, i32* %4
%16 = add nsw i32 %15, -1
store i32 %16, i32* %4
br label %5
17: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @LCD_X_WriteM01(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i8* [ %7, %4 ], [ %0, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = tail call i32 @Send1(i32 %9, i32 1)
%11 = add nsw i32 %5, -1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void regerror(char const *s) { printf("re error %s\n", s); }


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

x86 assembly (clang, -O2):
<regerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"re error %s\0A\00"
define void @regerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void USB_Resume_Event(void) {}


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

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

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

LLVM IR (-O2):
define void @USB_Resume_Event() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
zne() { callrts("ccne"); }


x86 assembly (clang, -O0):
<zne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <callrts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zne>:
lea    0xee9(%rip),%rdi
jmp    1030 <callrts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"ccne\00"
define i32 @zne() {
%1 = alloca i32
%2 = call i32 @callrts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [5 x i8] c"ccne\00"
define i32 @zne() {
%1 = tail call i32 @callrts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void done(unsigned bit) { (void)bit; }


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

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

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

LLVM IR (-O2):
define void @done(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputwc(int /*<<< orphan*/, int /*<<< orphan*/ *);
void uninitvar_fputwc(void) {
  wchar_t c;
  FILE *stream;
  (void)fputwc(c, stream);
}


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

x86 assembly (clang, -O2):
<uninitvar_fputwc>:
jmp    1030 <fputwc@plt>

LLVM IR (-O0):
define void @uninitvar_fputwc() {
%1 = alloca i32
%2 = alloca i32*
%3 = load i32, i32* %1
%4 = load i32*, i32** %2
%5 = call i32 @fputwc(i32 %3, i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fputwc() {
%1 = tail call i32 @fputwc(i32 undef, i32* undef)
ret void
}
void g_list_sort_with_data() {}


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

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

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

LLVM IR (-O2):
define void @g_list_sort_with_data() {
ret void
}
/* Variables and functions */
void *memcpy(void *, void const *, unsigned int);
void *sys_memcpy(void *pDst, const void *pSrc, unsigned int uiSize) {
  return memcpy(pDst, pSrc, uiSize);
}


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

x86 assembly (clang, -O2):
<sys_memcpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @sys_memcpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @memcpy(i8* %0, i8* %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void help(void) {
  fprintf(stdout, "thales -p AB AC AD AE\n"
                  "thales -s AB AC AD\n\n"
                  "Thales' theorem with the following equation: AB   AD\n"
                  "                                             __ = __\n"
                  "                                             AC   AE\n");
}


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [202 x i8] c"thales -p AB AC AD AE\0Athales -s AB AC AD\0A\0AThales' theorem with the following equation: AB AD\0A __ = __\0A AC AE\0A\00"
define void @help() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [202 x i8] c"thales -p AB AC AD AE\0Athales -s AB AC AD\0A\0AThales' theorem with the following equation: AB AD\0A __ = __\0A AC AE\0A\00"
define void @help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([202 x i8], [202 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_05uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x05 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_05uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 5
%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_05uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 21474836480
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void slog(char *msg) { printf("%s\n", msg); }


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

x86 assembly (clang, -O2):
<slog>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @slog(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
float __ocml_mul_rtp_f32(float, float);
float __fmul_rd(float x, float y) { return __ocml_mul_rtp_f32(x, y); }


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

x86 assembly (clang, -O2):
<__fmul_rd>:
jmp    1030 <__ocml_mul_rtp_f32@plt>

LLVM IR (-O0):
define float @__fmul_rd(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @__ocml_mul_rtp_f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__fmul_rd(float %0, float %1) {
%3 = tail call float @__ocml_mul_rtp_f32(float %0, float %1)
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, int);
char *target2str(int);
const char *targetTypeAndId2Str(int targetType, int targetId) {
  static char tmp[256];
  snprintf(tmp, sizeof(tmp), "%s-%-3d", target2str(targetType), targetId);
  return tmp;
}


x86 assembly (clang, -O0):
<targetTypeAndId2Str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <target2str@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%r8d
lea    0x2efc(%rip),%rdi
mov    $0x100,%esi
lea    0xeb0(%rip),%rdx
call   1030 <snprintf@plt>
lea    0x2ee4(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<targetTypeAndId2Str>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
call   1040 <target2str@plt>
lea    0x2f0e(%rip),%r14
lea    0xec7(%rip),%rdx
mov    %r14,%rdi
mov    $0x100,%esi
mov    %rax,%rcx
mov    %ebx,%r8d
call   1030 <snprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@targetTypeAndId2Str.tmp = internal global [256 x i8] zeroinitializer
@.str = [8 x i8] c"%s-%-3d\00"
define i8* @targetTypeAndId2Str(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 = call i8* @target2str(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @snprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @targetTypeAndId2Str.tmp, i64 0, i64 0), i32 256, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @targetTypeAndId2Str.tmp, i64 0, i64 0)
}

LLVM IR (-O2):
@targetTypeAndId2Str.tmp = internal global [256 x i8] zeroinitializer
@.str = [8 x i8] c"%s-%-3d\00"
define i8* @targetTypeAndId2Str(i32 %0, i32 %1) {
%3 = tail call i8* @target2str(i32 %0)
%4 = tail call i32 @snprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @targetTypeAndId2Str.tmp, i64 0, i64 0), i32 256, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %1)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @targetTypeAndId2Str.tmp, i64 0, i64 0)
}
void *b_mem_allocate(unsigned long nbr) {
  void *mem = (void *)0;
  asm volatile("call *0x00100050" : "=a"(mem) : "c"(nbr));
  return mem;
}


x86 assembly (clang, -O0):
<b_mem_allocate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
call   *0x100050
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_mem_allocate>:
mov    %rdi,%rcx
call   *0x100050
ret

LLVM IR (-O0):
define i8* @b_mem_allocate(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* null, i8** %3
%4 = load i64, i64* %2
%5 = call i8* asm sideeffect "call *0x00100050", "={ax},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @b_mem_allocate(i64 %0) {
%2 = tail call i8* asm sideeffect "call *0x00100050", "={ax},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret i8* %2
}
void gtk_container_remove() {}


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

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

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

LLVM IR (-O2):
define void @gtk_container_remove() {
ret void
}
main(argc, argv) int argc;
char **argv;
{
  char tmp[160];
  strcat(tmp, "exec nice /usr/games/lib/phantasia/phantasia ");
  if (argc > 1)
    strcat(tmp, argv[1]);
  system(tmp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <strcat@plt>
cmpl   $0x1,-0x8(%rbp)
jle    116a <main+0x4a>
lea    -0xb0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <strcat@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0xa8,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsp,%rdi
call   1030 <strlen@plt>
movups 0xeb3(%rip),%xmm0
movups %xmm0,(%rsp,%rax,1)
movups 0xeb8(%rip),%xmm0
movups %xmm0,0x10(%rsp,%rax,1)
movups 0xeba(%rip),%xmm0
movups %xmm0,0x1e(%rsp,%rax,1)
cmp    $0x2,%ebp
jl     117a <main+0x4a>
mov    0x8(%rbx),%rsi
mov    %rsp,%rdi
call   1050 <strcat@plt>
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <system@plt>
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"exec nice /usr/games/lib/phantasia/phantasia \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [160 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [160 x i8], [160 x i8]* %6, i64 0, i64 0
%8 = call i8* @strcat(i8* %7, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = getelementptr inbounds [160 x i8], [160 x i8]* %6, i64 0, i64 0
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i8* @strcat(i8* %12, i8* %15)
br label %17
17: ; preds = %11, %2
%18 = getelementptr inbounds [160 x i8], [160 x i8]* %6, i64 0, i64 0
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %18)
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [46 x i8] c"exec nice /usr/games/lib/phantasia/phantasia \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [160 x i8]
%4 = getelementptr inbounds [160 x i8], [160 x i8]* %3, i64 0, i64 0
%5 = call i64 @strlen(i8* %4)
%6 = getelementptr [160 x i8], [160 x i8]* %3, i64 0, i64 %5
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = call i8* @strcat(i8* %4, i8* dereferenceable(1) %10)
br label %12
12: ; preds = %8, %2
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  typedef struct Books {
    int a;
    int b;
  } Book;
  Book book;
  book.a = 1;
  book.b = 2;
  printf("Books.a is %d\n", book.a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Books = type { i32, i32 }
@.str = [15 x i8] c"Books.a is %d\0A\00"
define i32 @main() {
%1 = alloca %struct.Books
%2 = getelementptr inbounds %struct.Books, %struct.Books* %1, i32 0, i32 0
store i32 1, i32* %2
%3 = getelementptr inbounds %struct.Books, %struct.Books* %1, i32 0, i32 1
store i32 2, i32* %3
%4 = getelementptr inbounds %struct.Books, %struct.Books* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Books.a is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xc6() {
  Assert_real((islower(198) == 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_islower.c",
              995, ("islower should be 0 for 0xc6"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xc6>:
push   %rax
mov    $0xc6,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3e3,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xc6\00"
define void @t_islower_0xc6() {
%1 = call i64 @islower(i32 198)
%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 995, i8* getelementptr inbounds ([29 x i8], [29 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xc6\00"
define void @t_islower_0xc6() {
%1 = tail call i64 @islower(i32 198)
%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 995, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void aslInit(void) {}


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

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

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

LLVM IR (-O2):
define void @aslInit() {
ret void
}
char *setlocale(int category, const char *locale) {
  (void)category;
  if (locale == ((void *)0)) {
    return ("C");
  } else if ((strcmp(locale, "C") == 0) || (strcmp(locale, "") == 0)) {
    return ("C");
  } else {
    return (((void *)0));
  }
}


x86 assembly (clang, -O0):
<setlocale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113a <setlocale+0x2a>
lea    0xecf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <setlocale+0x74>
mov    -0x18(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
je     116c <setlocale+0x5c>
mov    -0x18(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    117c <setlocale+0x6c>
lea    0xe8d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1184 <setlocale+0x74>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setlocale>:
push   %r14
push   %rbx
push   %rax
test   %rsi,%rsi
je     1145 <setlocale+0x35>
mov    %rsi,%r14
lea    0xedd(%rip),%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     114c <setlocale+0x3c>
xor    %ebx,%ebx
cmpb   $0x0,(%r14)
lea    0xec1(%rip),%rax
cmove  %rax,%rbx
jmp    114c <setlocale+0x3c>
lea    0xeb4(%rip),%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"C\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @setlocale(i32 %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = load i8*, i8** %5
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3
br label %20
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8*, i8** %5
%16 = call i32 @strcmp(i8* %15, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14, %10
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3
br label %20
19: ; preds = %14
store i8* null, i8** %3
br label %20
20: ; preds = %19, %18, %9
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@.str = [2 x i8] c"C\00"
define i8* @setlocale(i32 %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = tail call i32 @strcmp(i8* %1, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = load i8, i8* %1
%9 = icmp eq i8 %8, 0
%10 = select i1 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* null
br label %11
11: ; preds = %7, %4, %2
%12 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %4 ], [ %10, %7 ]
ret i8* %12
}
unsigned int round_log(unsigned size) {
  unsigned int i = 32;
  while (i < size) {
    i <<= 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<round_log>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1128 <round_log+0x28>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <round_log+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_log>:
mov    $0x20,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jb     1110 <round_log+0x10>
ret

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

LLVM IR (-O2):
define i32 @round_log(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 32, %1 ], [ %5, %2 ]
%4 = icmp ult i32 %3, %0
%5 = shl i32 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int printf(char *, unsigned int);
int print_uint(unsigned v) { return printf("%u", v); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @print_uint(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
/* Variables and functions */
char *_strrchr(char *p, int ch) {
  char *save;
  for (save = NULL;; ++p) {
    if (*p == ch)
      save = (char *)p;
    if (!*p)
      return (save);
  }
}


x86 assembly (clang, -O0):
<_strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    112b <_strrchr+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113e <_strrchr+0x3e>
mov    -0x18(%rbp),%rax
pop    %rbp
ret
jmp    1143 <_strrchr+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <_strrchr+0x13>

x86 assembly (clang, -O2):
<_strrchr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi),%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %ecx,%ecx
jne    1110 <_strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @_strrchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %11, %3 ]
%5 = phi i8* [ null, %2 ], [ %9, %3 ]
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, %1
%9 = select i1 %8, i8* %4, i8* %5
%10 = icmp eq i8 %6, 0
%11 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %10, label %12, label %3
12: ; preds = %3
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void param_usage(void) {
  fprintf(stderr, "parameter list must be in key=value, key=value format\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"parameter list must be in key=value, key=value format\0A\00"
define void @param_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"parameter list must be in key=value, key=value format\0A\00"
define void @param_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret void
}
void f(int n, int m, int v[n + 1][m * 2]) {
#pragma omp task shared(v)
  { v[n - 1][m - 1] = 4; }
#pragma omp taskwait
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,%eax
mov    %eax,%edx
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movl   $0x4,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    (%rsi,%rsi,1),%eax
add    $0xffffffff,%edi
movslq %edi,%rcx
imul   %rax,%rcx
lea    (%rdx,%rcx,4),%rax
movslq %esi,%rcx
movl   $0x4,-0x4(%rax,%rcx,4)
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
%8 = add nsw i32 %7, 1
%9 = zext i32 %8 to i64
%10 = load i32, i32* %5
%11 = mul nsw i32 %10, 2
%12 = zext i32 %11 to i64
%13 = load i32*, i32** %6
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = mul nsw i64 %16, %12
%18 = getelementptr inbounds i32, i32* %13, i64 %17
%19 = load i32, i32* %5
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %18, i64 %21
store i32 4, i32* %22
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = shl nsw i32 %1, 1
%5 = zext i32 %4 to i64
%6 = add nsw i32 %0, -1
%7 = sext i32 %6 to i64
%8 = mul nsw i64 %5, %7
%9 = getelementptr inbounds i32, i32* %2, i64 %8
%10 = add nsw i32 %1, -1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
store i32 4, i32* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __getpid();
int __kill(int /*<<< orphan*/, int);
int raise(int sig) { return __kill(__getpid(), sig); }


x86 assembly (clang, -O0):
<raise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__getpid@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <__kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raise>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <__getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <__kill@plt>

LLVM IR (-O0):
define i32 @raise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__getpid()
%4 = load i32, i32* %2
%5 = call i32 @__kill(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @raise(i32 %0) {
%2 = tail call i32 (...) @__getpid()
%3 = tail call i32 @__kill(i32 %2, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void **, size_t);
void free(void *ptr) {
  void **pptr = ptr;
  munmap(pptr - 1, (size_t)pptr[-1]);
}


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

x86 assembly (clang, -O2):
<free>:
mov    -0x8(%rdi),%rsi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define void @free(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i8**
%4 = load i8*, i8** %3
%5 = ptrtoint i8* %4 to i64
%6 = tail call i32 @munmap(i8** %3, i64 %5)
ret void
}
int test_imm_4Duint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x4D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_4Duint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 77
%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_4Duint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 5046272
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void OCFree(void *ptr) { free(ptr); }


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

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


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_set_vadjustment() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_store_tbl();
void spr_write_tbl(void *opaque, int sprn) { gen_op_store_tbl(); }


x86 assembly (clang, -O0):
<spr_write_tbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <gen_op_store_tbl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spr_write_tbl>:
xor    %eax,%eax
jmp    1030 <gen_op_store_tbl@plt>

LLVM IR (-O0):
define void @spr_write_tbl(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @gen_op_store_tbl()
ret void
}

LLVM IR (-O2):
define void @spr_write_tbl(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @gen_op_store_tbl()
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t c = 0;
  while (*s++)
    c++;
  return c;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1139 <strlen+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ perror(char *);
void perror_wrapper(char *msg) {
  int prev = errno;
  perror(msg);
  errno = prev;
}


x86 assembly (clang, -O0):
<perror_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    -0xc(%rbp),%ecx
mov    0x2ea5(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perror_wrapper>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <perror@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define void @perror_wrapper(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 @perror(i8* %5)
%7 = load i32, i32* %3
store i32 %7, i32* @errno
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @perror_wrapper(i8* nocapture %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @perror(i8* %0)
store i32 %2, i32* @errno
ret void
}
char *strchr(const char *string, int c) {
  while (*string) {
    if (*string == c) {
      return (char *)string;
    }
    string++;
  }
  if (!c)
    return (char *)string;
  return (char *)0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <strchr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1135 <strchr+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <strchr+0x65>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
cmpl   $0x0,-0x14(%rbp)
jne    115d <strchr+0x5d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <strchr+0x65>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     112b <strchr+0x2b>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %ecx,%ecx
test   %esi,%esi
cmovne %rcx,%rax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %18, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %10, %2
%15 = phi i8* [ %0, %2 ], [ %11, %10 ]
%16 = icmp eq i32 %1, 0
%17 = select i1 %16, i8* %15, i8* null
br label %18
18: ; preds = %5, %14
%19 = phi i8* [ %17, %14 ], [ %7, %5 ]
ret i8* %19
}
int main(void) {
  for (;;)
    ;
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ compute_residue_b8block(int, int);
void compute_residue_mb(int i16mode) {
  compute_residue_b8block(0, i16mode);
  compute_residue_b8block(1, i16mode);
  compute_residue_b8block(2, i16mode);
  compute_residue_b8block(3, i16mode);
}


x86 assembly (clang, -O0):
<compute_residue_mb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
xor    %edi,%edi
call   1030 <compute_residue_b8block@plt>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <compute_residue_b8block@plt>
mov    -0x4(%rbp),%esi
mov    $0x2,%edi
call   1030 <compute_residue_b8block@plt>
mov    -0x4(%rbp),%esi
mov    $0x3,%edi
call   1030 <compute_residue_b8block@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_residue_mb>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
mov    %ebx,%esi
call   1030 <compute_residue_b8block@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1030 <compute_residue_b8block@plt>
mov    $0x2,%edi
mov    %ebx,%esi
call   1030 <compute_residue_b8block@plt>
mov    $0x3,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <compute_residue_b8block@plt>

LLVM IR (-O0):
define void @compute_residue_mb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @compute_residue_b8block(i32 0, i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @compute_residue_b8block(i32 1, i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @compute_residue_b8block(i32 2, i32 %7)
%9 = load i32, i32* %2
%10 = call i32 @compute_residue_b8block(i32 3, i32 %9)
ret void
}

LLVM IR (-O2):
define void @compute_residue_mb(i32 %0) {
%2 = tail call i32 @compute_residue_b8block(i32 0, i32 %0)
%3 = tail call i32 @compute_residue_b8block(i32 1, i32 %0)
%4 = tail call i32 @compute_residue_b8block(i32 2, i32 %0)
%5 = tail call i32 @compute_residue_b8block(i32 3, i32 %0)
ret void
}