xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ log_unix_error(char *);
int socket(int, int, int);
int Socket(int domain, int type, int protocol) {
  int rc;
  if ((rc = socket(domain, type, protocol)) < 0)
    log_unix_error("Socket error");
  return rc;
}


x86 assembly (clang, -O0):
<Socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <socket@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jge    1157 <Socket+0x37>
lea    0xeae(%rip),%rdi
call   1030 <log_unix_error@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Socket>:
push   %rbx
call   1040 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Socket+0x18>
lea    0xecd(%rip),%rdi
call   1030 <log_unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"Socket error\00"
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @log_unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
void gtk_menu_set_accel_group() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_set_accel_group() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: shoutr [OPTIONS]\n");
  printf("       -p\t: playlist file\n");
  printf("       -u\t: stream url\n");
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: shoutr [OPTIONS]\0A\00"
@.str.1 = [27 x i8] c" -p\09: playlist file\0A\00"
@.str.2 = [24 x i8] c" -u\09: stream url\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Usage: shoutr [OPTIONS]\00"
@str.3 = [26 x i8] c" -p\09: playlist file\00"
@str.4 = [23 x i8] c" -u\09: stream url\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
void USBHostLPMConfig(uint32_t ui32Base, uint32_t ui32ResumeTime,
                      uint32_t ui32Config) {
  ;
  ;
  ;
  (*((volatile uint16_t *)(ui32Base + 0x00000360))) =
      ui32Config | ((ui32ResumeTime - 50) / 75) << 4;
}


x86 assembly (clang, -O0):
<USBHostLPMConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    $0x32,%eax
mov    $0x4b,%esi
cltd
idiv   %esi
shl    $0x4,%eax
or     %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x360,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHostLPMConfig>:
add    $0xffffffce,%esi
movslq %esi,%rax
imul   $0x1b4e81b5,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x23,%rax
add    %ecx,%eax
shl    $0x4,%eax
or     %edx,%eax
movslq %edi,%rcx
mov    %eax,0x360(%rcx)
ret

LLVM IR (-O0):
define void @USBHostLPMConfig(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* %6
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 50
%10 = sdiv i32 %9, 75
%11 = shl i32 %10, 4
%12 = or i32 %7, %11
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 864
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %12, i32* %16
ret void
}

LLVM IR (-O2):
define void @USBHostLPMConfig(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -50
%5 = sdiv i32 %4, 75
%6 = shl nsw i32 %5, 4
%7 = or i32 %6, %2
%8 = add nsw i32 %0, 864
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store volatile i32 %7, i32* %10
ret void
}
int is_octal(char c) {
  switch (c) {
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_octal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffd0,%eax
sub    $0x7,%eax
ja     112b <is_octal+0x2b>
jmp    111f <is_octal+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1132 <is_octal+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_octal>:
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_octal(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 48, label %6
i32 49, label %6
i32 50, label %6
i32 51, label %6
i32 52, label %6
i32 53, label %6
i32 54, label %6
i32 55, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_octal(i8 signext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
void PUT_UAA16BE(void *p, unsigned short v, unsigned int i) {
  unsigned char *_p = (unsigned char *)&((unsigned short *)p)[i];
  _p[0] = (unsigned char)(v >> 8);
  _p[1] = (unsigned char)(v);
}


x86 assembly (clang, -O0):
<PUT_UAA16BE>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x1,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xa(%rbp),%ax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PUT_UAA16BE>:
mov    %edx,%eax
rol    $0x8,%si
mov    %si,(%rdi,%rax,2)
ret

LLVM IR (-O0):
define void @PUT_UAA16BE(i8* %0, i16 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i16*
%10 = load i32, i32* %6
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i16, i16* %9, i64 %11
%13 = bitcast i16* %12 to i8*
store i8* %13, i8** %7
%14 = load i16, i16* %5
%15 = zext i16 %14 to i32
%16 = ashr i32 %15, 8
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %7
%19 = getelementptr inbounds i8, i8* %18, i64 0
store i8 %17, i8* %19
%20 = load i16, i16* %5
%21 = trunc i16 %20 to i8
%22 = load i8*, i8** %7
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @PUT_UAA16BE(i8* nocapture writeonly %0, i16 zeroext %1, i32 %2) {
%4 = bitcast i8* %0 to i16*
%5 = zext i32 %2 to i64
%6 = getelementptr inbounds i16, i16* %4, i64 %5
%7 = bitcast i16* %6 to i8*
%8 = lshr i16 %1, 8
%9 = trunc i16 %8 to i8
store i8 %9, i8* %7
%10 = trunc i16 %1 to i8
%11 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %10, i8* %11
ret void
}
void handle_TTOU(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_TTOU(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
int /*<<< orphan*/ scanf(char *, int *);
double xnn(int);
int main() {
  int n;
  scanf("%d", &n);
  printf("xnn(%d) = %.2f\n", n, xnn(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <xnn@plt>
mov    -0xc(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1030 <xnn@plt>
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c"xnn(%d) = %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call double @xnn(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %4, double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c"xnn(%d) = %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%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
%5 = call double @xnn(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %4, double %5)
ret i32 0
}
/* Variables and functions */
double double64_le_read(unsigned char *);
void d2bd_read(double *buffer, int count) {
  while (--count >= 0) {
    buffer[count] = double64_le_read((unsigned char *)(buffer + count));
  };
}


x86 assembly (clang, -O0):
<d2bd_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1157 <d2bd_read+0x47>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <double64_le_read@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    111f <d2bd_read+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2bd_read>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114d <d2bd_read+0x3d>
mov    %rdi,%r14
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x2(%rbx),%r15d
lea    (%r14,%r15,8),%rdi
call   1030 <double64_le_read@plt>
movsd  %xmm0,(%r14,%r15,8)
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <d2bd_read+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @d2bd_read(double* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds double, double* %0, i64 %9
%11 = bitcast double* %10 to i8*
%12 = tail call double @double64_le_read(i8* %11)
store double %12, double* %10
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *program_name) {
  printf("\nUsage : %s psec-param-file pubkey-file privkey-file random_file\n",
         program_name);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [66 x i8] c"\0AUsage : %s psec-param-file pubkey-file privkey-file random_file\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct symbol_list {
  int dummy;
};
struct ptr_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ concat_ptr_list(struct ptr_list *, struct ptr_list **);
void concat_symbol_list(struct symbol_list *from, struct symbol_list **to) {
  concat_ptr_list((struct ptr_list *)from, (struct ptr_list **)to);
}


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

x86 assembly (clang, -O2):
<concat_symbol_list>:
jmp    1030 <concat_ptr_list@plt>

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

LLVM IR (-O2):
%struct.symbol_list = type { i32 }
%struct.ptr_list = type { i32 }
define void @concat_symbol_list(%struct.symbol_list* %0, %struct.symbol_list** %1) {
%3 = bitcast %struct.symbol_list* %0 to %struct.ptr_list*
%4 = bitcast %struct.symbol_list** %1 to %struct.ptr_list**
%5 = tail call i32 @concat_ptr_list(%struct.ptr_list* %3, %struct.ptr_list** %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, int /*<<< orphan*/ *);
void exec_shell() {
  char *shell = "/bin/bash";
  char *args[] = {shell, "-i", NULL};
  execve(shell, args, NULL);
}


x86 assembly (clang, -O0):
<exec_shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xed8(%rip),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <execve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_shell>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
mov    %rdi,(%rsp)
lea    0xee4(%rip),%rax
mov    %rax,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <execve@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/bin/bash\00"
@.str.1 = [3 x i8] c"-i\00"
define void @exec_shell() {
%1 = alloca i8*
%2 = alloca [3 x i8*]
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 0
%4 = load i8*, i8** %1
store i8* %4, i8** %3
%5 = getelementptr inbounds i8*, i8** %3, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds i8*, i8** %5, i64 1
store i8* null, i8** %6
%7 = load i8*, i8** %1
%8 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 0
%9 = call i32 @execve(i8* %7, i8** %8, i32* null)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"/bin/bash\00"
@.str.1 = [3 x i8] c"-i\00"
define void @exec_shell() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 2
store i8* null, i8** %5
%6 = call i32 @execve(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %3, i32* null)
ret void
}
/* Variables and functions */
int getScaledSize(int, double);
int /*<<< orphan*/ scaleBilinearBW(int *, int, int, int *, int, int);
void scale(int *srcImgVector, int srcImgWidth, int srcImgHeight,
           double scalePercentage, int *dstImgVector) {
  int dstImgWidth = getScaledSize(srcImgWidth, scalePercentage);
  int dstImgHeight = getScaledSize(srcImgHeight, scalePercentage);
  scaleBilinearBW(srcImgVector, srcImgWidth, srcImgHeight, dstImgVector,
                  dstImgWidth, dstImgHeight);
}


x86 assembly (clang, -O0):
<scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
call   1040 <getScaledSize@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
call   1040 <getScaledSize@plt>
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
call   1030 <scaleBilinearBW@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
movsd  %xmm0,0x8(%rsp)
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%r15
mov    %esi,%edi
call   1040 <getScaledSize@plt>
mov    %eax,%r12d
mov    %ebp,%edi
movsd  0x8(%rsp),%xmm0
call   1040 <getScaledSize@plt>
mov    %r15,%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14,%rcx
mov    %r12d,%r8d
mov    %eax,%r9d
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <scaleBilinearBW@plt>

LLVM IR (-O0):
define void @scale(i32* %0, i32 %1, i32 %2, double %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store double %3, double* %9
store i32* %4, i32** %10
%13 = load i32, i32* %7
%14 = load double, double* %9
%15 = call i32 @getScaledSize(i32 %13, double %14)
store i32 %15, i32* %11
%16 = load i32, i32* %8
%17 = load double, double* %9
%18 = call i32 @getScaledSize(i32 %16, double %17)
store i32 %18, i32* %12
%19 = load i32*, i32** %6
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = load i32*, i32** %10
%23 = load i32, i32* %11
%24 = load i32, i32* %12
%25 = call i32 @scaleBilinearBW(i32* %19, i32 %20, i32 %21, i32* %22, i32 %23, i32 %24)
ret void
}

LLVM IR (-O2):
define void @scale(i32* %0, i32 %1, i32 %2, double %3, i32* %4) {
%6 = tail call i32 @getScaledSize(i32 %1, double %3)
%7 = tail call i32 @getScaledSize(i32 %2, double %3)
%8 = tail call i32 @scaleBilinearBW(i32* %0, i32 %1, i32 %2, i32* %4, i32 %6, i32 %7)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ *display;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XEvent_xmotion_display(void *_p, void *_v) {
  ((XEvent *)_p)->xmotion.display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xmotion_display>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEvent_xmotion_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display(int *);
int /*<<< orphan*/ input(int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ swap(int *);
int main() {
  int a[10];
  input(a);
  printf("input done\n");
  swap(a);
  printf("swap done\n");
  display(a);
  printf("display done\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <input@plt>
lea    0xea1(%rip),%rdi
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1060 <swap@plt>
lea    0xe98(%rip),%rdi
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <display@plt>
lea    0xe8e(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <input@plt>
lea    0xea9(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1060 <swap@plt>
lea    0xea0(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1050 <display@plt>
lea    0xe96(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"input done\0A\00"
@.str.1 = [11 x i8] c"swap done\0A\00"
@.str.2 = [14 x i8] c"display done\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%4 = call i32 @input(i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = call i32 @swap(i32* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%10 = call i32 @display(i32* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"input done\00"
@str.3 = [10 x i8] c"swap done\00"
@str.4 = [13 x i8] c"display done\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @input(i32* %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%6 = call i32 @swap(i32* %3)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.3, i64 0, i64 0))
%8 = call i32 @display(i32* %3)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_sub(void) {
  gen_pop();
  gen_call("ccsub");
}


x86 assembly (clang, -O0):
<gen_sub>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_sub>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ccsub\00"
define void @gen_sub() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccsub\00"
define void @gen_sub() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int retval;
  int create_and_write_pipe(char *pipename);
  if (argc != 2) {
    fprintf(stderr, "usage: %s pipename\n", argv[0]);
    retval = -1;
  } else {
    retval = create_and_write_pipe(argv[1]);
  }
  return (retval);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1168 <main+0x48>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x14(%rbp)
jmp    1178 <main+0x58>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <create_and_write_pipe@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1130 <main+0x10>
mov    0x8(%rsi),%rdi
pop    %rax
jmp    1040 <create_and_write_pipe@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"usage: %s pipename\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %13)
store i32 -1, i32* %6
br label %20
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @create_and_write_pipe(i8* %18)
store i32 %19, i32* %6
br label %20
20: ; preds = %15, %9
%21 = load i32, i32* %6
ret i32 %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"usage: %s pipename\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %12
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @create_and_write_pipe(i8* %10)
br label %12
12: ; preds = %8, %4
%13 = phi i32 [ -1, %4 ], [ %11, %8 ]
ret i32 %13
}
/* Type definitions */
struct drm_file {
  int dummy;
};
struct drm_device {
  int dummy;
};

/* Variables and functions */
int drm_modctx(struct drm_device *dev, void *data, struct drm_file *file_priv) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.drm_device = type { i32 }
%struct.drm_file = type { i32 }
define i32 @drm_modctx(%struct.drm_device* %0, i8* %1, %struct.drm_file* %2) {
%4 = alloca %struct.drm_device*
%5 = alloca i8*
%6 = alloca %struct.drm_file*
store %struct.drm_device* %0, %struct.drm_device** %4
store i8* %1, i8** %5
store %struct.drm_file* %2, %struct.drm_file** %6
ret i32 0
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
%struct.drm_file = type { i32 }
define i32 @drm_modctx(%struct.drm_device* nocapture readnone %0, i8* nocapture readnone %1, %struct.drm_file* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fill_mdm();
int getsum(int, int, int, int);
int /*<<< orphan*/ matprint();
int /*<<< orphan*/ printf(char *, int);
int main() {
  fill_mdm();
  matprint();
  printf("%d", getsum(1, 2, 1, 2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <fill_mdm@plt>
mov    $0x0,%al
call   1050 <matprint@plt>
mov    $0x1,%edx
mov    $0x2,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1030 <getsum@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fill_mdm@plt>
xor    %eax,%eax
call   1050 <matprint@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <getsum@plt>
lea    0xe91(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (...) @fill_mdm()
%2 = tail call i32 (...) @matprint()
%3 = tail call i32 @getsum(i32 1, i32 2, i32 1, i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x80() {
  Assert_real((isspace(128) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              645, ("isspace should be 0 for 0x80"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x80\00"
define void @t_isspace_0x80() {
%1 = call i64 @isspace(i32 128)
%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 645, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x80\00"
define void @t_isspace_0x80() {
%1 = tail call i64 @isspace(i32 128)
%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 645, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
void *thread_function(void *arg) {
  int i;
  for (i = 0; i < 2; i++) {
    printf("Thread says hi!\n");
    sleep(1);
  }
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1171 <thread_function+0x41>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1143 <thread_function+0x13>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_function>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %edi,%edi
pop    %rbx
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Thread says hi!\0A\00"
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %11, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @sleep(i32 1)
br label %11
11: ; preds = %8
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
store i32 %13, i32* %4
br label %5
14: ; preds = %5
%15 = call i32 @pthread_exit(i32* null)
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@str = [16 x i8] c"Thread says hi!\00"
define noalias i8* @thread_function(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
long long llrintl(long double x) {
  long long retval = 0ll;
  __asm__ __volatile__("fistpll %0" : "=m"(retval) : "t"(x) : "st");
  return retval;
}


x86 assembly (clang, -O0):
<llrintl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
movq   $0x0,-0x18(%rbp)
fldt   -0x10(%rbp)
fistpll -0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llrintl>:
fldt   0x8(%rsp)
movq   $0x0,-0x8(%rsp)
fistpll -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

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

LLVM IR (-O2):
define i64 @llrintl(x86_fp80 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = load i64, i64* %2
ret i64 %4
}
const char *odp_version_api_str(void) {
  return "0"
         "."
         "0"
         "."
         "1";
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"0.0.1\00"
define i8* @odp_version_api_str() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ yywarning(char const *);
void yyerror(const char *error_message) {
  yywarning(error_message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <yywarning@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<yyerror>:
push   %rax
call   1030 <yywarning@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @yywarning(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @yyerror(i8* %0) {
%2 = tail call i32 @yywarning(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
h(double a, long double b) {
  _Static_assert(__builtin_types_compatible_p(__typeof(a + b), long double),
                 "?");
}


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

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

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

LLVM IR (-O2):
define i32 @h(double %0, x86_fp80 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo(int /*<<< orphan*/);
int main() { foo(bar()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,%edi
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
mov    %eax,%edi
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @bar()
%2 = call i32 @foo(i32 %1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 @foo(i32 %1)
ret i32 0
}
/* Type definitions */
struct buddy_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buddy_list_add_tail(struct buddy_list *,
                                       struct buddy_list *);
int /*<<< orphan*/ buddy_list_del(struct buddy_list *);
void buddy_list_move_tail(struct buddy_list *list, struct buddy_list *head) {
  buddy_list_del(list);
  buddy_list_add_tail(list, head);
}


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

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

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

LLVM IR (-O2):
%struct.buddy_list = type { i32 }
define void @buddy_list_move_tail(%struct.buddy_list* %0, %struct.buddy_list* %1) {
%3 = tail call i32 @buddy_list_del(%struct.buddy_list* %0)
%4 = tail call i32 @buddy_list_add_tail(%struct.buddy_list* %0, %struct.buddy_list* %1)
ret void
}
/* Variables and functions */
int maildir_safeopen(char const *, int, int);
int maildir_semisafeopen(const char *path, int mode, int perm) {
  return (maildir_safeopen(path, mode, perm));
}


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

x86 assembly (clang, -O2):
<maildir_semisafeopen>:
jmp    1030 <maildir_safeopen@plt>

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

LLVM IR (-O2):
define i32 @maildir_semisafeopen(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @maildir_safeopen(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void *ffsc_p(const char *fname) {
  fprintf(stderr, "%s failed in function entry sanity check\n",
          (fname ? fname : "<unknown function namn>"));
  return NULL;
}


x86 assembly (clang, -O0):
<ffsc_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <ffsc_p+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1150 <ffsc_p+0x40>
lea    0xee3(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1150 <ffsc_p+0x40>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rdx
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffsc_p>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%eax
test   %rdi,%rdi
lea    0xf06(%rip),%rdx
cmovne %rdi,%rdx
lea    0xed1(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"%s failed in function entry sanity check\0A\00"
@.str.1 = [24 x i8] c"<unknown function namn>\00"
define i8* @ffsc_p(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i8*, i8** %2
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %6
%10 = phi i8* [ %7, %6 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), %8 ]
%11 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i8* null
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"%s failed in function entry sanity check\0A\00"
@.str.1 = [24 x i8] c"<unknown function namn>\00"
define noalias i8* @ffsc_p(i8* %0) {
%2 = load i32, i32* @stderr
%3 = icmp eq i8* %0, null
%4 = select i1 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %0
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i8* null
}
int security_socket_recvmsg(struct socket *sock, struct msghdr *msg, int size,
                            int flags) {
  return 0;
}


x86 assembly (clang, -O0):
<security_socket_recvmsg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.socket = type opaque
%struct.msghdr = type opaque
define i32 @security_socket_recvmsg(%struct.socket* %0, %struct.msghdr* %1, i32 %2, i32 %3) {
%5 = alloca %struct.socket*
%6 = alloca %struct.msghdr*
%7 = alloca i32
%8 = alloca i32
store %struct.socket* %0, %struct.socket** %5
store %struct.msghdr* %1, %struct.msghdr** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct.socket = type opaque
%struct.msghdr = type opaque
define i32 @security_socket_recvmsg(%struct.socket* nocapture readnone %0, %struct.msghdr* nocapture readnone %1, i32 %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ analogWrite(int, int);
void analog_write(int pin_number, int analog_value) {
  analogWrite(pin_number, analog_value);
}


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

x86 assembly (clang, -O2):
<analog_write>:
jmp    1030 <analogWrite@plt>

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

LLVM IR (-O2):
define void @analog_write(i32 %0, i32 %1) {
%3 = tail call i32 @analogWrite(i32 %0, i32 %1)
ret void
}