xunge/DecIR huggingface dataset:
/* Type definitions */
struct Var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *, char const *);
void __func_not_sint(struct Var *avar, const char *areg, const char *lreg,
                     const char *rreg) {
  pA("if (%s != 0) {%s = 0;} else {%s = 1;}", lreg, areg, areg);
}


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

x86 assembly (clang, -O2):
<__func_not_sint>:
mov    %rsi,%rcx
lea    0xee6(%rip),%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <pA@plt>

LLVM IR (-O0):
%struct.Var = type { i32 }
@.str = [38 x i8] c"if (%s != 0) {%s = 0;} else {%s = 1;}\00"
define void @__func_not_sint(%struct.Var* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.Var*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.Var* %0, %struct.Var** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %7
%10 = load i8*, i8** %6
%11 = load i8*, i8** %6
%12 = call i32 @pA(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [38 x i8] c"if (%s != 0) {%s = 0;} else {%s = 1;}\00"
define void @__func_not_sint(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* nocapture readnone %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %1, i8* %1)
ret void
}
int test06(char a) { return ((a & 0x03) == 0) ? 0x7FFFFFFF : 0x80000000; }


x86 assembly (clang, -O0):
<test06>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x3,%edx
mov    $0x80000000,%eax
mov    $0x7fffffff,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test06>:
and    $0x3,%dil
cmp    $0x1,%dil
mov    $0x80000000,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @test06(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 3
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 2147483647, i32 -2147483648
ret i32 %8
}

LLVM IR (-O2):
define i32 @test06(i8 signext %0) {
%2 = and i8 %0, 3
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 2147483647, i32 -2147483648
ret i32 %4
}
/* Variables and functions */
double exp(int);
double betaH(double v) { return 1.0 / (exp((30 - v) / 10.0) + 1.0); }


x86 assembly (clang, -O0):
<betaH>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xeb6(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xeaa(%rip),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<betaH>:
push   %rax
movsd  0xee7(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  0xee3(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <exp@plt>
movsd  0xeda(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @betaH(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 3.000000e+01, %3
%5 = fdiv double %4, 1.000000e+01
%6 = fptosi double %5 to i32
%7 = call double @exp(i32 %6)
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double 1.000000e+00, %8
ret double %9
}

LLVM IR (-O2):
define double @betaH(double %0) {
%2 = fsub double 3.000000e+01, %0
%3 = fdiv double %2, 1.000000e+01
%4 = fptosi double %3 to i32
%5 = tail call double @exp(i32 %4)
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double 1.000000e+00, %6
ret double %7
}
char *savestr(s)
char *s;
{
  register char *p;
  p = ckmalloc(strlen(s) + 1);
  ((void)strcpy(p, s));
  return p;
}


x86 assembly (clang, -O0):
<savestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1050 <ckmalloc@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<savestr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1050 <ckmalloc@plt>
movslq %eax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @savestr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i32 (i64, ...) bitcast (i32 (...)* @ckmalloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @savestr(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @ckmalloc to i32 (i64, ...)*)(i64 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i8* @strcpy(i8* dereferenceable(1) %6, i8* dereferenceable(1) %0)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ ui_setint(char *, int);
void reset_target_radio() {
  ui_setint("rF051", 0);
  ui_setint("rF072", 0);
  ui_setint("rF103", 1);
  ui_setint("rF401", 0);
  ui_setint("rF405", 0);
}


x86 assembly (clang, -O0):
<reset_target_radio>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
call   1030 <ui_setint@plt>
lea    0xedd(%rip),%rdi
xor    %esi,%esi
call   1030 <ui_setint@plt>
lea    0xed5(%rip),%rdi
mov    $0x1,%esi
call   1030 <ui_setint@plt>
lea    0xeca(%rip),%rdi
xor    %esi,%esi
call   1030 <ui_setint@plt>
lea    0xec2(%rip),%rdi
xor    %esi,%esi
call   1030 <ui_setint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_target_radio>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <ui_setint@plt>
lea    0xee0(%rip),%rdi
xor    %esi,%esi
call   1030 <ui_setint@plt>
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
call   1030 <ui_setint@plt>
lea    0xecd(%rip),%rdi
xor    %esi,%esi
call   1030 <ui_setint@plt>
lea    0xec5(%rip),%rdi
xor    %esi,%esi
pop    %rax
jmp    1030 <ui_setint@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"rF051\00"
@.str.1 = [6 x i8] c"rF072\00"
@.str.2 = [6 x i8] c"rF103\00"
@.str.3 = [6 x i8] c"rF401\00"
@.str.4 = [6 x i8] c"rF405\00"
define void @reset_target_radio() {
%1 = call i32 @ui_setint(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = call i32 @ui_setint(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = call i32 @ui_setint(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = call i32 @ui_setint(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 0)
%5 = call i32 @ui_setint(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"rF051\00"
@.str.1 = [6 x i8] c"rF072\00"
@.str.2 = [6 x i8] c"rF103\00"
@.str.3 = [6 x i8] c"rF401\00"
@.str.4 = [6 x i8] c"rF405\00"
define void @reset_target_radio() {
%1 = tail call i32 @ui_setint(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @ui_setint(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @ui_setint(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = tail call i32 @ui_setint(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 0)
%5 = tail call i32 @ui_setint(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, t;
  scanf("%d", &a);
  do {
    t = a % 10;
    a = a / 10;
    printf("%d ", t);
  } while (a > 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jg     113f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
lea    0xec2(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq %eax,%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
lea    (%rax,%rax,1),%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%esi
mov    %eax,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
br label %5
5: ; preds = %5, %0
%6 = phi i32 [ %10, %5 ], [ %4, %0 ]
%7 = srem i32 %6, 10
%8 = sdiv i32 %6, 10
store i32 %8, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_info();
int main() {
  print_info();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <print_info@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @print_info()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_info()
ret i32 0
}
double remap(double value, double InMin, double InMax, double OutMin,
             double OutMax) {
  return (value - InMin) * (OutMax - OutMin) / (InMax - InMin) + OutMin;
}


x86 assembly (clang, -O0):
<remap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<remap>:
subsd  %xmm1,%xmm0
subsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @remap(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fsub double %11, %12
%14 = load double, double* %10
%15 = load double, double* %9
%16 = fsub double %14, %15
%17 = fmul double %13, %16
%18 = load double, double* %8
%19 = load double, double* %7
%20 = fsub double %18, %19
%21 = fdiv double %17, %20
%22 = load double, double* %9
%23 = fadd double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @remap(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %0, %1
%7 = fsub double %4, %3
%8 = fmul double %6, %7
%9 = fsub double %2, %1
%10 = fdiv double %8, %9
%11 = fadd double %10, %3
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_read_byte(int /*<<< orphan*/ *);
uint8_t eeconfig_read_audio(void) { return eeprom_read_byte((uint8_t *)7); }


x86 assembly (clang, -O0):
<eeconfig_read_audio>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <eeprom_read_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeconfig_read_audio>:
mov    $0x7,%edi
jmp    1030 <eeprom_read_byte@plt>

LLVM IR (-O0):
define i32 @eeconfig_read_audio() {
%1 = call i32 @eeprom_read_byte(i32* inttoptr (i64 7 to i32*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @eeconfig_read_audio() {
%1 = tail call i32 @eeprom_read_byte(i32* inttoptr (i64 7 to i32*))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ print_int(char);
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int x;
  char y;
  y = 'Q';
  x = y;
  print_int(x);
  print_string("\n");
  print_int(y);
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x51,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%edi
call   1040 <print_int@plt>
lea    0xebb(%rip),%rdi
call   1030 <print_string@plt>
movsbl -0x5(%rbp),%edi
call   1040 <print_int@plt>
lea    0xea6(%rip),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x51,%edi
call   1040 <print_int@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
call   1030 <print_string@plt>
mov    $0x51,%edi
call   1040 <print_int@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i8
store i8 81, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = trunc i32 %5 to i8
%7 = call i32 @print_int(i8 signext %6)
%8 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = load i8, i8* %2
%10 = call i32 @print_int(i8 signext %9)
%11 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @main() {
%1 = tail call i32 @print_int(i8 signext 81)
%2 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @print_int(i8 signext 81)
%4 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
void ChangeToTTY2() {}


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

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

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

LLVM IR (-O2):
define void @ChangeToTTY2() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int stream_seek(void *data, off_t len) { return 0; }


x86 assembly (clang, -O0):
<stream_seek>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @stream_seek(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @stream_seek(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct iwreq {
  char *ifr_name;
};

/* Variables and functions */
int ioctl(int, int, struct iwreq *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int iw_set_ext(int skfd, char *ifname, int request, struct iwreq *pwrq) {
  strncpy(pwrq->ifr_name, ifname, 16);
  pwrq->ifr_name[16] = '\0';
  return (ioctl(skfd, request, pwrq));
}


x86 assembly (clang, -O0):
<iw_set_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movb   $0x0,0x10(%rax)
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <ioctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iw_set_ext>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %edx,%r14d
mov    %edi,%ebp
mov    (%rcx),%rdi
mov    $0x10,%edx
call   1030 <strncpy@plt>
mov    (%rbx),%rax
movb   $0x0,0x10(%rax)
mov    %ebp,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
%struct.iwreq = type { i8* }
define i32 @iw_set_ext(i32 %0, i8* %1, i32 %2, %struct.iwreq* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.iwreq*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store %struct.iwreq* %3, %struct.iwreq** %8
%9 = load %struct.iwreq*, %struct.iwreq** %8
%10 = getelementptr inbounds %struct.iwreq, %struct.iwreq* %9, i32 0, i32 0
%11 = load i8*, i8** %10
%12 = load i8*, i8** %6
%13 = call i32 @strncpy(i8* %11, i8* %12, i32 16)
%14 = load %struct.iwreq*, %struct.iwreq** %8
%15 = getelementptr inbounds %struct.iwreq, %struct.iwreq* %14, i32 0, i32 0
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8, i8* %16, i64 16
store i8 0, i8* %17
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = load %struct.iwreq*, %struct.iwreq** %8
%21 = call i32 @ioctl(i32 %18, i32 %19, %struct.iwreq* %20)
ret i32 %21
}

LLVM IR (-O2):
%struct.iwreq = type { i8* }
define i32 @iw_set_ext(i32 %0, i8* %1, i32 %2, %struct.iwreq* %3) {
%5 = getelementptr inbounds %struct.iwreq, %struct.iwreq* %3, i64 0, i32 0
%6 = load i8*, i8** %5
%7 = tail call i32 @strncpy(i8* %6, i8* %1, i32 16)
%8 = load i8*, i8** %5
%9 = getelementptr inbounds i8, i8* %8, i64 16
store i8 0, i8* %9
%10 = tail call i32 @ioctl(i32 %0, i32 %2, %struct.iwreq* %3)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ CWE78_OS_Command_Injection__char_console_execl_41_bad();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  srand((unsigned)time(NULL));
  printf("Calling bad()...\n");
  CWE78_OS_Command_Injection__char_console_execl_41_bad();
  printf("Finished bad()\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)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <CWE78_OS_Command_Injection__char_console_execl_41_bad@plt>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <CWE78_OS_Command_Injection__char_console_execl_41_bad@plt>
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Calling bad()...\0A\00"
@.str.1 = [16 x i8] c"Finished bad()\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 i64 @time(i32* null)
%7 = trunc i64 %6 to i32
%8 = call i32 @srand(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @CWE78_OS_Command_Injection__char_console_execl_41_bad()
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"Calling bad()...\00"
@str.2 = [15 x i8] c"Finished bad()\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 (...) @CWE78_OS_Command_Injection__char_console_execl_41_bad()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
char *kr_event_api_name(void) { return "epoll"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"epoll\00"
define i8* @kr_event_api_name() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int fegetround(void) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @fegetround() {
ret i32 -1
}
/* Variables and functions */
void *calloc(int, unsigned int);
int /*<<< orphan*/ std_err(char *);
void *alloc_c(unsigned numb) {
  void *p;
  if (!numb)
    ++numb;
  if (!(p = calloc(1, numb)))
    std_err("failed memory allocate");
  return p;
}


x86 assembly (clang, -O0):
<alloc_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113e <alloc_c+0x1e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1165 <alloc_c+0x45>
lea    0xea0(%rip),%rdi
call   1040 <std_err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_c>:
push   %rbx
mov    %edi,%esi
test   %edi,%edi
mov    $0x1,%eax
cmove  %eax,%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <alloc_c+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <std_err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"failed memory allocate\00"
define i8* @alloc_c(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add i32 %7, 1
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
%11 = call i8* @calloc(i32 1, i32 %10)
store i8* %11, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %15, label %13
13: ; preds = %9
%14 = call i32 @std_err(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [23 x i8] c"failed memory allocate\00"
define noalias i8* @alloc_c(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
%4 = tail call i8* @calloc(i32 1, i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @std_err(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i8* %4
}
int ehnlc_tolower(int c) {
  if (c >= 'A' && c <= 'Z') {
    return 'a' + (c - 'A');
  }
  return c;
}


x86 assembly (clang, -O0):
<ehnlc_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     112c <ehnlc_tolower+0x2c>
cmpl   $0x5a,-0x8(%rbp)
jg     112c <ehnlc_tolower+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <ehnlc_tolower+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehnlc_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ehnlc_tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 65
%12 = add nsw i32 97, %11
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @ehnlc_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
unsigned int vec_vbyte_len(unsigned long int n) {
  unsigned int ret = 1;
  while (n >= 128) {
    n >>= 7;
    ret++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<vec_vbyte_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x80,-0x8(%rbp)
jb     1137 <vec_vbyte_len+0x37>
mov    -0x8(%rbp),%rax
shr    $0x7,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <vec_vbyte_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_vbyte_len>:
mov    $0x1,%eax
cmp    $0x80,%rdi
jb     1133 <vec_vbyte_len+0x33>
mov    $0x1,%eax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
shr    $0x7,%rcx
add    $0x1,%eax
cmp    $0x3fff,%rdi
mov    %rcx,%rdi
ja     1120 <vec_vbyte_len+0x20>
ret

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

LLVM IR (-O2):
define i32 @vec_vbyte_len(i64 %0) {
%2 = icmp ugt i64 %0, 127
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 7
%7 = add nuw nsw i32 %4, 1
%8 = icmp ugt i64 %5, 16383
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
size_t __get_array_size(char *);
int __infer_nondet_int();
int strerror_r(int errnum, char *strerrbuf, size_t buflen) {
  if (__get_array_size(strerrbuf) < buflen)
    while (1)
      ;
  return __infer_nondet_int();
}


x86 assembly (clang, -O0):
<strerror_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__get_array_size@plt>
cmp    -0x18(%rbp),%rax
jae    1150 <strerror_r+0x30>
jmp    114b <strerror_r+0x2b>
jmp    114b <strerror_r+0x2b>
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror_r>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdi
call   1040 <__get_array_size@plt>
cmp    %rbx,%rax
jae    1142 <strerror_r+0x22>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
jmp    1140 <strerror_r+0x20>
xor    %eax,%eax
pop    %rbx
jmp    1030 <__infer_nondet_int@plt>

LLVM IR (-O0):
define i32 @strerror_r(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = call i64 @__get_array_size(i8* %7)
%9 = load i64, i64* %6
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
br label %12
12: ; preds = %11, %12
br label %12
13: ; preds = %3
%14 = call i32 (...) @__infer_nondet_int()
ret i32 %14
}

LLVM IR (-O2):
define i32 @strerror_r(i32 %0, i8* %1, i64 %2) {
%4 = tail call i64 @__get_array_size(i8* %1)
%5 = icmp ult i64 %4, %2
br i1 %5, label %6, label %7
6: ; preds = %3, %6
br label %6
7: ; preds = %3
%8 = tail call i32 (...) @__infer_nondet_int()
ret i32 %8
}
void RTThreadSetType(void) {}


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

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

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

LLVM IR (-O2):
define void @RTThreadSetType() {
ret void
}
int i2c_bulkread(void *handle, unsigned char chip, unsigned short addr,
                 unsigned char *data, unsigned short length) {
  return 0;
}


x86 assembly (clang, -O0):
<i2c_bulkread>:
push   %rbp
mov    %rsp,%rbp
mov    %r8w,%ax
mov    %rdi,-0x8(%rbp)
mov    %sil,-0x9(%rbp)
mov    %dx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @i2c_bulkread(i8* nocapture readnone %0, i8 zeroext %1, i16 zeroext %2, i8* nocapture readnone %3, i16 zeroext %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xfd() {
  Assert_real((isbdigit(253) == 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_isbdigit.c",
              1270, ("isbdigit should be 0 for 0xfd"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xfd>:
push   %rax
mov    $0xfd,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4f6,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xfd\00"
define void @t_isbdigit_0xfd() {
%1 = call i64 @isbdigit(i32 253)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1270, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xfd\00"
define void @t_isbdigit_0xfd() {
%1 = tail call i64 @isbdigit(i32 253)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1270, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_stack(struct item *item) { printf("\n"); }


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

x86 assembly (clang, -O2):
<print_stack>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
%struct.item = type { i32 }
define void @print_stack(%struct.item* nocapture readnone %0) {
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int family;
};
typedef TYPE_1__ XHostAddress;

/* Variables and functions */
void set_XHostAddress_family(void *_p, int _v) {
  ((XHostAddress *)_p)->family = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XHostAddress_family>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XHostAddress_family(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XHostAddress_family(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
OP(dd, b1) {
  illegal_1();
  op_b1();
}


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

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_b1@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_b1()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_b1()
ret i32 undef
}
void av_rc4_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_rc4_alloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CrcGenerateTable();
void SZIP_global_init(void) {
  static int generatedTable = 0;
  if (!generatedTable) {
    generatedTable = 1;
    CrcGenerateTable();
  }
}


x86 assembly (clang, -O0):
<SZIP_global_init>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    1132 <SZIP_global_init+0x22>
movl   $0x1,0x2f01(%rip)
mov    $0x0,%al
call   1030 <CrcGenerateTable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SZIP_global_init>:
cmpb   $0x0,0x2f15(%rip)
je     111a <SZIP_global_init+0xa>
ret
movb   $0x1,0x2f0b(%rip)
xor    %eax,%eax
jmp    1030 <CrcGenerateTable@plt>

LLVM IR (-O0):
@SZIP_global_init.generatedTable = internal global i32 0
define void @SZIP_global_init() {
%1 = load i32, i32* @SZIP_global_init.generatedTable
%2 = icmp ne i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
store i32 1, i32* @SZIP_global_init.generatedTable
%4 = call i32 (...) @CrcGenerateTable()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@SZIP_global_init.generatedTable = internal unnamed_addr global i1 false
define void @SZIP_global_init() {
%1 = load i1, i1* @SZIP_global_init.generatedTable
br i1 %1, label %4, label %2
2: ; preds = %0
store i1 true, i1* @SZIP_global_init.generatedTable
%3 = tail call i32 (...) @CrcGenerateTable()
br label %4
4: ; preds = %2, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int vhod, result;
  scanf("%d", &vhod);
  result = vhod * vhod;
  printf("%d\n", result);
  result = vhod * vhod * vhod;
  printf("%d\n", result);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %7
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
char *getcwd(char *, int);
char *strdup(char *);
char *getcwd_a() {
  char buf[256];
  char *ret;
  ret = getcwd(buf, 256);
  if (ret == NULL)
    return NULL;
  return strdup(buf);
}


x86 assembly (clang, -O0):
<getcwd_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1030 <getcwd@plt>
mov    %rax,-0x118(%rbp)
cmpq   $0x0,-0x118(%rbp)
jne    115e <getcwd_a+0x3e>
movq   $0x0,-0x8(%rbp)
jmp    116e <getcwd_a+0x4e>
lea    -0x110(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcwd_a>:
sub    $0x108,%rsp
mov    %rsp,%rdi
mov    $0x100,%esi
call   1030 <getcwd@plt>
test   %rax,%rax
je     1149 <getcwd_a+0x29>
mov    %rsp,%rdi
call   1040 <strdup@plt>
add    $0x108,%rsp
ret
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i8* @getcwd_a() {
%1 = alloca i8*
%2 = alloca [256 x i8]
%3 = alloca i8*
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i8* @getcwd(i8* %4, i32 256)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %0
store i8* null, i8** %1
br label %12
9: ; preds = %0
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%11 = call i8* @strdup(i8* %10)
store i8* %11, i8** %1
br label %12
12: ; preds = %9, %8
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @getcwd_a() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i8* @getcwd(i8* %2, i32 256)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i8* @strdup(i8* %2)
br label %7
7: ; preds = %0, %5
%8 = phi i8* [ %6, %5 ], [ null, %0 ]
ret i8* %8
}
int test_imm_41int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x41 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_41int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 65
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_41int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 4259840
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _ACC_gpu_get_block_count_async(unsigned int **, int);
void _ACC_gpu_get_block_count(unsigned **count) {
  _ACC_gpu_get_block_count_async(count, (-1));
}


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

x86 assembly (clang, -O2):
<_ACC_gpu_get_block_count>:
mov    $0xffffffff,%esi
jmp    1030 <_ACC_gpu_get_block_count_async@plt>

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

LLVM IR (-O2):
define void @_ACC_gpu_get_block_count(i32** %0) {
%2 = tail call i32 @_ACC_gpu_get_block_count_async(i32** %0, i32 -1)
ret void
}
char *func_ret_char_ptr(char *cp) { return cp + 1; }


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

x86 assembly (clang, -O2):
<func_ret_char_ptr>:
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @func_ret_char_ptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
ret i8* %4
}

LLVM IR (-O2):
define i8* @func_ret_char_ptr(i8* readnone %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ other_f();
int main() { other_f(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @other_f()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bfc_realloc(void *, int /*<<< orphan*/);
void bfc_free(void *ptr) { (void)bfc_realloc(ptr, 0); }


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

x86 assembly (clang, -O2):
<bfc_free>:
xor    %esi,%esi
jmp    1030 <bfc_realloc@plt>

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

LLVM IR (-O2):
define void @bfc_free(i8* %0) {
%2 = tail call i32 @bfc_realloc(i8* %0, i32 0)
ret void
}
/* Variables and functions */
int IO_get_byte();
unsigned int IO_get_le16();
unsigned int IO_get_le24(void) {
  unsigned int result = IO_get_le16();
  return result | (IO_get_byte() << 16);
}


x86 assembly (clang, -O0):
<IO_get_le24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <IO_get_le16@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <IO_get_byte@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x10,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IO_get_le24>:
push   %rbx
xor    %eax,%eax
call   1030 <IO_get_le16@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <IO_get_byte@plt>
shl    $0x10,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @IO_get_le24() {
%1 = alloca i32
%2 = call i32 (...) @IO_get_le16()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 (...) @IO_get_byte()
%5 = shl i32 %4, 16
%6 = or i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @IO_get_le24() {
%1 = tail call i32 (...) @IO_get_le16()
%2 = tail call i32 (...) @IO_get_byte()
%3 = shl i32 %2, 16
%4 = or i32 %3, %1
ret i32 %4
}
void gdk_display_get_maximal_cursor_size() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_get_maximal_cursor_size() {
ret void
}