xunge/DecIR huggingface dataset:
char *basename(const char *name) {
  const char *base;
  for (base = name; *name; name++) {
    if (((*name) == '/')) {
      base = name + 1;
    }
  }
  return (char *)base;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <basename+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1139 <basename+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113e <basename+0x3e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <basename+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <basename+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <basename+0x10>
test   %dl,%dl
jne    1113 <basename+0x13>
ret

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

LLVM IR (-O2):
define i8* @basename(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 47, label %6
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
long double __cabsl(long double _Complex z) {
  return __hypotl(__real__ z, __imag__ z);
}


x86 assembly (clang, -O0):
<__cabsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0x10(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
xor    %eax,%eax
call   1030 <__hypotl@plt>
mov    %eax,-0x4(%rbp)
fildl  -0x4(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cabsl>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fldt   0x40(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
xor    %eax,%eax
call   1030 <__hypotl@plt>
mov    %eax,0x24(%rsp)
fildl  0x24(%rsp)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__cabsl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%3 = load x86_fp80, x86_fp80* %2
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%5 = load x86_fp80, x86_fp80* %4
%6 = call i32 (x86_fp80, x86_fp80, ...) bitcast (i32 (...)* @__hypotl to i32 (x86_fp80, x86_fp80, ...)*)(x86_fp80 %3, x86_fp80 %5)
%7 = sitofp i32 %6 to x86_fp80
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @__cabsl({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%3 = load x86_fp80, x86_fp80* %2
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%5 = load x86_fp80, x86_fp80* %4
%6 = tail call i32 (x86_fp80, x86_fp80, ...) bitcast (i32 (...)* @__hypotl to i32 (x86_fp80, x86_fp80, ...)*)(x86_fp80 %3, x86_fp80 %5)
%7 = sitofp i32 %6 to x86_fp80
ret x86_fp80 %7
}
float celsius(float gradiFahrenheit) {
  float gradiCelsius;
  gradiCelsius = ((gradiFahrenheit - 32) / 1.8);
  return gradiCelsius;
}


x86 assembly (clang, -O0):
<celsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xef2(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius>:
addss  0xef8(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @celsius(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fsub float %4, 3.200000e+01
%6 = fpext float %5 to double
%7 = fdiv double %6, 1.800000e+00
%8 = fptrunc double %7 to float
store float %8, float* %3
%9 = load float, float* %3
ret float %9
}

LLVM IR (-O2):
define float @celsius(float %0) {
%2 = fadd float %0, -3.200000e+01
%3 = fpext float %2 to double
%4 = fdiv double %3, 1.800000e+00
%5 = fptrunc double %4 to float
ret float %5
}
void free_imatrix(int **m, long nrl, long nrh, long ncl, long nch) {
  free(m[nrl] + ncl);
  free(m + nrl);
}


x86 assembly (clang, -O0):
<free_imatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_imatrix>:
push   %rbx
lea    (%rdi,%rsi,8),%rbx
lea    0x0(,%rcx,4),%rax
add    (%rdi,%rsi,8),%rax
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_imatrix(i32** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i32*, i32** %0, i64 %1
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 %3
%9 = bitcast i32* %8 to i8*
tail call void @free(i8* %9)
%10 = bitcast i32** %6 to i8*
tail call void @free(i8* %10)
ret void
}
int compar(const void *a, const void *b) {
  return (*(int *)a > *(int *)b ? 1 : -1);
}


x86 assembly (clang, -O0):
<compar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compar>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @compar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 -1
ret i32 %13
}

LLVM IR (-O2):
define i32 @compar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = select i1 %7, i32 1, i32 -1
ret i32 %8
}
unsigned long long belongs(unsigned long long element, unsigned long long s) {
  return s & (1ULL << element);
}


x86 assembly (clang, -O0):
<belongs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<belongs>:
mov    %rdi,%rcx
mov    $0x1,%eax
shl    %cl,%rax
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @belongs(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = shl i64 1, %6
%8 = and i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @belongs(i64 %0, i64 %1) {
%3 = shl nuw i64 1, %0
%4 = and i64 %3, %1
ret i64 %4
}
void val2Grey(char *pixel, int val) {
  pixel[0] = (char)val;
  pixel[1] = (char)val;
  pixel[2] = (char)val;
}


x86 assembly (clang, -O0):
<val2Grey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<val2Grey>:
mov    %sil,(%rdi)
mov    %sil,0x1(%rdi)
mov    %sil,0x2(%rdi)
ret

LLVM IR (-O0):
define void @val2Grey(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 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i32, i32* %4
%10 = trunc i32 %9 to i8
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %10, i8* %12
%13 = load i32, i32* %4
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 %14, i8* %16
ret void
}

LLVM IR (-O2):
define void @val2Grey(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %3, i8* %4
%5 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %3, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PWM1_2_DriverIRQHandler();
__attribute__((weak)) void PWM1_2_IRQHandler(void) {
  PWM1_2_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PWM1_2_IRQHandler() {
%1 = call i32 (...) @PWM1_2_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PWM1_2_IRQHandler() {
%1 = tail call i32 (...) @PWM1_2_DriverIRQHandler()
ret void
}
/* Variables and functions */
double getCylinderVolumn(int, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  double result = getCylinderVolumn(10, 100);
  printf("Volumn=%f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
mov    $0x64,%esi
call   1030 <getCylinderVolumn@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"Volumn=%f\0A\00"
define i32 @main() {
%1 = tail call double @getCylinderVolumn(i32 10, i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void clean_newline(char *input_string) {
  input_string[strlen(input_string) - 1] = '\0';
}


x86 assembly (clang, -O0):
<clean_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_newline>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @clean_newline(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @clean_newline(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret void
}
__attribute__((always_)) void __WFI(void) { __asm volatile("wait"); }


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

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

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

LLVM IR (-O2):
define void @__WFI() {
tail call void asm sideeffect "wait", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_ptr;

/* Variables and functions */
int /*<<< orphan*/ mpz_mod(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set_ui(int /*<<< orphan*/, int);
void gmp_set_ui(mpz_ptr out, int value, mpz_ptr order) {
  mpz_set_ui(out, value);
  mpz_mod(out, out, order);
}


x86 assembly (clang, -O0):
<gmp_set_ui>:
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
call   1030 <mpz_set_ui@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <mpz_mod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmp_set_ui>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
call   1030 <mpz_set_ui@plt>
mov    %ebp,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <mpz_mod@plt>

LLVM IR (-O0):
define void @gmp_set_ui(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @mpz_set_ui(i32 %7, i32 %8)
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = call i32 @mpz_mod(i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @gmp_set_ui(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @mpz_set_ui(i32 %0, i32 %1)
%5 = tail call i32 @mpz_mod(i32 %0, i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int __dbg(bool cond, const char *file, const char *func, unsigned line,
          const char *fmt, ...) {
  return 0;
}


x86 assembly (clang, -O0):
<__dbg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__dbg(i32 %0, i8* %1, i8* %2, i32 %3, i8* %4, ...) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
ret i32 0
}

LLVM IR (-O2):
define i32 @__dbg(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, ...) {
ret i32 0
}
int os2_netclos(void) { return (-1); }


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

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

LLVM IR (-O0):
define i32 @os2_netclos() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @os2_netclos() {
ret i32 -1
}
/* Type definitions */
struct stat {
  int st_size;
};
typedef int off_t;

/* Variables and functions */
int stat(char const *, struct stat *);
off_t file_size(const char *path) {
  struct stat st;
  if (stat(path, &st) == -1)
    return -1;
  return st.st_size;
}


x86 assembly (clang, -O0):
<file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    113e <file_size+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1144 <file_size+0x34>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1121 <file_size+0x11>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_size(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
int dd_gt_d_dd(double a, const double *b) {
  return (a > b[0] || (a == b[0] && b[1] < 0.0)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<dd_gt_d_dd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rcx
mov    $0x1,%al
ucomisd (%rcx),%xmm0
mov    %al,-0x11(%rbp)
ja     115b <dd_gt_d_dd+0x5b>
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
ucomisd (%rcx),%xmm0
mov    %al,-0x12(%rbp)
jne    1155 <dd_gt_d_dd+0x55>
jp     1155 <dd_gt_d_dd+0x55>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd 0x8(%rax),%xmm0
seta   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_gt_d_dd>:
movsd  (%rdi),%xmm1
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
ja     1125 <dd_gt_d_dd+0x25>
ucomisd %xmm0,%xmm1
jne    1126 <dd_gt_d_dd+0x26>
jp     1126 <dd_gt_d_dd+0x26>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
ucomisd 0x8(%rdi),%xmm0
seta   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @dd_gt_d_dd(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fcmp ogt double %5, %8
br i1 %9, label %23, label %10
10: ; preds = %2
%11 = load double, double* %3
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = fcmp oeq double %11, %14
br i1 %15, label %16, label %21
16: ; preds = %10
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = fcmp olt double %19, 0.000000e+00
br label %21
21: ; preds = %16, %10
%22 = phi i1 [ false, %10 ], [ %20, %16 ]
br label %23
23: ; preds = %21, %2
%24 = phi i1 [ true, %2 ], [ %22, %21 ]
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 1, i32 0
ret i32 %26
}

LLVM IR (-O2):
define i32 @dd_gt_d_dd(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fcmp olt double %3, %0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = fcmp oeq double %3, %0
br i1 %6, label %7, label %12
7: ; preds = %5
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = fcmp olt double %9, 0.000000e+00
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %5, %7, %2
%13 = phi i32 [ 1, %2 ], [ 0, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
int close(int);
int close_sg_device(int fd) {
  if (fd < 0)
    return 0;
  return close(fd);
}


x86 assembly (clang, -O0):
<close_sg_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <close_sg_device+0x21>
movl   $0x0,-0x4(%rbp)
jmp    113c <close_sg_device+0x2c>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_sg_device>:
test   %edi,%edi
js     1119 <close_sg_device+0x9>
jmp    1030 <close@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @close_sg_device(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
float tm_i2c_Data2Temp(unsigned int ans) {
  float t = ans;
  return (t / 1023.0 * 3.3 * 2 - 2.73) * 100.0;
}


x86 assembly (clang, -O0):
<tm_i2c_Data2Temp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xef3(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xedf(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
movsd  0xec7(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tm_i2c_Data2Temp>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xeed(%rip),%xmm0
mulsd  0xeed(%rip),%xmm0
addsd  %xmm0,%xmm0
addsd  0xee9(%rip),%xmm0
mulsd  0xee9(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @tm_i2c_Data2Temp(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = uitofp i32 %4 to float
store float %5, float* %3
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = fdiv double %7, 1.023000e+03
%9 = fmul double %8, 3.300000e+00
%10 = call double @llvm.fmuladd.f64(double %9, double 2.000000e+00, double -2.730000e+00)
%11 = fmul double %10, 1.000000e+02
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
define float @tm_i2c_Data2Temp(i32 %0) {
%2 = uitofp i32 %0 to float
%3 = fpext float %2 to double
%4 = fdiv double %3, 1.023000e+03
%5 = fmul double %4, 3.300000e+00
%6 = tail call double @llvm.fmuladd.f64(double %5, double 2.000000e+00, double -2.730000e+00)
%7 = fmul double %6, 1.000000e+02
%8 = fptrunc double %7 to float
ret float %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fgetln(int /*<<< orphan*/ *, size_t *);
int count_ln(FILE *foo) {
  int lines = 0;
  size_t len;
  while (fgetln(foo, &len)) {
    lines++;
  }
  return lines;
}


x86 assembly (clang, -O0):
<count_ln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <fgetln@plt>
cmp    $0x0,%rax
je     1148 <count_ln+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <count_ln+0x13>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_ln>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
mov    $0xffffffff,%ebx
lea    0x8(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <fgetln@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <count_ln+0x20>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @count_ln(i32* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 0, %1 ], [ %8, %4 ]
%6 = call i64 @fgetln(i32* %0, i64* %2)
%7 = icmp eq i64 %6, 0
%8 = add nuw nsw i32 %5, 1
br i1 %7, label %9, label %4
9: ; preds = %4
ret i32 %5
}
/* Variables and functions */
unsigned char inb(scalar_t__);
void smbus_wait_until_done(void) {
  unsigned char byte;
  do {
    byte = inb(0x1000 + 0);
  } while ((byte & 1) == 1);
  while ((byte & ~1) == 0) {
    byte = inb(0x1000 + 0);
  }
}


x86 assembly (clang, -O0):
<smbus_wait_until_done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1000,%edi
call   1030 <inb@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
je     1118 <smbus_wait_until_done+0x8>
jmp    113a <smbus_wait_until_done+0x2a>
movzbl -0x1(%rbp),%eax
and    $0xfffffffe,%eax
cmp    $0x0,%eax
jne    115c <smbus_wait_until_done+0x4c>
mov    $0x1000,%edi
call   1030 <inb@plt>
mov    %al,-0x1(%rbp)
jmp    113a <smbus_wait_until_done+0x2a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbus_wait_until_done>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1000,%edi
call   1030 <inb@plt>
test   $0x1,%al
jne    1120 <smbus_wait_until_done+0x10>
cmp    $0x1,%al
ja     114e <smbus_wait_until_done+0x3e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x1000,%edi
call   1030 <inb@plt>
cmp    $0x2,%al
jb     1140 <smbus_wait_until_done+0x30>
pop    %rax
ret

LLVM IR (-O0):
define void @smbus_wait_until_done() {
%1 = alloca i8
br label %2
2: ; preds = %4, %0
%3 = call zeroext i8 @inb(i64 4096)
store i8 %3, i8* %1
br label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = zext i8 %5 to i32
%7 = and i32 %6, 1
%8 = icmp eq i32 %7, 1
br i1 %8, label %2, label %9
9: ; preds = %4
br label %10
10: ; preds = %15, %9
%11 = load i8, i8* %1
%12 = zext i8 %11 to i32
%13 = and i32 %12, -2
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = call zeroext i8 @inb(i64 4096)
store i8 %16, i8* %1
br label %10
17: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @smbus_wait_until_done() {
br label %1
1: ; preds = %1, %0
%2 = tail call zeroext i8 @inb(i64 4096)
%3 = and i8 %2, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
%6 = icmp ult i8 %2, 2
br i1 %6, label %7, label %10
7: ; preds = %5, %7
%8 = tail call zeroext i8 @inb(i64 4096)
%9 = icmp ult i8 %8, 2
br i1 %9, label %7, label %10
10: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int opt_version(char *arg, void *data) {
  assert(!arg && data);
  puts((char *)data);
  exit(0);
}


x86 assembly (clang, -O0):
<opt_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jne    115b <opt_version+0x2b>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<opt_version>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
sete   %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @opt_version(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %4
%15 = call i32 @puts(i8* %14)
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @opt_version(i8* readnone %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) %1)
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  char **we_wordv;
};
typedef TYPE_1__ wordexp_t;

/* Variables and functions */
int /*<<< orphan*/ wordexp(char *, TYPE_1__ *, int /*<<< orphan*/);
char *expand_path(char *path) {
  wordexp_t expanded;
  wordexp(path, &expanded, 0);
  return expanded.we_wordv[0];
}


x86 assembly (clang, -O0):
<expand_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <wordexp@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand_path>:
push   %rax
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <wordexp@plt>
mov    (%rsp),%rax
mov    (%rax),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i8** }
define i8* @expand_path(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.TYPE_3__
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @wordexp(i8* %4, %struct.TYPE_3__* %3, i32 0)
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
%7 = load i8**, i8*** %6
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
ret i8* %9
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i8** }
define i8* @expand_path(i8* %0) {
%2 = alloca %struct.TYPE_3__
%3 = bitcast %struct.TYPE_3__* %2 to i8*
%4 = call i32 @wordexp(i8* %0, %struct.TYPE_3__* %2, i32 0)
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %2, i64 0, i32 0
%6 = load i8**, i8*** %5
%7 = load i8*, i8** %6
ret i8* %7
}
/* Variables and functions */
unsigned int __blsr_u32(unsigned int);
unsigned int func_blsr32(unsigned int X) { return __blsr_u32(X); }


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

x86 assembly (clang, -O2):
<func_blsr32>:
jmp    1030 <__blsr_u32@plt>

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

LLVM IR (-O2):
define i32 @func_blsr32(i32 %0) {
%2 = tail call i32 @__blsr_u32(i32 %0)
ret i32 %2
}
int g(int *x) {
  *x += 1;
  return *x;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    (%rdi),%eax
add    $0x1,%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @g(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret i32 %3
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int getpgrp();
int kill(int, int);
int killpg(pid_t pid, int sig) {
  if (pid == 0)
    pid = getpgrp();
  if (pid > 1)
    return kill(-pid, sig);
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<killpg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1142 <killpg+0x22>
mov    $0x0,%al
call   1040 <getpgrp@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1161 <killpg+0x41>
xor    %edi,%edi
sub    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <kill@plt>
mov    %eax,-0x4(%rbp)
jmp    117a <killpg+0x5a>
mov    0x2e70(%rip),%rax
mov    (%rax),%ecx
mov    0x2e6f(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<killpg>:
push   %rbx
mov    %esi,%ebx
test   %edi,%edi
je     1136 <killpg+0x16>
cmp    $0x2,%edi
jl     1144 <killpg+0x24>
neg    %edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <kill@plt>
xor    %eax,%eax
call   1040 <getpgrp@plt>
mov    %eax,%edi
cmp    $0x2,%edi
jge    112c <killpg+0xc>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    0x2e8c(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @killpg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @getpgrp()
store i32 %9, i32* %4
br label %10
10: ; preds = %8, %2
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 1
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %4
%15 = sub nsw i32 0, %14
%16 = load i32, i32* %5
%17 = call i32 @kill(i32 %15, i32 %16)
store i32 %17, i32* %3
br label %20
18: ; preds = %10
%19 = load i32, i32* @EINVAL
store i32 %19, i32* @errno
store i32 -1, i32* %3
br label %20
20: ; preds = %18, %13
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @killpg(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @getpgrp()
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ %5, %4 ], [ %0, %2 ]
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = sub nsw i32 0, %7
%11 = tail call i32 @kill(i32 %10, i32 %1)
br label %14
12: ; preds = %6
%13 = load i32, i32* @EINVAL
store i32 %13, i32* @errno
br label %14
14: ; preds = %12, %9
%15 = phi i32 [ %11, %9 ], [ -1, %12 ]
ret i32 %15
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ceilf(int /*<<< orphan*/);
int /*<<< orphan*/ log2f(float);
uint32_t riv_nbits(uint32_t nof_prb) {
  return (uint32_t)ceilf(log2f((float)nof_prb * ((float)nof_prb + 1) / 2));
}


x86 assembly (clang, -O0):
<riv_nbits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
cvtsi2ssq -0x8(%rbp),%xmm1
movss  0xec4(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xeb0(%rip),%xmm1
divss  %xmm1,%xmm0
call   1030 <log2f@plt>
mov    %eax,%edi
call   1040 <ceilf@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<riv_nbits>:
push   %rax
cvtsi2ss %rdi,%xmm1
movss  0xed2(%rip),%xmm0
addss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  0xec6(%rip),%xmm0
call   1030 <log2f@plt>
mov    %eax,%edi
call   1040 <ceilf@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @riv_nbits(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
%5 = load i64, i64* %2
%6 = sitofp i64 %5 to float
%7 = fadd float %6, 1.000000e+00
%8 = fmul float %4, %7
%9 = fdiv float %8, 2.000000e+00
%10 = call i32 @log2f(float %9)
%11 = call i32 @ceilf(i32 %10)
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @riv_nbits(i64 %0) {
%2 = sitofp i64 %0 to float
%3 = fadd float %2, 1.000000e+00
%4 = fmul float %3, %2
%5 = fmul float %4, 5.000000e-01
%6 = tail call i32 @log2f(float %5)
%7 = tail call i32 @ceilf(i32 %6)
%8 = sext i32 %7 to i64
ret i64 %8
}
int idx_block(int el, int idx) {
  return (9 * (3 * (el / 3) + idx / 3) + (3 * (el % 3) + idx % 3));
}


x86 assembly (clang, -O0):
<idx_block>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
imul   $0x9,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
imul   $0x3,%edx,%ecx
mov    -0x8(%rbp),%eax
mov    $0x3,%esi
cltd
idiv   %esi
mov    -0xc(%rbp),%eax
add    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idx_block>:
movslq %edi,%rcx
imul   $0x55555556,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
lea    (%rax,%rax,2),%edx
sub    %edx,%ecx
movslq %esi,%rax
imul   $0x55555556,%rax,%rsi
mov    %rsi,%rdi
shr    $0x3f,%rdi
shr    $0x20,%rsi
add    %edi,%esi
add    %esi,%edx
lea    (%rdx,%rdx,8),%edx
lea    (%rcx,%rcx,2),%ecx
lea    (%rsi,%rsi,2),%esi
sub    %esi,%eax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @idx_block(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 = sdiv i32 %5, 3
%7 = mul nsw i32 3, %6
%8 = load i32, i32* %4
%9 = sdiv i32 %8, 3
%10 = add nsw i32 %7, %9
%11 = mul nsw i32 9, %10
%12 = load i32, i32* %3
%13 = srem i32 %12, 3
%14 = mul nsw i32 3, %13
%15 = load i32, i32* %4
%16 = srem i32 %15, 3
%17 = add nsw i32 %14, %16
%18 = add nsw i32 %11, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @idx_block(i32 %0, i32 %1) {
%3 = srem i32 %0, 3
%4 = sub i32 %0, %3
%5 = sdiv i32 %1, 3
%6 = add nsw i32 %4, %5
%7 = mul nsw i32 %6, 9
%8 = mul nsw i32 %3, 3
%9 = srem i32 %1, 3
%10 = add nsw i32 %8, %9
%11 = add nsw i32 %10, %7
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle24() { kprintf("ISR %d.\n", 24); }


x86 assembly (clang, -O0):
<isrHandle24>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x18,%esi
call   1030 <kprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrHandle24>:
lea    0xee9(%rip),%rdi
mov    $0x18,%esi
jmp    1030 <kprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle24() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 24)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle24() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 24)
ret void
}
int tx_commit(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @tx_commit() {
ret i32 0
}

LLVM IR (-O2):
define i32 @tx_commit() {
ret i32 0
}
/* Type definitions */
struct tp {
  int dummy;
};

/* Variables and functions */
int tp_replyop(struct tp *);
scalar_t__ tp_unfetched(struct tp *);
int tp_hasdata(struct tp *p) {
  return tp_replyop(p) != 65280 && tp_unfetched(p) > 0;
}


x86 assembly (clang, -O0):
<tp_hasdata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <tp_replyop@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xff00,%ecx
mov    %al,-0x9(%rbp)
je     115b <tp_hasdata+0x3b>
mov    -0x8(%rbp),%rdi
call   1040 <tp_unfetched@plt>
cmp    $0x0,%rax
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tp_hasdata>:
push   %rbx
mov    %rdi,%rbx
call   1030 <tp_replyop@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xff00,%ecx
je     1148 <tp_hasdata+0x28>
mov    %rbx,%rdi
call   1040 <tp_unfetched@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setg   %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.tp = type { i32 }
define i32 @tp_hasdata(%struct.tp* %0) {
%2 = alloca %struct.tp*
store %struct.tp* %0, %struct.tp** %2
%3 = load %struct.tp*, %struct.tp** %2
%4 = call i32 @tp_replyop(%struct.tp* %3)
%5 = icmp ne i32 %4, 65280
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load %struct.tp*, %struct.tp** %2
%8 = call i64 @tp_unfetched(%struct.tp* %7)
%9 = icmp sgt i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.tp = type { i32 }
define i32 @tp_hasdata(%struct.tp* %0) {
%2 = tail call i32 @tp_replyop(%struct.tp* %0)
%3 = icmp eq i32 %2, 65280
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @tp_unfetched(%struct.tp* %0)
%6 = icmp sgt i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_hex(const unsigned char *data, int len) {
  int i;
  for (i = 0; i < len; i++)
    printf("0x%02x ", data[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <print_hex+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_hex+0x16>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1158 <print_hex+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_hex+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"0x%02x \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_hex(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"0x%02x \00"
define void @print_hex(i8* nocapture %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 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int soma_matriz(int, int **);
int main() {
  int mat[3][3] = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}};
  printf("O valor e %d", soma_matriz(3, mat));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rsi
mov    $0x3,%edi
call   1050 <soma_matriz@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x3,%edi
call   1040 <soma_matriz@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.mat = [3 x [3 x i32]] [[3 x i32] [i32 1, i32 1, i32 1], [3 x i32] [i32 1, i32 1, i32 1], [3 x i32] [i32 1, i32 1, i32 1]]
@.str = [13 x i8] c"O valor e %d\00"
define i32 @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %1, i64 0, i64 0
%4 = bitcast [3 x i32]* %3 to i32**
%5 = call i32 @soma_matriz(i32 3, i32** %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.mat = [3 x [3 x i32]] [[3 x i32] [i32 1, i32 1, i32 1], [3 x i32] [i32 1, i32 1, i32 1], [3 x i32] [i32 1, i32 1, i32 1]]
@.str = [13 x i8] c"O valor e %d\00"
define i32 @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = bitcast [3 x [3 x i32]]* %1 to i32**
%4 = call i32 @soma_matriz(i32 3, i32** %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ft_strdel(char **as) {
  if (as && *as) {
    free(*as);
    *as = NULL;
  }
}


x86 assembly (clang, -O0):
<ft_strdel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <ft_strdel+0x3c>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114c <ft_strdel+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strdel>:
push   %rbx
test   %rdi,%rdi
je     112d <ft_strdel+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <ft_strdel+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_strdel(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %6, %3, %1
ret void
}