xunge/DecIR huggingface dataset:
void func_name() {
  fexpect_string(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/function.c",
      106, "func_name", __func__);
  ;
  fexpect_string(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/function.c",
      107, "func_name", __FUNCTION__);
  ;
}


x86 assembly (clang, -O0):
<func_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x6a,%esi
lea    0xf5c(%rip),%rcx
mov    %rcx,%rdx
mov    $0x0,%al
call   1030 <fexpect_string@plt>
lea    0xec8(%rip),%rdi
mov    $0x6b,%esi
lea    0xf3f(%rip),%rcx
mov    %rcx,%rdx
mov    $0x0,%al
call   1030 <fexpect_string@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_name>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
lea    0xf61(%rip),%rbx
mov    %r14,%rdi
mov    $0x6a,%esi
mov    %rbx,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1030 <fexpect_string@plt>
mov    %r14,%rdi
mov    $0x6b,%esi
mov    %rbx,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fexpect_string@plt>

LLVM IR (-O0):
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/function.c\00"
@.str.1 = [10 x i8] c"func_name\00"
define void @func_name() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @fexpect_string to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 106, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @fexpect_string to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 107, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [131 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/function.c\00"
@.str.1 = [10 x i8] c"func_name\00"
define void @func_name() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @fexpect_string to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 106, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @fexpect_string to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0), i32 107, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int entrada() {
  int jogs = 0;
  scanf("%d", &jogs);
  return jogs;
}


x86 assembly (clang, -O0):
<entrada>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entrada>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @entrada() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
void CON_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @CON_Shutdown() {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ mem_list_add(void *);
void *m_calloc(size_t nelem, size_t size) {
  void *ptr;
  ptr = calloc(nelem, size);
  mem_list_add(ptr);
  return ptr;
}


x86 assembly (clang, -O0):
<m_calloc>:
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)
mov    -0x18(%rbp),%rdi
call   1030 <mem_list_add@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_calloc>:
push   %rbx
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <mem_list_add@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @m_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = tail call i32 @mem_list_add(i8* %3)
ret i8* %3
}
const char *skip(const char *content) {
  for (; content && *content && *content <= ' '; content++)
    ;
  return content;
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113d <skip+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     113d <skip+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    114d <skip+0x4d>
jmp    1163 <skip+0x63>
jmp    1152 <skip+0x52>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <skip+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
test   %rdi,%rdi
je     1122 <skip+0x22>
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <skip+0x21>
cmp    $0x21,%cl
jl     1110 <skip+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @skip(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %9, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
%7 = icmp slt i8 %5, 33
%8 = and i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %3, label %10
10: ; preds = %3, %1
%11 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %11
}
/* Type definitions */
struct v4l_fd {
  int dummy;
};
struct v4l2_capability {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ VIDIOC_QUERYCAP;
int v4l_named_ioctl(struct v4l_fd *, char *, int /*<<< orphan*/,
                    struct v4l2_capability *);
int v4l_querycap(struct v4l_fd *f, struct v4l2_capability *cap) {
  return v4l_named_ioctl(f, "VIDIOC_QUERYCAP", VIDIOC_QUERYCAP, cap);
}


x86 assembly (clang, -O0):
<v4l_querycap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <v4l_named_ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4l_querycap>:
mov    %rsi,%rcx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edx
lea    0xedd(%rip),%rsi
jmp    1030 <v4l_named_ioctl@plt>

LLVM IR (-O0):
%struct.v4l_fd = type { i32 }
%struct.v4l2_capability = type { i32 }
@.str = [16 x i8] c"VIDIOC_QUERYCAP\00"
@VIDIOC_QUERYCAP = global i32 0
define i32 @v4l_querycap(%struct.v4l_fd* %0, %struct.v4l2_capability* %1) {
%3 = alloca %struct.v4l_fd*
%4 = alloca %struct.v4l2_capability*
store %struct.v4l_fd* %0, %struct.v4l_fd** %3
store %struct.v4l2_capability* %1, %struct.v4l2_capability** %4
%5 = load %struct.v4l_fd*, %struct.v4l_fd** %3
%6 = load i32, i32* @VIDIOC_QUERYCAP
%7 = load %struct.v4l2_capability*, %struct.v4l2_capability** %4
%8 = call i32 @v4l_named_ioctl(%struct.v4l_fd* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6, %struct.v4l2_capability* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.v4l_fd = type { i32 }
%struct.v4l2_capability = type { i32 }
@.str = [16 x i8] c"VIDIOC_QUERYCAP\00"
@VIDIOC_QUERYCAP = global i32 0
define i32 @v4l_querycap(%struct.v4l_fd* %0, %struct.v4l2_capability* %1) {
%3 = load i32, i32* @VIDIOC_QUERYCAP
%4 = tail call i32 @v4l_named_ioctl(%struct.v4l_fd* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3, %struct.v4l2_capability* %1)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  long long tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t genericsTimestampuS(void) {
  struct timeval te;
  gettimeofday(&te, NULL);
  return (te.tv_sec * 1000000LL + te.tv_usec);
}


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

x86 assembly (clang, -O2):
<genericsTimestampuS>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @genericsTimestampuS() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = add nsw i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @genericsTimestampuS() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}
/* Type definitions */
struct nouveau_pushbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ PUSH_DATA(struct nouveau_pushbuf *, int);
int /*<<< orphan*/ PUSH_SPACE(struct nouveau_pushbuf *, int);
void BEGIN_NV04(struct nouveau_pushbuf *push, int subc, int mthd, int size) {
  PUSH_SPACE(push, size + 1);
  PUSH_DATA(push, 0x00000000 | (size << 18) | (subc << 13) | mthd);
}


x86 assembly (clang, -O0):
<BEGIN_NV04>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
call   1040 <PUSH_SPACE@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
shl    $0x12,%esi
or     $0x0,%esi
mov    -0xc(%rbp),%eax
shl    $0xd,%eax
or     %eax,%esi
or     -0x10(%rbp),%esi
call   1030 <PUSH_DATA@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BEGIN_NV04>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
lea    0x1(%rbx),%esi
call   1040 <PUSH_SPACE@plt>
shl    $0x12,%ebx
shl    $0xd,%ebp
or     %r14d,%ebp
or     %ebx,%ebp
mov    %r15,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <PUSH_DATA@plt>

LLVM IR (-O0):
%struct.nouveau_pushbuf = type { i32 }
define void @BEGIN_NV04(%struct.nouveau_pushbuf* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.nouveau_pushbuf*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.nouveau_pushbuf* %0, %struct.nouveau_pushbuf** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.nouveau_pushbuf*, %struct.nouveau_pushbuf** %5
%10 = load i32, i32* %8
%11 = add nsw i32 %10, 1
%12 = call i32 @PUSH_SPACE(%struct.nouveau_pushbuf* %9, i32 %11)
%13 = load %struct.nouveau_pushbuf*, %struct.nouveau_pushbuf** %5
%14 = load i32, i32* %8
%15 = shl i32 %14, 18
%16 = or i32 0, %15
%17 = load i32, i32* %6
%18 = shl i32 %17, 13
%19 = or i32 %16, %18
%20 = load i32, i32* %7
%21 = or i32 %19, %20
%22 = call i32 @PUSH_DATA(%struct.nouveau_pushbuf* %13, i32 %21)
ret void
}

LLVM IR (-O2):
%struct.nouveau_pushbuf = type { i32 }
define void @BEGIN_NV04(%struct.nouveau_pushbuf* %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %3, 1
%6 = tail call i32 @PUSH_SPACE(%struct.nouveau_pushbuf* %0, i32 %5)
%7 = shl i32 %3, 18
%8 = shl i32 %1, 13
%9 = or i32 %8, %2
%10 = or i32 %9, %7
%11 = tail call i32 @PUSH_DATA(%struct.nouveau_pushbuf* %0, i32 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ as3_error(char *, char *);
int a3_error(char *s) {
  as3_error("%s", s);
  return 0;
}


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

x86 assembly (clang, -O2):
<a3_error>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <as3_error@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @a3_error(i8* %0) {
%2 = tail call i32 @as3_error(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ safe_close(int);
void closep(int *fd) { safe_close(*fd); }


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

x86 assembly (clang, -O2):
<closep>:
mov    (%rdi),%edi
jmp    1030 <safe_close@plt>

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

LLVM IR (-O2):
define void @closep(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @safe_close(i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *int2str(int i) {
  char *str;
  str = (char *)malloc(25 * sizeof(char));
  sprintf(str, "%d", i);
  return str;
}


x86 assembly (clang, -O0):
<int2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x19,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2str>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x19,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i8* @int2str(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i64 @malloc(i32 25)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @int2str(i32 %0) {
%2 = tail call i64 @malloc(i32 25)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %3
}
const char *hw_get_device_model_name(void) { return "Unknown device"; }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Unknown device\00"
define i8* @hw_get_device_model_name() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"Unknown device\00"
define i8* @hw_get_device_model_name() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ FP_NORMAL;
scalar_t__ fpclassify(double);
int isnormal(double x) { return fpclassify(x) == FP_NORMAL; }


x86 assembly (clang, -O0):
<isnormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fpclassify@plt>
mov    0x2ec2(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnormal>:
push   %rax
call   1030 <fpclassify@plt>
mov    0x2ed3(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FP_NORMAL = global i64 0
define i32 @isnormal(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @fpclassify(double %3)
%5 = load i64, i64* @FP_NORMAL
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@FP_NORMAL = global i64 0
define i32 @isnormal(double %0) {
%2 = tail call i64 @fpclassify(double %0)
%3 = load i64, i64* @FP_NORMAL
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d\n", EOF); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t USBLPMEndpointGet(uint32_t ui32Base) {
  uint32_t ui32Endpoint;
  ASSERT(ui32Base == 0x40050000);
  ui32Endpoint =
      ((*((volatile uint16_t *)(ui32Base + 0x00000360))) & 0x0000F000) >> 12;
  return (((ui32Endpoint) << 4));
}


x86 assembly (clang, -O0):
<USBLPMEndpointGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x360,%eax
cltq
mov    (%rax),%eax
and    $0xf000,%eax
sar    $0xc,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBLPMEndpointGet>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x360(%rax),%eax
shr    $0x8,%eax
and    $0xf0,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @USBLPMEndpointGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1074069504
%6 = zext i1 %5 to i32
%7 = call i32 @ASSERT(i32 %6)
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 864
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = and i32 %12, 61440
%14 = ashr i32 %13, 12
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = shl i32 %15, 4
ret i32 %16
}

LLVM IR (-O2):
define i32 @USBLPMEndpointGet(i32 %0) {
%2 = icmp eq i32 %0, 1074069504
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 864
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = lshr i32 %8, 8
%10 = and i32 %9, 240
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpackhi_epi32(int /*<<< orphan*/ const,
                                      int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_unpacklo_epi32(int /*<<< orphan*/ const,
                                      int /*<<< orphan*/ const);
void extend_64bit(const __m128i in, __m128i *const out) {
  out[0] = _mm_unpacklo_epi32(in, in);
  out[1] = _mm_unpackhi_epi32(in, in);
}


x86 assembly (clang, -O0):
<extend_64bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <_mm_unpacklo_epi32@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <_mm_unpackhi_epi32@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extend_64bit>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %edi,%esi
call   1030 <_mm_unpacklo_epi32@plt>
mov    %eax,(%rbx)
mov    %ebp,%edi
mov    %ebp,%esi
call   1040 <_mm_unpackhi_epi32@plt>
mov    %eax,0x4(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @extend_64bit(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @_mm_unpacklo_epi32(i32 %5, i32 %6)
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @_mm_unpackhi_epi32(i32 %10, i32 %11)
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @extend_64bit(i32 %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @_mm_unpacklo_epi32(i32 %0, i32 %0)
store i32 %3, i32* %1
%4 = tail call i32 @_mm_unpackhi_epi32(i32 %0, i32 %0)
%5 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
int mask(int);
void fill_buff(int data[], int items) {
  int i;
  for (i = 0; i < items; i++)
    data[i] = mask(i);
}


x86 assembly (clang, -O0):
<fill_buff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1155 <fill_buff+0x45>
mov    -0x10(%rbp),%edi
call   1030 <mask@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fill_buff+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_buff>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <fill_buff+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <mask@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <fill_buff+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @fill_buff(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = trunc i64 %7 to i32
%9 = tail call i32 @mask(i32 %8)
%10 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %9, i32* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
char *getenv(const char *name) {
  printf("# %s environment variable\n", name);
  printf("ENV:%s=\"@@\"\n", name);
  printf("# End of %s section\n\n", name);
  return NULL;
}


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

x86 assembly (clang, -O2):
<getenv>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"# %s environment variable\0A\00"
@.str.1 = [13 x i8] c"ENV:%s=\22@@\22\0A\00"
@.str.2 = [22 x i8] c"# End of %s section\0A\0A\00"
define i8* @getenv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i8* null
}

LLVM IR (-O2):
@.str = [27 x i8] c"# %s environment variable\0A\00"
@.str.1 = [13 x i8] c"ENV:%s=\22@@\22\0A\00"
@.str.2 = [22 x i8] c"# End of %s section\0A\0A\00"
define noalias i8* @getenv(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret i8* null
}
void TRACE_ALLOC_ERR(const char *const msg) {}


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

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

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

LLVM IR (-O2):
define void @TRACE_ALLOC_ERR(i8* nocapture %0) {
ret void
}
int test_imm_66uint8_reg(unsigned char val) {
  return ((val) & (-0x66 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_66uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -102
%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_66uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -102
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef char wchar_t;

/* Variables and functions */
char ft_utf8chrencode(char);
void ft_utf8wencode(wchar_t *wstr) {
  while (*wstr != '\0') {
    *wstr = ft_utf8chrencode(*wstr);
    wstr++;
  }
}


x86 assembly (clang, -O0):
<ft_utf8wencode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <ft_utf8wencode+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <ft_utf8chrencode@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <ft_utf8wencode+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_utf8wencode>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <ft_utf8wencode+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ft_utf8chrencode@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ft_utf8wencode+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_utf8wencode(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 i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @ft_utf8chrencode(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int getpid();
int md_gseed(void) { return (getpid()); }


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

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

LLVM IR (-O0):
define i32 @md_gseed() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @md_gseed() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
void mpz8_clear(mpz_t z[8]) {
  int i;
  for (i = 0; i < 8; i++) {
    mpz_clear(z[i]);
  }
}


x86 assembly (clang, -O0):
<mpz8_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    114b <mpz8_clear+0x3b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <mpz_clear@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <mpz8_clear+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpz8_clear>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <mpz_clear@plt>
mov    0x4(%rbx),%edi
call   1030 <mpz_clear@plt>
mov    0x8(%rbx),%edi
call   1030 <mpz_clear@plt>
mov    0xc(%rbx),%edi
call   1030 <mpz_clear@plt>
mov    0x10(%rbx),%edi
call   1030 <mpz_clear@plt>
mov    0x14(%rbx),%edi
call   1030 <mpz_clear@plt>
mov    0x18(%rbx),%edi
call   1030 <mpz_clear@plt>
mov    0x1c(%rbx),%edi
pop    %rbx
jmp    1030 <mpz_clear@plt>

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

LLVM IR (-O2):
define void @mpz8_clear(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @mpz_clear(i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = tail call i32 @mpz_clear(i32 %5)
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = tail call i32 @mpz_clear(i32 %8)
%10 = getelementptr inbounds i32, i32* %0, i64 3
%11 = load i32, i32* %10
%12 = tail call i32 @mpz_clear(i32 %11)
%13 = getelementptr inbounds i32, i32* %0, i64 4
%14 = load i32, i32* %13
%15 = tail call i32 @mpz_clear(i32 %14)
%16 = getelementptr inbounds i32, i32* %0, i64 5
%17 = load i32, i32* %16
%18 = tail call i32 @mpz_clear(i32 %17)
%19 = getelementptr inbounds i32, i32* %0, i64 6
%20 = load i32, i32* %19
%21 = tail call i32 @mpz_clear(i32 %20)
%22 = getelementptr inbounds i32, i32* %0, i64 7
%23 = load i32, i32* %22
%24 = tail call i32 @mpz_clear(i32 %23)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stderr;
void handlerChangeHnd(const char *msgName, int num, void *clientData) {
  fprintf(stderr, "HANDLER CHANGE: %s: %d\n", msgName, num);
}


x86 assembly (clang, -O0):
<handlerChangeHnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handlerChangeHnd>:
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"HANDLER CHANGE: %s: %d\0A\00"
define void @handlerChangeHnd(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"HANDLER CHANGE: %s: %d\0A\00"
define void @handlerChangeHnd(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XMapEvent;

/* Variables and functions */
int get_XMapEvent_type(void *_p) { return (int)((XMapEvent *)_p)->type; }


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

x86 assembly (clang, -O2):
<get_XMapEvent_type>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XMapEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XMapEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int dcloadsyscall(int, int);
int close(int file) {
  if (*(unsigned int *)0x8c004004 == 0xdeadbeef)
    return dcloadsyscall(3, file);
  else
    return -1;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    1141 <close+0x31>
mov    -0x8(%rbp),%esi
mov    $0x3,%edi
call   1030 <dcloadsyscall@plt>
mov    %eax,-0x4(%rbp)
jmp    1148 <close+0x38>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    1129 <close+0x19>
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <dcloadsyscall@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%5 = icmp eq i32 %4, -559038737
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @dcloadsyscall(i32 3, i32 %7)
store i32 %8, i32* %2
br label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%3 = icmp eq i32 %2, -559038737
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @dcloadsyscall(i32 3, i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
double dnrm2_(int *, double *, int *);
double vbnorm2(int sz, double *a) {
  int tmp = 1;
  return dnrm2_(&(sz), (a), &(tmp)) / (double)sz;
}


x86 assembly (clang, -O0):
<vbnorm2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
call   1030 <dnrm2_@plt>
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vbnorm2>:
push   %rax
mov    %edi,(%rsp)
movl   $0x1,0x4(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rdx
call   1030 <dnrm2_@plt>
cvtsi2sdl (%rsp),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @vbnorm2(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
store i32 1, i32* %5
%6 = load double*, double** %4
%7 = call double @dnrm2_(i32* %3, double* %6, i32* %5)
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = fdiv double %7, %9
ret double %10
}

LLVM IR (-O2):
define double @vbnorm2(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = bitcast i32* %4 to i8*
store i32 1, i32* %4
%6 = call double @dnrm2_(i32* %3, double* %1, i32* %4)
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = fdiv double %6, %8
ret double %9
}
int test_imm_9Dint64_midword_reg(long long val) {
  return ((val >> 16) & (0x9D << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Dint64_midword_reg>:
test   $0x9d0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Dint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 157
%6 = icmp ne i64 %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_9Dint64_midword_reg(i64 %0) {
%2 = and i64 %0, 10289152
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void main() { int32_t a; }


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

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
void wmf_raise_window(int id) { id = id; }


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

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

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

LLVM IR (-O2):
define void @wmf_raise_window(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char const);
int my_putstr(char const *str) {
  int i;
  i = 0;
  while (str[i] != '\0') {
    my_putchar(str[i]);
    i++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<my_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <my_putstr+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <my_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <my_putstr+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <my_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <my_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <my_putstr+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @my_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @my_putchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *basename(const char *path) {
  const char *p = strrchr(path, '/');
  return (p != NULL) ? p + 1 : path;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Type definitions */
struct dlist_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dlist_push_front(struct dlist_head *, struct dlist_head *);
int /*<<< orphan*/ sys_dlist_del_node(struct dlist_head *);
void dlist_move_to_front(struct dlist_head *node, struct dlist_head *head) {
  sys_dlist_del_node(node);
  dlist_push_front(node, head);
}


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

x86 assembly (clang, -O2):
<dlist_move_to_front>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <sys_dlist_del_node@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <dlist_push_front@plt>

LLVM IR (-O0):
%struct.dlist_head = type { i32 }
define void @dlist_move_to_front(%struct.dlist_head* %0, %struct.dlist_head* %1) {
%3 = alloca %struct.dlist_head*
%4 = alloca %struct.dlist_head*
store %struct.dlist_head* %0, %struct.dlist_head** %3
store %struct.dlist_head* %1, %struct.dlist_head** %4
%5 = load %struct.dlist_head*, %struct.dlist_head** %3
%6 = call i32 @sys_dlist_del_node(%struct.dlist_head* %5)
%7 = load %struct.dlist_head*, %struct.dlist_head** %3
%8 = load %struct.dlist_head*, %struct.dlist_head** %4
%9 = call i32 @dlist_push_front(%struct.dlist_head* %7, %struct.dlist_head* %8)
ret void
}

LLVM IR (-O2):
%struct.dlist_head = type { i32 }
define void @dlist_move_to_front(%struct.dlist_head* %0, %struct.dlist_head* %1) {
%3 = tail call i32 @sys_dlist_del_node(%struct.dlist_head* %0)
%4 = tail call i32 @dlist_push_front(%struct.dlist_head* %0, %struct.dlist_head* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(void *, void const *, size_t);
void(elf_cvt_Byte)(void *dest, const void *src, size_t n,
                   int encode __attribute__((unused))) {
  memmove(dest, src, n);
}


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

x86 assembly (clang, -O2):
<elf_cvt_Byte>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define void @elf_cvt_Byte(i8* %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @memmove(i8* %0, i8* %1, i64 %2)
ret void
}