xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void readValueRequestPacket(uint8_t *data, uint8_t **key,
                            uint8_t *get_children) {
  (*key) = data + 2;
  (*get_children) = !!(data[1] & (0x01 << 0));
}


x86 assembly (clang, -O0):
<readValueRequestPacket>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
add    $0x8,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<readValueRequestPacket>:
lea    0x8(%rdi),%rax
mov    %rax,(%rsi)
mov    0x4(%rdi),%eax
and    $0x1,%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @readValueRequestPacket(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 = getelementptr inbounds i32, i32* %7, i64 2
%9 = load i32**, i32*** %5
store i32* %8, i32** %9
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = and i32 %12, 1
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
%16 = xor i1 %15, true
%17 = zext i1 %16 to i32
%18 = load i32*, i32** %6
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @readValueRequestPacket(i32* %0, i32** nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 2
store i32* %4, i32** %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = and i32 %6, 1
store i32 %7, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
short func_37(unsigned p_38, unsigned short p_39) {
  int l_40 = 0x1AA2910AL;
  int l_41 = 0x47030FC3L;
  step_hash(6);
  l_41 ^= l_40;
  step_hash(7);
  return p_39;
}


x86 assembly (clang, -O0):
<func_37>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movl   $0x1aa2910a,-0xc(%rbp)
movl   $0x47030fc3,-0x10(%rbp)
mov    $0x6,%edi
call   1030 <step_hash@plt>
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x7,%edi
call   1030 <step_hash@plt>
movswl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_37>:
push   %rbx
mov    %esi,%ebx
mov    $0x6,%edi
call   1030 <step_hash@plt>
mov    $0x7,%edi
call   1030 <step_hash@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @func_37(i32 %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i16 %1, i16* %4
store i32 446861578, i32* %5
store i32 1191382979, i32* %6
%7 = call i32 @step_hash(i32 6)
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = xor i32 %9, %8
store i32 %10, i32* %6
%11 = call i32 @step_hash(i32 7)
%12 = load i16, i16* %4
ret i16 %12
}

LLVM IR (-O2):
define signext i16 @func_37(i32 %0, i16 returned zeroext %1) {
%3 = tail call i32 @step_hash(i32 6)
%4 = tail call i32 @step_hash(i32 7)
ret i16 %1
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char const *, int);
void clearScreen() {
  const char *CLEAR_SCREE_ANSI = "\e[1;1H\e[2J";
  write(STDOUT_FILENO, CLEAR_SCREE_ANSI, 12);
  return;
}


x86 assembly (clang, -O0):
<clearScreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    $0xc,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearScreen>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0xc,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[1;1H\1B[2J\00"
@STDOUT_FILENO = global i32 0
define void @clearScreen() {
%1 = alloca i8*
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i8*, i8** %1
%4 = call i32 @write(i32 %2, i8* %3, i32 12)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[1;1H\1B[2J\00"
@STDOUT_FILENO = global i32 0
define void @clearScreen() {
%1 = load i32, i32* @STDOUT_FILENO
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 12)
ret void
}
int f(int x, double d1, double d2, double d3) { return x; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0, double %1, double %2, double %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 %0, i32* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @f(i32 returned %0, double %1, double %2, double %3) {
ret i32 %0
}
/* Variables and functions */
int factorial(int);
int calculate_binomial(int total, int chosen) {
  int total_factorial, chosen_factorial, difference_factorial;
  total_factorial = factorial(total);
  chosen_factorial = factorial(chosen);
  difference_factorial = factorial(total - chosen);
  return total_factorial / (chosen_factorial * difference_factorial);
}


x86 assembly (clang, -O0):
<calculate_binomial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
cltd
idiv   %ecx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_binomial>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <factorial@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <factorial@plt>
mov    %eax,%r15d
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <factorial@plt>
mov    %eax,%ecx
imul   %r15d,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @calculate_binomial(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @factorial(i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @factorial(i32 %10)
store i32 %11, i32* %6
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = sub nsw i32 %12, %13
%15 = call i32 @factorial(i32 %14)
store i32 %15, i32* %7
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = mul nsw i32 %17, %18
%20 = sdiv i32 %16, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @calculate_binomial(i32 %0, i32 %1) {
%3 = tail call i32 @factorial(i32 %0)
%4 = tail call i32 @factorial(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call i32 @factorial(i32 %5)
%7 = mul nsw i32 %6, %4
%8 = sdiv i32 %3, %7
ret i32 %8
}
char counter$init$start(void) {
  counter$clock$set_rate(1, 2);
  return 1;
}


x86 assembly (clang, -O0):
<counter$init$start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <counter$clock$set_rate@plt>
mov    $0x1,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<counter$init$start>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <counter$clock$set_rate@plt>
mov    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @"counter$init$start"() {
%1 = call i32 (i32, i32, ...) bitcast (i32 (...)* @"counter$clock$set_rate" to i32 (i32, i32, ...)*)(i32 1, i32 2)
ret i8 1
}

LLVM IR (-O2):
define signext i8 @"counter$init$start"() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @"counter$clock$set_rate" to i32 (i32, i32, ...)*)(i32 1, i32 2)
ret i8 1
}
void str_copy(unsigned char *from, unsigned char *to) {
  int i;
  for (i = 0; from[i] != '\0'; i++) {
    to[i] = from[i];
  }
}


x86 assembly (clang, -O0):
<str_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <str_copy+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <str_copy+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_copy>:
mov    (%rdi),%al
test   %al,%al
je     1120 <str_copy+0x20>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rsi,%rcx,1)
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <str_copy+0x10>
ret

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

LLVM IR (-O2):
define void @str_copy(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
double DoubleNAN(void) {
  typedef struct {
    double x;
    long l1;
    long l2;
  } L_nanDouble;
  static L_nanDouble l_nanDouble = {0.0, 0x7fffffff, 0x7fffffff};
  static double *d_nanDouble = (double *)&l_nanDouble.l1;
  return *d_nanDouble;
}


x86 assembly (clang, -O0):
<DoubleNAN>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f2d(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoubleNAN>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
%struct.L_nanDouble = type { double, i64, i64 }
@DoubleNAN.l_nanDouble = internal global %struct.L_nanDouble { double 0.000000e+00, i64 2147483647, i64 2147483647 }
@DoubleNAN.d_nanDouble = internal global double* bitcast (i8* getelementptr (i8, i8* bitcast (%struct.L_nanDouble* @DoubleNAN.l_nanDouble to i8*), i64 8) to double*)
define double @DoubleNAN() {
%1 = load double*, double** @DoubleNAN.d_nanDouble
%2 = load double, double* %1
ret double %2
}

LLVM IR (-O2):
define double @DoubleNAN() {
ret double 0x7FFFFFFF
}
/* Variables and functions */
int /*<<< orphan*/ putTTY(char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int, char *);
void putTTYstr(int row, int col, char *buf) {
  char str[256];
  sprintf(str, "\033[%d;%dH%s", row, col, buf);
  putTTY(str);
}


x86 assembly (clang, -O0):
<putTTYstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xeb3(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <putTTY@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putTTYstr>:
push   %rbx
sub    $0x100,%rsp
mov    %rdx,%r8
mov    %esi,%ecx
mov    %edi,%edx
lea    0xeca(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <putTTY@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[%d;%dH%s\00"
define void @putTTYstr(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [256 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i8* %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%14 = call i32 @putTTY(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[%d;%dH%s\00"
define void @putTTYstr(i32 %0, i32 %1, i8* %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i8* %2)
%7 = call i32 @putTTY(i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Delay_ms(int);
int /*<<< orphan*/ UART1_Write_Text(char *);
double ir_measure_cm();
int /*<<< orphan*/ sprintf(char *, char *, double);
int /*<<< orphan*/ system_init();
void main() {
  char tmp_text[20];
  system_init();
  while (1) {
    sprintf(tmp_text, "Distance is: %4.2f\r\n", ir_measure_cm());
    UART1_Write_Text(tmp_text);
    Delay_ms(500);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1050 <system_init@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1030 <ir_measure_cm@plt>
mov    -0x28(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <UART1_Write_Text@plt>
mov    $0x1f4,%edi
call   1060 <Delay_ms@plt>
jmp    115f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   1050 <system_init@plt>
lea    0xe9b(%rip),%r14
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <ir_measure_cm@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <UART1_Write_Text@plt>
mov    $0x1f4,%edi
call   1060 <Delay_ms@plt>
jmp    1170 <main+0x20>

LLVM IR (-O0):
@.str = [21 x i8] c"Distance is: %4.2f\0D\0A\00"
define void @main() {
%1 = alloca [20 x i8]
%2 = call i32 (...) @system_init()
br label %3
3: ; preds = %0, %3
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call double (...) @ir_measure_cm()
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%8 = call i32 @UART1_Write_Text(i8* %7)
%9 = call i32 @Delay_ms(i32 500)
br label %3
}

LLVM IR (-O2):
@.str = [21 x i8] c"Distance is: %4.2f\0D\0A\00"
define void @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @system_init()
br label %4
4: ; preds = %4, %0
%5 = call double (...) @ir_measure_cm()
%6 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %5)
%7 = call i32 @UART1_Write_Text(i8* %2)
%8 = call i32 @Delay_ms(i32 500)
br label %4
}
/* Variables and functions */
scalar_t__ malloc(size_t);
long int *NewLintArray(long int N) {
  long int *vec;
  if (N <= 0)
    return (NULL);
  vec = NULL;
  vec = (long int *)malloc((size_t)N * sizeof(long int));
  return (vec);
}


x86 assembly (clang, -O0):
<NewLintArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jg     1134 <NewLintArray+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1155 <NewLintArray+0x45>
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NewLintArray>:
test   %rdi,%rdi
jle    1124 <NewLintArray+0x14>
push   %rax
shl    $0x3,%rdi
call   1030 <malloc@plt>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64* @NewLintArray(i64 %0) {
%2 = alloca i64*
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp sle i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64* null, i64** %2
br label %14
8: ; preds = %1
store i64* null, i64** %4
%9 = load i64, i64* %3
%10 = mul i64 %9, 8
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i64*
store i64* %12, i64** %4
%13 = load i64*, i64** %4
store i64* %13, i64** %2
br label %14
14: ; preds = %8, %7
%15 = load i64*, i64** %2
ret i64* %15
}

LLVM IR (-O2):
define i64* @NewLintArray(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = shl i64 %0, 3
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i64*
br label %7
7: ; preds = %1, %3
%8 = phi i64* [ %6, %3 ], [ null, %1 ]
ret i64* %8
}
void svgContent(void *ud, const char *s) {}


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

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

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

LLVM IR (-O2):
define void @svgContent(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ hidpp_set_unaligned_le_u16(int /*<<< orphan*/ *,
                                              int /*<<< orphan*/);
uint16_t hidpp_cpu_to_le_u16(uint16_t data) {
  uint16_t result;
  hidpp_set_unaligned_le_u16((uint8_t *)&result, data);
  return result;
}


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

x86 assembly (clang, -O2):
<hidpp_cpu_to_le_u16>:
push   %rax
mov    %edi,%esi
lea    0x4(%rsp),%rdi
call   1030 <hidpp_set_unaligned_le_u16@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @hidpp_cpu_to_le_u16(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @hidpp_set_unaligned_le_u16(i32* %2, i32 %0)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int ext_logger_sprintf(char *buffer, size_t buffer_size, const char *format,
                       va_list args) {
  return vsnprintf(buffer, buffer_size, format, args);
}


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

x86 assembly (clang, -O2):
<ext_logger_sprintf>:
jmp    1030 <vsnprintf@plt>

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

LLVM IR (-O2):
define i32 @ext_logger_sprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ do_something();
scalar_t__ foo(int **);
void bar() {
  int **p;
  if (foo(p))
    do_something();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x8(%rbp),%rdi
call   1040 <foo@plt>
cmp    $0x0,%rax
je     1142 <bar+0x22>
mov    $0x0,%al
call   1030 <do_something@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
call   1040 <foo@plt>
test   %rax,%rax
je     1133 <bar+0x13>
xor    %eax,%eax
pop    %rcx
jmp    1030 <do_something@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @bar() {
%1 = alloca i32**
%2 = load i32**, i32*** %1
%3 = call i64 @foo(i32** %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @do_something()
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @bar() {
%1 = tail call i64 @foo(i32** undef)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @do_something()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Ankit is the Best"); }


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Ankit is the Best\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Ankit is the Best\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
void XGetTransientForHint() {}


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

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

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

LLVM IR (-O2):
define void @XGetTransientForHint() {
ret void
}
void module_control(volatile unsigned char *port, unsigned char pin, char state,
                    char permission) {
  if (permission == 0x1A) {
    if (state)
      *port |= pin;
    else
      *port &= ~pin;
  }
}


x86 assembly (clang, -O0):
<module_control>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
movsbl -0xb(%rbp),%eax
cmp    $0x1a,%eax
jne    115e <module_control+0x5e>
cmpb   $0x0,-0xa(%rbp)
je     1145 <module_control+0x45>
movzbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
movzbl %cl,%ecx
or     %edx,%ecx
mov    %cl,(%rax)
jmp    1159 <module_control+0x59>
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
movzbl %cl,%ecx
and    %edx,%ecx
mov    %cl,(%rax)
jmp    115e <module_control+0x5e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_control>:
cmp    $0x1a,%cl
jne    1117 <module_control+0x17>
test   %dl,%dl
je     110e <module_control+0xe>
or     (%rdi),%sil
jmp    1114 <module_control+0x14>
not    %sil
and    (%rdi),%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @module_control(i8* %0, i8 zeroext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 26
br i1 %11, label %12, label %33
12: ; preds = %4
%13 = load i8, i8* %7
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %12
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %5
%19 = load volatile i8, i8* %18
%20 = zext i8 %19 to i32
%21 = or i32 %20, %17
%22 = trunc i32 %21 to i8
store volatile i8 %22, i8* %18
br label %32
23: ; preds = %12
%24 = load i8, i8* %6
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = load i8*, i8** %5
%28 = load volatile i8, i8* %27
%29 = zext i8 %28 to i32
%30 = and i32 %29, %26
%31 = trunc i32 %30 to i8
store volatile i8 %31, i8* %27
br label %32
32: ; preds = %23, %15
br label %33
33: ; preds = %32, %4
ret void
}

LLVM IR (-O2):
define void @module_control(i8* %0, i8 zeroext %1, i8 signext %2, i8 signext %3) {
%5 = icmp eq i8 %3, 26
br i1 %5, label %6, label %17
6: ; preds = %4
%7 = icmp eq i8 %2, 0
br i1 %7, label %11, label %8
8: ; preds = %6
%9 = load volatile i8, i8* %0
%10 = or i8 %9, %1
br label %15
11: ; preds = %6
%12 = xor i8 %1, -1
%13 = load volatile i8, i8* %0
%14 = and i8 %13, %12
br label %15
15: ; preds = %11, %8
%16 = phi i8 [ %10, %8 ], [ %14, %11 ]
store volatile i8 %16, i8* %0
br label %17
17: ; preds = %15, %4
ret void
}
int fsm_true(int in) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @fsm_true(i32 %0) {
ret i32 1
}
/* Variables and functions */
unsigned int Si702x_I2C_read16(int);
int /*<<< orphan*/ Si702x_I2C_write8(int);
int /*<<< orphan*/ usleep(int);
float Si702x_readHumidity(void) {
  float humi;
  unsigned int rawHumi;
  Si702x_I2C_write8(0xE5);
  usleep(10000);
  rawHumi = Si702x_I2C_read16(0xE5);
  usleep(10000);
  humi = (rawHumi * 125.0 / 65536) - 6;
  return humi;
}


x86 assembly (clang, -O0):
<Si702x_readHumidity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xe5,%edi
mov    %edi,-0x10(%rbp)
call   1030 <Si702x_I2C_write8@plt>
mov    $0x2710,%edi
mov    %edi,-0xc(%rbp)
call   1050 <usleep@plt>
mov    -0x10(%rbp),%edi
call   1040 <Si702x_I2C_read16@plt>
mov    -0xc(%rbp),%edi
mov    %eax,-0x8(%rbp)
call   1050 <usleep@plt>
mov    -0x8(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xe9b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe87(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe73(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Si702x_readHumidity>:
push   %rbx
mov    $0xe5,%edi
call   1030 <Si702x_I2C_write8@plt>
mov    $0x2710,%edi
call   1050 <usleep@plt>
mov    $0xe5,%edi
call   1040 <Si702x_I2C_read16@plt>
mov    %eax,%ebx
mov    $0x2710,%edi
call   1050 <usleep@plt>
mov    %ebx,%eax
cvtsi2sd %rax,%xmm0
mulsd  0xe96(%rip),%xmm0
mulsd  0xe96(%rip),%xmm0
addsd  0xe96(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @Si702x_readHumidity() {
%1 = alloca float
%2 = alloca i32
%3 = call i32 @Si702x_I2C_write8(i32 229)
%4 = call i32 @usleep(i32 10000)
%5 = call i32 @Si702x_I2C_read16(i32 229)
store i32 %5, i32* %2
%6 = call i32 @usleep(i32 10000)
%7 = load i32, i32* %2
%8 = uitofp i32 %7 to double
%9 = fmul double %8, 1.250000e+02
%10 = fdiv double %9, 6.553600e+04
%11 = fsub double %10, 6.000000e+00
%12 = fptrunc double %11 to float
store float %12, float* %1
%13 = load float, float* %1
ret float %13
}

LLVM IR (-O2):
define float @Si702x_readHumidity() {
%1 = tail call i32 @Si702x_I2C_write8(i32 229)
%2 = tail call i32 @usleep(i32 10000)
%3 = tail call i32 @Si702x_I2C_read16(i32 229)
%4 = tail call i32 @usleep(i32 10000)
%5 = uitofp i32 %3 to double
%6 = fmul double %5, 1.250000e+02
%7 = fmul double %6, 0x3EF0000000000000
%8 = fadd double %7, -6.000000e+00
%9 = fptrunc double %8 to float
ret float %9
}
/* Variables and functions */
int isblank(char);
bool isNotBlank(char ch) {
  bool value = isblank(ch);
  return !value;
}


x86 assembly (clang, -O0):
<isNotBlank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isblank@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNotBlank>:
push   %rax
call   1030 <isblank@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isNotBlank(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i32 @isblank(i8 signext %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @isNotBlank(i8 signext %0) {
%2 = tail call i32 @isblank(i8 signext %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void closefiles(FILE *fp[], int nscores) {
  int f;
  for (f = 0; f < nscores; f++)
    fclose(fp[f]);
}


x86 assembly (clang, -O0):
<closefiles>:
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    1151 <closefiles+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <fclose@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <closefiles+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closefiles>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <closefiles+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <fclose@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <closefiles+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @closefiles(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = load i32*, i32** %8
%10 = tail call i32 @fclose(i32* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ server_run(char *, int);
int main(int argc, char *argv[]) {
  server_run("127.0.0.1", 30001);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x7531,%esi
call   1030 <server_run@plt>
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"127.0.0.1\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @server_run(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 30001)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [10 x i8] c"127.0.0.1\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @server_run(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 30001)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
scalar_t__ lrand48();
extern __attribute__((gnu_)) int rand(void) { return (int)lrand48(); }


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

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

LLVM IR (-O0):
define i32 @rand() {
%1 = call i64 (...) @lrand48()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @rand() {
%1 = tail call i64 (...) @lrand48()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
bool nrf52_errata_112(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_112() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xc5() {
  Assert_real((isodigit(197) == 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_isodigit.c",
              990, ("isodigit should be 0 for 0xc5"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xc5>:
push   %rax
mov    $0xc5,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3de,%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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xc5\00"
define void @t_isodigit_0xc5() {
%1 = call i64 @isodigit(i32 197)
%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 990, 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xc5\00"
define void @t_isodigit_0xc5() {
%1 = tail call i64 @isodigit(i32 197)
%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 990, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double DBL_EPSILON;
double DBL_MAX;
double DBL_MIN;
int /*<<< orphan*/ printf(char *, double);
int main() {
  printf("DBL_EPSILON = %e\n", DBL_EPSILON);
  printf("DBL_MIN     = %e\n", DBL_MIN);
  printf("DBL_MAX     = %e\n", DBL_MAX);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
movsd  (%rax),%xmm0
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9b(%rip),%rax
movsd  (%rax),%xmm0
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7c(%rip),%rax
movsd  (%rax),%xmm0
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
movsd  (%rax),%xmm0
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
movsd  (%rax),%xmm0
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e8a(%rip),%rax
movsd  (%rax),%xmm0
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"DBL_EPSILON = %e\0A\00"
@DBL_EPSILON = global double 0.000000e+00
@.str.1 = [18 x i8] c"DBL_MIN = %e\0A\00"
@DBL_MIN = global double 0.000000e+00
@.str.2 = [18 x i8] c"DBL_MAX = %e\0A\00"
@DBL_MAX = global double 0.000000e+00
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load double, double* @DBL_EPSILON
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %2)
%4 = load double, double* @DBL_MIN
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = load double, double* @DBL_MAX
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"DBL_EPSILON = %e\0A\00"
@DBL_EPSILON = global double 0.000000e+00
@.str.1 = [18 x i8] c"DBL_MIN = %e\0A\00"
@DBL_MIN = global double 0.000000e+00
@.str.2 = [18 x i8] c"DBL_MAX = %e\0A\00"
@DBL_MAX = global double 0.000000e+00
define i32 @main() {
%1 = load double, double* @DBL_EPSILON
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %1)
%3 = load double, double* @DBL_MIN
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = load double, double* @DBL_MAX
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}
/* Variables and functions */
int bar();
int foo();
void foo_bar(int *f, int *b) {
  *f = foo();
  *b = bar();
}


x86 assembly (clang, -O0):
<foo_bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_bar>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <foo@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
call   1030 <bar@plt>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @foo_bar(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = tail call i32 (...) @foo()
store i32 %3, i32* %0
%4 = tail call i32 (...) @bar()
store i32 %4, i32* %1
ret void
}
int main(void) {
  int i = 43;
  if (i-- < 43) {
    return 99;
  } else {
    return i;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2b,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x2b,%eax
jge    1132 <main+0x32>
movl   $0x63,-0x4(%rbp)
jmp    1138 <main+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
int noSmallerThan(int valve, int data) { return (data >= valve); }


x86 assembly (clang, -O0):
<noSmallerThan>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<noSmallerThan>:
xor    %eax,%eax
cmp    %edi,%esi
setge  %al
ret

LLVM IR (-O0):
define i32 @noSmallerThan(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = icmp sge i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @noSmallerThan(i32 %0, i32 %1) {
%3 = icmp sge i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
void w20(void *x, long long y) { *(long long *)(x + 32748) = y; }


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

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

LLVM IR (-O0):
define void @w20(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32748
%8 = bitcast i8* %7 to i64*
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @w20(i8* nocapture writeonly %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 32748
%4 = bitcast i8* %3 to i64*
store i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(int argc, char *argv[]) {
  int *startPos = (int *)5242880;
  int *idPos = (int *)5242884;
  unsigned int thisProc = (*idPos);
  printf("Hi from processor MIPS %u!\n", thisProc);
  (*startPos) = thisProc + 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x500000,%eax
mov    %rax,-0x18(%rbp)
mov    $0x500004,%eax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x500004,%ebx
lea    0xee1(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %ebx,0x500000
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Hi from processor MIPS %u!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* inttoptr (i64 5242880 to i32*), i32** %6
store i32* inttoptr (i64 5242884 to i32*), i32** %7
%9 = load i32*, i32** %7
%10 = load i32, i32* %9
store i32 %10, i32* %8
%11 = load i32, i32* %8
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %8
%14 = add i32 %13, 1
%15 = load i32*, i32** %6
store i32 %14, i32* %15
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Hi from processor MIPS %u!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* inttoptr (i64 5242884 to i32*)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add i32 %3, 1
store i32 %5, i32* inttoptr (i64 5242880 to i32*)
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int PTHREAD_CANCEL_ASYNCHRONOUS;
int __libc_nanosleep(struct timespec const *, struct timespec *);
int /*<<< orphan*/ pthread_setcanceltype(int, int *);
int __attribute__((weak))
nanosleep(const struct timespec *requested_time, struct timespec *remaining) {
  int result;
  int oldtype;
  pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);
  result = __libc_nanosleep(requested_time, remaining);
  pthread_setcanceltype(oldtype, NULL);
  return result;
}


x86 assembly (clang, -O0):
<nanosleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__libc_nanosleep@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_setcanceltype@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanosleep>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
call   1040 <pthread_setcanceltype@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <__libc_nanosleep@plt>
mov    %eax,%ebx
mov    0x4(%rsp),%edi
xor    %esi,%esi
call   1040 <pthread_setcanceltype@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
%5 = alloca i32
%6 = alloca i32
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%7 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%8 = call i32 @pthread_setcanceltype(i32 %7, i32* %6)
%9 = load %struct.timespec*, %struct.timespec** %3
%10 = load %struct.timespec*, %struct.timespec** %4
%11 = call i32 @__libc_nanosleep(%struct.timespec* %9, %struct.timespec* %10)
store i32 %11, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @pthread_setcanceltype(i32 %12, i32* null)
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@PTHREAD_CANCEL_ASYNCHRONOUS = global i32 0
define weak i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* @PTHREAD_CANCEL_ASYNCHRONOUS
%6 = call i32 @pthread_setcanceltype(i32 %5, i32* %3)
%7 = call i32 @__libc_nanosleep(%struct.timespec* %0, %struct.timespec* %1)
%8 = load i32, i32* %3
%9 = call i32 @pthread_setcanceltype(i32 %8, i32* null)
ret i32 %7
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ timer_getTickCount64();
void timer_wait(uint64_t usec) {
  usec += timer_getTickCount64();
  while (timer_getTickCount64() < usec) {
  };
}


x86 assembly (clang, -O0):
<timer_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <timer_getTickCount64@plt>
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <timer_getTickCount64@plt>
cmp    -0x8(%rbp),%rax
jge    1141 <timer_wait+0x31>
jmp    112b <timer_wait+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_wait>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <timer_getTickCount64@plt>
mov    %rax,%rbx
add    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <timer_getTickCount64@plt>
cmp    %rbx,%rax
jl     1130 <timer_wait+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @timer_wait(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i64 (...) @timer_getTickCount64()
%4 = load i64, i64* %2
%5 = add nsw i64 %4, %3
store i64 %5, i64* %2
br label %6
6: ; preds = %10, %1
%7 = call i64 (...) @timer_getTickCount64()
%8 = load i64, i64* %2
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @timer_wait(i64 %0) {
%2 = tail call i64 (...) @timer_getTickCount64()
%3 = add nsw i64 %2, %0
br label %4
4: ; preds = %4, %1
%5 = tail call i64 (...) @timer_getTickCount64()
%6 = icmp slt i64 %5, %3
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}