xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, int);
void exitfunc12(int status, void *arg) {
  printf("Executing exitfunc12 (status=%d, arg=%d)\n", status, (int)arg);
  exit((int)arg);
}


x86 assembly (clang, -O0):
<exitfunc12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc12>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Executing exitfunc12 (status=%d, arg=%d)\0A\00"
define void @exitfunc12(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i32
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"Executing exitfunc12 (status=%d, arg=%d)\0A\00"
define void @exitfunc12(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %4)
%6 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void callback(int value) {
  printf("C-callback invoked with value: %d\n", value);
}


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

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

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

LLVM IR (-O2):
@.str = [35 x i8] c"C-callback invoked with value: %d\0A\00"
define void @callback(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int _dl_parse_copy_information(struct dyn_elf *rpnt, unsigned long rel_addr,
                               unsigned long rel_size) {
  return 0;
}


x86 assembly (clang, -O0):
<_dl_parse_copy_information>:
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):
<_dl_parse_copy_information>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.dyn_elf = type opaque
define i32 @_dl_parse_copy_information(%struct.dyn_elf* %0, i64 %1, i64 %2) {
%4 = alloca %struct.dyn_elf*
%5 = alloca i64
%6 = alloca i64
store %struct.dyn_elf* %0, %struct.dyn_elf** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
%struct.dyn_elf = type opaque
define i32 @_dl_parse_copy_information(%struct.dyn_elf* nocapture readnone %0, i64 %1, i64 %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __gnuc_va_list;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ vwarn(char const *, int /*<<< orphan*/);
void verr(int status, const char *format, __gnuc_va_list ap) {
  vwarn(format, ap);
  exit(status);
}


x86 assembly (clang, -O0):
<verr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <vwarn@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<verr>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <vwarn@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @verr(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 @vwarn(i8* %7, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
define void @verr(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @vwarn(i8* %1, i32 %2)
%5 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ DH;

/* Variables and functions */
int /*<<< orphan*/ DH_up_ref(int /*<<< orphan*/ *);
int EVP_PKEY_assign_DH(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int EVP_PKEY_set1_DH(EVP_PKEY *pkey, DH *key) {
  int ret = EVP_PKEY_assign_DH(pkey, key);
  if (ret != 0)
    DH_up_ref(key);
  return ret;
}


x86 assembly (clang, -O0):
<EVP_PKEY_set1_DH>:
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   1030 <EVP_PKEY_assign_DH@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1153 <EVP_PKEY_set1_DH+0x33>
mov    -0x10(%rbp),%rdi
call   1040 <DH_up_ref@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_PKEY_set1_DH>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <EVP_PKEY_assign_DH@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1139 <EVP_PKEY_set1_DH+0x19>
mov    %rbx,%rdi
call   1040 <DH_up_ref@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @EVP_PKEY_set1_DH(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = call i32 @EVP_PKEY_assign_DH(i32* %6, i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32*, i32** %4
%13 = call i32 @DH_up_ref(i32* %12)
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @EVP_PKEY_set1_DH(i32* %0, i32* %1) {
%3 = tail call i32 @EVP_PKEY_assign_DH(i32* %0, i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @DH_up_ref(i32* %1)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
int byte_col_big5(int byte) {
  if (byte >= 0x40 && byte < 0x7f)
    return byte - 0x40;
  else if (byte >= 0xa1 && byte < 0xff)
    return byte - 0x62;
  else
    return -1;
}


x86 assembly (clang, -O0):
<byte_col_big5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x40,-0x8(%rbp)
jl     1129 <byte_col_big5+0x29>
cmpl   $0x7f,-0x8(%rbp)
jge    1129 <byte_col_big5+0x29>
mov    -0x8(%rbp),%eax
sub    $0x40,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <byte_col_big5+0x58>
cmpl   $0xa1,-0x8(%rbp)
jl     1151 <byte_col_big5+0x51>
cmpl   $0xff,-0x8(%rbp)
jge    1151 <byte_col_big5+0x51>
mov    -0x8(%rbp),%eax
sub    $0x62,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <byte_col_big5+0x58>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_col_big5>:
lea    -0xa1(%rdi),%eax
lea    -0x62(%rdi),%ecx
cmp    $0x5e,%eax
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
lea    -0x40(%rdi),%ecx
cmp    $0x3f,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @byte_col_big5(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 64
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 127
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 64
store i32 %11, i32* %2
br label %22
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 161
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 255
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 98
store i32 %20, i32* %2
br label %22
21: ; preds = %15, %12
store i32 -1, i32* %2
br label %22
22: ; preds = %21, %18, %9
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @byte_col_big5(i32 %0) {
%2 = add i32 %0, -64
%3 = icmp ult i32 %2, 63
%4 = add i32 %0, -161
%5 = icmp ult i32 %4, 94
%6 = add nsw i32 %0, -98
%7 = select i1 %5, i32 %6, i32 -1
%8 = select i1 %3, i32 %2, i32 %7
ret i32 %8
}
int f(int x) {
  switch (x) {
  case 1:
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
jne    1124 <f+0x24>
jmp    1118 <f+0x18>
movl   $0x2,-0x4(%rbp)
jmp    112b <f+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
add    %eax,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 1, label %5
]
5: ; preds = %1
store i32 2, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 2, i32 0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ MRF24_Read_Long(unsigned int);
void MRF24_Write_Long(unsigned int data) { MRF24_Read_Long(data | 0x1000); }


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

x86 assembly (clang, -O2):
<MRF24_Write_Long>:
or     $0x1000,%edi
jmp    1030 <MRF24_Read_Long@plt>

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

LLVM IR (-O2):
define void @MRF24_Write_Long(i32 %0) {
%2 = or i32 %0, 4096
%3 = tail call i32 @MRF24_Read_Long(i32 %2)
ret void
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double fmod(double, double);
double pop(struct lifo *);
double opr_mod(struct lifo *stack) {
  double op1, op2;
  op1 = pop(stack);
  op2 = pop(stack);
  return fmod(op2, op1);
}


x86 assembly (clang, -O0):
<opr_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <fmod@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opr_mod>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <pop@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <pop@plt>
movsd  0x8(%rsp),%xmm1
add    $0x10,%rsp
pop    %rbx
jmp    1030 <fmod@plt>

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_mod(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
%4 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%5 = load %struct.lifo*, %struct.lifo** %2
%6 = call double @pop(%struct.lifo* %5)
store double %6, double* %3
%7 = load %struct.lifo*, %struct.lifo** %2
%8 = call double @pop(%struct.lifo* %7)
store double %8, double* %4
%9 = load double, double* %4
%10 = load double, double* %3
%11 = call double @fmod(double %9, double %10)
ret double %11
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_mod(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call double @pop(%struct.lifo* %0)
%4 = tail call double @fmod(double %3, double %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void slot_del(void *entry) { free(entry); }


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

x86 assembly (clang, -O2):
<slot_del>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @slot_del(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int doComputation(int, double);
int /*<<< orphan*/ logDebug(char);
int /*<<< orphan*/ max(int, int);
int main() {
  int a = doComputation(5, 7.0);
  int b = 5;
  max(a, b);
  logDebug('!');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
movsd  0xeb4(%rip),%xmm0
call   1040 <doComputation@plt>
mov    %eax,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <max@plt>
mov    $0x21,%edi
call   1050 <logDebug@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
mov    $0x5,%edi
call   1040 <doComputation@plt>
mov    %eax,%edi
mov    $0x5,%esi
call   1030 <max@plt>
mov    $0x21,%edi
call   1050 <logDebug@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @doComputation(i32 5, double 7.000000e+00)
store i32 %4, i32* %2
store i32 5, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @max(i32 %5, i32 %6)
%8 = call i32 @logDebug(i8 signext 33)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @doComputation(i32 5, double 7.000000e+00)
%2 = tail call i32 @max(i32 %1, i32 5)
%3 = tail call i32 @logDebug(i8 signext 33)
ret i32 0
}
/* Variables and functions */
int GetNumber();
void getSquareNumbers(int squareInputnumbers[]) {
  int i;
  for (i = 0; i < 100; i++) {
    squareInputnumbers[i] = GetNumber();
  }
}


x86 assembly (clang, -O0):
<getSquareNumbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    114f <getSquareNumbers+0x3f>
mov    $0x0,%al
call   1030 <GetNumber@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <getSquareNumbers+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSquareNumbers>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <GetNumber@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1120 <getSquareNumbers+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @getSquareNumbers(i32* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %6, %2 ]
%4 = tail call i32 (...) @GetNumber()
%5 = getelementptr inbounds i32, i32* %0, i64 %3
store i32 %4, i32* %5
%6 = add nuw nsw i64 %3, 1
%7 = icmp eq i64 %6, 100
br i1 %7, label %8, label %2
8: ; preds = %2
ret void
}
int main() {
  int x = 0x100 * 0x100;
  int y = 0x100 * 0x80;
  return x * y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x10000,-0x8(%rbp)
movl   $0x8000,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x80000000,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 65536, i32* %2
store i32 32768, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = mul nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 -2147483648
}
void radar9171946() {
  if (0) {
    0 / (0 ? 1 : 0);
  }
}


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

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

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

LLVM IR (-O2):
define void @radar9171946() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *prog) {
  printf("usage: %s [-V] <directories>\n", prog);
  printf("  -V: Print the version to stdout\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"usage: %s [-V] <directories>\0A\00"
@.str.1 = [35 x i8] c" -V: Print the version to stdout\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [30 x i8] c"usage: %s [-V] <directories>\0A\00"
@str = [34 x i8] c" -V: Print the version to stdout\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ GPIO_WRITE(int, int);
void write_gpio(int port, int n) { GPIO_WRITE(port, n); }


x86 assembly (clang, -O0):
<write_gpio>:
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 <GPIO_WRITE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_gpio>:
jmp    1030 <GPIO_WRITE@plt>

LLVM IR (-O0):
define void @write_gpio(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 @GPIO_WRITE(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @write_gpio(i32 %0, i32 %1) {
%3 = tail call i32 @GPIO_WRITE(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vcross(double *, double *, double *);
double vnorm(double *);
double vcrossnorm(double v1i[3], double v2i[3], double vr[3]) {
  vcross(v1i, v2i, vr);
  return vnorm(vr);
}


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

x86 assembly (clang, -O2):
<vcrossnorm>:
push   %rbx
mov    %rdx,%rbx
call   1030 <vcross@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <vnorm@plt>

LLVM IR (-O0):
define double @vcrossnorm(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = load double*, double** %5
%9 = load double*, double** %6
%10 = call i32 @vcross(double* %7, double* %8, double* %9)
%11 = load double*, double** %6
%12 = call double @vnorm(double* %11)
ret double %12
}

LLVM IR (-O2):
define double @vcrossnorm(double* %0, double* %1, double* %2) {
%4 = tail call i32 @vcross(double* %0, double* %1, double* %2)
%5 = tail call double @vnorm(double* %2)
ret double %5
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
char returned_type(const char *cmd) {
  if (strcmp(cmd, "-int") == 0)
    return 0x01;
  else if (strcmp(cmd, "-str") == 0)
    return 0x02;
  else
    return 0x00;
}


x86 assembly (clang, -O0):
<returned_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    113f <returned_type+0x2f>
movb   $0x1,-0x1(%rbp)
jmp    1166 <returned_type+0x56>
mov    -0x10(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1162 <returned_type+0x52>
movb   $0x2,-0x1(%rbp)
jmp    1166 <returned_type+0x56>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<returned_type>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     113e <returned_type+0x2e>
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
sete   %al
add    %al,%al
pop    %rbx
ret
mov    $0x1,%al
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"-int\00"
@.str.1 = [5 x i8] c"-str\00"
define signext i8 @returned_type(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8 2, i8 0
br label %8
8: ; preds = %4, %1
%9 = phi i8 [ 1, %1 ], [ %7, %4 ]
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int syncfs(int fd) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<syncfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syncfs>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @syncfs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
%4 = call i32 @__set_errno(i32 %3)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @syncfs(i32 %0) {
%2 = load i32, i32* @ENOSYS
%3 = tail call i32 @__set_errno(i32 %2)
ret i32 -1
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ stat(char *, struct stat *);
off_t file_size(char *filename) {
  struct stat st;
  if (stat(filename, &st))
    exit(1);
  return st.st_size;
}


x86 assembly (clang, -O0):
<file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     114d <file_size+0x2d>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
jne    1133 <file_size+0x13>
mov    (%rsp),%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_size(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
ret i32 %10
}
/* Variables and functions */
double glmComputeVectorLength4d(double *);
int /*<<< orphan*/ glmMakeVector4d(double *, double const *, double const *);
double glmComputeDistance4d(const double p1[4], const double p2[4]) {
  double d[4];
  glmMakeVector4d(d, p1, p2);
  return glmComputeVectorLength4d(d);
}


x86 assembly (clang, -O0):
<glmComputeDistance4d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <glmMakeVector4d@plt>
lea    -0x30(%rbp),%rdi
call   1040 <glmComputeVectorLength4d@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeDistance4d>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <glmMakeVector4d@plt>
mov    %rbx,%rdi
call   1040 <glmComputeVectorLength4d@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @glmComputeDistance4d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [4 x double]
store double* %0, double** %3
store double* %1, double** %4
%6 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%7 = load double*, double** %3
%8 = load double*, double** %4
%9 = call i32 @glmMakeVector4d(double* %6, double* %7, double* %8)
%10 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%11 = call double @glmComputeVectorLength4d(double* %10)
ret double %11
}

LLVM IR (-O2):
define double @glmComputeDistance4d(double* %0, double* %1) {
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %3 to i8*
%5 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%6 = call i32 @glmMakeVector4d(double* %5, double* %0, double* %1)
%7 = call double @glmComputeVectorLength4d(double* %5)
ret double %7
}
int test_imm_2Dint16_reg(short val) {
  return ((val) & (0x2D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Dint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x2d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_2Dint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 45
%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_2Dint16_reg(i16 signext %0) {
%2 = and i16 %0, 45
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ a();
void c() { a(); }


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

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

LLVM IR (-O0):
define void @c() {
%1 = call i32 (...) @a()
ret void
}

LLVM IR (-O2):
define void @c() {
%1 = tail call i32 (...) @a()
ret void
}
/* Variables and functions */
int chdir(char const *);
int _chdir(const char *path) { return chdir(path); }


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

x86 assembly (clang, -O2):
<_chdir>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define i32 @_chdir(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int detach_tty(void) {
  int retval = fork();
  if (retval == -1)
    return -1;
  if (retval > 0) {
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<detach_tty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1148 <detach_tty+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <detach_tty+0x40>
cmpl   $0x0,-0x8(%rbp)
jle    1159 <detach_tty+0x39>
xor    %edi,%edi
call   1030 <exit@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detach_tty>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <fork@plt>
cmp    $0xffffffff,%eax
je     113a <detach_tty+0x1a>
test   %eax,%eax
jle    113f <detach_tty+0x1f>
xor    %edi,%edi
call   1030 <exit@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @detach_tty() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @fork()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %13
7: ; preds = %0
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %7
store i32 0, i32* %1
br label %13
13: ; preds = %12, %6
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @detach_tty() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, -1
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3, %0
%8 = phi i32 [ -1, %0 ], [ 0, %3 ]
ret i32 %8
}
__attribute__((always_)) struct pci_dev *pci_physfn(struct pci_dev *dev) {
  return dev;
}


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

x86 assembly (clang, -O2):
<pci_physfn>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define %struct.pci_dev* @pci_physfn(%struct.pci_dev* readnone returned %0) {
ret %struct.pci_dev* %0
}
void bit_set(unsigned char *set, unsigned bit) {
  set[bit / 8] |= 1 << (bit % 8);
}


x86 assembly (clang, -O0):
<bit_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_set>:
mov    %esi,%eax
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
shr    $0x3,%rax
or     %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @bit_set(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = urem i32 %5, 8
%7 = shl i32 1, %6
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = udiv i32 %9, 8
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = or i32 %14, %7
%16 = trunc i32 %15 to i8
store i8 %16, i8* %12
ret void
}

LLVM IR (-O2):
define void @bit_set(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl nuw nsw i32 1, %3
%5 = lshr i32 %1, 3
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %4 to i8
%10 = or i8 %8, %9
store i8 %10, i8* %7
ret void
}
int ls_costN_nm9_n_out(void) { return 2; }


x86 assembly (clang, -O0):
<ls_costN_nm9_n_out>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm9_n_out>:
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @ls_costN_nm9_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_costN_nm9_n_out() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num;
  printf("Num = = %d", num);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"Num = = %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ManualControlSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void ManualControlSettingsRequestUpdate() {
  UAVObjRequestUpdate(ManualControlSettingsHandle());
}


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

x86 assembly (clang, -O2):
<ManualControlSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <ManualControlSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @ManualControlSettingsRequestUpdate() {
%1 = call i32 (...) @ManualControlSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @ManualControlSettingsRequestUpdate() {
%1 = tail call i32 (...) @ManualControlSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t clearBit_fun_uint8_t(uint8_t x, uint32_t i) { return x & ~(1 << i); }


x86 assembly (clang, -O0):
<clearBit_fun_uint8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @clearBit_fun_uint8_t(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 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @clearBit_fun_uint8_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x8a() {
  Assert_real((isgraph(138) == 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_isgraph.c",
              695, ("isgraph should be 0 for 0x8a"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0x8a>:
push   %rax
mov    $0x8a,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2b7,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x8a\00"
define void @t_isgraph_0x8a() {
%1 = call i64 @isgraph(i32 138)
%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 695, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x8a\00"
define void @t_isgraph_0x8a() {
%1 = tail call i64 @isgraph(i32 138)
%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 695, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
  int st_nlink;
  int /*<<< orphan*/ st_gid;
  int /*<<< orphan*/ st_uid;
};

/* Variables and functions */
int S_IFREG;
int /*<<< orphan*/ getgid();
int /*<<< orphan*/ getuid();
void stat_make_file(struct stat *st) {
  st->st_mode = S_IFREG | 0644;
  st->st_uid = getuid();
  st->st_gid = getgid();
  st->st_nlink = 1;
}


x86 assembly (clang, -O0):
<stat_make_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%ecx
or     $0x1a4,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    $0x0,%al
call   1040 <getgid@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat_make_file>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    $0x1a4,%ecx
or     (%rax),%ecx
mov    %ecx,(%rdi)
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,0xc(%rbx)
xor    %eax,%eax
call   1040 <getgid@plt>
mov    %eax,0x8(%rbx)
movl   $0x1,0x4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32, i32, i32, i32 }
@S_IFREG = global i32 0
define void @stat_make_file(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load i32, i32* @S_IFREG
%4 = or i32 %3, 420
%5 = load %struct.stat*, %struct.stat** %2
%6 = getelementptr inbounds %struct.stat, %struct.stat* %5, i32 0, i32 0
store i32 %4, i32* %6
%7 = call i32 (...) @getuid()
%8 = load %struct.stat*, %struct.stat** %2
%9 = getelementptr inbounds %struct.stat, %struct.stat* %8, i32 0, i32 3
store i32 %7, i32* %9
%10 = call i32 (...) @getgid()
%11 = load %struct.stat*, %struct.stat** %2
%12 = getelementptr inbounds %struct.stat, %struct.stat* %11, i32 0, i32 2
store i32 %10, i32* %12
%13 = load %struct.stat*, %struct.stat** %2
%14 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 1
store i32 1, i32* %14
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32, i32, i32, i32 }
@S_IFREG = global i32 0
define void @stat_make_file(%struct.stat* nocapture writeonly %0) {
%2 = load i32, i32* @S_IFREG
%3 = or i32 %2, 420
%4 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 0
store i32 %3, i32* %4
%5 = tail call i32 (...) @getuid()
%6 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 3
store i32 %5, i32* %6
%7 = tail call i32 (...) @getgid()
%8 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 2
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.stat, %struct.stat* %0, i64 0, i32 1
store i32 1, i32* %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct ndarray {
  int dummy;
};
typedef int int8_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ *stdlib_ndarray_get_ptr(struct ndarray const *,
                                           int /*<<< orphan*/ const *);
int stdlib_ndarray_set_ptr_bool(int /*<<< orphan*/ *, int const);
int8_t stdlib_ndarray_set_bool(const struct ndarray *arr, const int64_t *sub,
                               const bool v) {
  uint8_t *idx = stdlib_ndarray_get_ptr(arr, sub);
  if (idx == NULL) {
    return -1;
  }
  return stdlib_ndarray_set_ptr_bool(idx, v);
}


x86 assembly (clang, -O0):
<stdlib_ndarray_set_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <stdlib_ndarray_get_ptr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115b <stdlib_ndarray_set_bool+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <stdlib_ndarray_set_bool+0x4a>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <stdlib_ndarray_set_ptr_bool@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_ndarray_set_bool>:
push   %rbx
mov    %edx,%ebx
call   1040 <stdlib_ndarray_get_ptr@plt>
test   %rax,%rax
je     1138 <stdlib_ndarray_set_bool+0x18>
mov    %rax,%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <stdlib_ndarray_set_ptr_bool@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ndarray = type { i32 }
define i32 @stdlib_ndarray_set_bool(%struct.ndarray* %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.ndarray*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
store %struct.ndarray* %0, %struct.ndarray** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%9 = load %struct.ndarray*, %struct.ndarray** %5
%10 = load i32*, i32** %6
%11 = call i32* @stdlib_ndarray_get_ptr(%struct.ndarray* %9, i32* %10)
store i32* %11, i32** %8
%12 = load i32*, i32** %8
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %15
14: ; preds = %3
store i32 -1, i32* %4
br label %19
15: ; preds = %3
%16 = load i32*, i32** %8
%17 = load i32, i32* %7
%18 = call i32 @stdlib_ndarray_set_ptr_bool(i32* %16, i32 %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %15, %14
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.ndarray = type { i32 }
define i32 @stdlib_ndarray_set_bool(%struct.ndarray* %0, i32* %1, i32 %2) {
%4 = tail call i32* @stdlib_ndarray_get_ptr(%struct.ndarray* %0, i32* %1)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @stdlib_ndarray_set_ptr_bool(i32* %4, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_clock_getres;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, struct timespec *);
int tst_clock_getres(clockid_t clk_id, struct timespec *res) {
  return syscall(SYS_clock_getres, clk_id, res);
}


x86 assembly (clang, -O0):
<tst_clock_getres>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_clock_getres>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ed4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@SYS_clock_getres = global i32 0
define i32 @tst_clock_getres(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* @SYS_clock_getres
%6 = load i32, i32* %3
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = call i32 @syscall(i32 %5, i32 %6, %struct.timespec* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@SYS_clock_getres = global i32 0
define i32 @tst_clock_getres(i32 %0, %struct.timespec* %1) {
%3 = load i32, i32* @SYS_clock_getres
%4 = tail call i32 @syscall(i32 %3, i32 %0, %struct.timespec* %1)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
int /*<<< orphan*/ sigsuspend(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  sigset_t set;
  sigprocmask(SIG_BLOCK, NULL, &set);
  sigsuspend(&set);
  return 0;
}


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)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x14(%rbp),%rdx
call   1030 <sigprocmask@plt>
lea    -0x14(%rbp),%rdi
call   1040 <sigsuspend@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rbx
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <sigprocmask@plt>
mov    %rbx,%rdi
call   1040 <sigsuspend@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
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* @SIG_BLOCK
%8 = call i32 @sigprocmask(i32 %7, i32* null, i32* %6)
%9 = call i32 @sigsuspend(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* @SIG_BLOCK
%6 = call i32 @sigprocmask(i32 %5, i32* null, i32* %3)
%7 = call i32 @sigsuspend(i32* %3)
ret i32 0
}
int return_int() { return 1234; }


x86 assembly (clang, -O0):
<return_int>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4d2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_int>:
mov    $0x4d2,%eax
ret

LLVM IR (-O0):
define i32 @return_int() {
ret i32 1234
}

LLVM IR (-O2):
define i32 @return_int() {
ret i32 1234
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello world\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}