xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ uc_io_init_onboard_led();
void ind_init() { uc_io_init_onboard_led(); }


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

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

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

LLVM IR (-O2):
define void @ind_init() {
%1 = tail call i32 (...) @uc_io_init_onboard_led()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ spi_write_byte(int);
void nrf_flush_tx() {
  ;
  spi_write_byte((0xE1));
  ;
}


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

x86 assembly (clang, -O2):
<nrf_flush_tx>:
mov    $0xe1,%edi
jmp    1030 <spi_write_byte@plt>

LLVM IR (-O0):
define void @nrf_flush_tx() {
%1 = call i32 @spi_write_byte(i32 225)
ret void
}

LLVM IR (-O2):
define void @nrf_flush_tx() {
%1 = tail call i32 @spi_write_byte(i32 225)
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
void trocar(char *a, char *b) {
  char *novo = malloc(10);
  strcpy(novo, a);
  strcpy(a, b);
  strcpy(b, novo);
}


x86 assembly (clang, -O0):
<trocar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trocar>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @trocar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i8* @malloc(i32 10)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %3
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i32 @strcpy(i8* %13, i8* %14)
ret void
}

LLVM IR (-O2):
define void @trocar(i8* %0, i8* %1) {
%3 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%4 = tail call i32 @strcpy(i8* %3, i8* %0)
%5 = tail call i32 @strcpy(i8* %0, i8* %1)
%6 = tail call i32 @strcpy(i8* %1, i8* %3)
ret void
}
/* Variables and functions */
double log10(double);
double pow(double, double);
double concentration(double mvir, double scale) {
  if (!(mvir > 0))
    return 0;
  double logm = log10(mvir);
  return (pow(10.0, 2.2358 - 0.10 * logm) * scale);
}


x86 assembly (clang, -O0):
<concentration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
ja     1151 <concentration+0x31>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1194 <concentration+0x74>
movsd  -0x10(%rbp),%xmm0
call   1040 <log10@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  0xe9b(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe97(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe7b(%rip),%xmm0
call   1030 <pow@plt>
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concentration>:
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jbe    1167 <concentration+0x47>
push   %rax
movapd %xmm2,%xmm0
movsd  %xmm1,(%rsp)
call   1040 <log10@plt>
movapd %xmm0,%xmm1
mulsd  0xeb7(%rip),%xmm1
addsd  0xeb7(%rip),%xmm1
movsd  0xeb7(%rip),%xmm0
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
define double @concentration(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %10, label %9
9: ; preds = %2
store double 0.000000e+00, double* %3
br label %18
10: ; preds = %2
%11 = load double, double* %4
%12 = call double @log10(double %11)
store double %12, double* %6
%13 = load double, double* %6
%14 = call double @llvm.fmuladd.f64(double -1.000000e-01, double %13, double 2.235800e+00)
%15 = call double @pow(double 1.000000e+01, double %14)
%16 = load double, double* %5
%17 = fmul double %15, %16
store double %17, double* %3
br label %18
18: ; preds = %10, %9
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @concentration(double %0, double %1) {
%3 = fcmp ogt double %0, 0.000000e+00
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = tail call double @log10(double %0)
%6 = tail call double @llvm.fmuladd.f64(double %5, double -1.000000e-01, double 2.235800e+00)
%7 = tail call double @pow(double 1.000000e+01, double %6)
%8 = fmul double %7, %1
br label %9
9: ; preds = %2, %4
%10 = phi double [ %8, %4 ], [ 0.000000e+00, %2 ]
ret double %10
}
void caller_2_2_1_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_2_1_2_1_1_1() {
ret void
}
/* Variables and functions */
int rand();
void vectorrandom(char *vec, int len) {
  int i = 0;
  while (i < len) {
    vec[i] = rand() % 256;
    i++;
  }
}


x86 assembly (clang, -O0):
<vectorrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <vectorrandom+0x4a>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <vectorrandom+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @vectorrandom(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %10, %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 = call i32 (...) @rand()
%12 = srem i32 %11, 256
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 %13, i8* %17
%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 @vectorrandom(i8* nocapture writeonly %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 = tail call i32 (...) @rand()
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %9, i8* %10
%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 */
char *gettext(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double sin(double);
double Seno(double a) {
  printf(gettext("Enter a number: "));
  scanf("%lf", &a);
  return (sin(a));
}


x86 assembly (clang, -O0):
<Seno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1050 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Seno>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xeb3(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <sin@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Seno(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @sin(double %6)
ret double %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Seno(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @sin(double %6)
ret double %7
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBHighSpeed(uint32_t ui32Base, bool bEnable) {
  ;
  if (bEnable) {
    (*((volatile uint8_t *)(ui32Base + 0x00000001))) |= 0x00000020;
  } else {
    (*((volatile uint8_t *)(ui32Base + 0x00000001))) &= ~0x00000020;
  }
}


x86 assembly (clang, -O0):
<USBHighSpeed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1127 <USBHighSpeed+0x27>
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%ecx
or     $0x20,%ecx
mov    %ecx,0x1(%rax)
jmp    1134 <USBHighSpeed+0x34>
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%ecx
and    $0xffffffdf,%ecx
mov    %ecx,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBHighSpeed>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    0x1(%rdi),%ecx
and    $0xffffffdf,%ecx
shl    $0x5,%eax
or     %ecx,%eax
mov    %eax,0x1(%rdi)
ret

LLVM IR (-O0):
define void @USBHighSpeed(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 1
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = or i32 %11, 32
store volatile i32 %12, i32* %10
br label %19
13: ; preds = %2
%14 = load i64, i64* %3
%15 = add nsw i64 %14, 1
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = and i32 %17, -33
store volatile i32 %18, i32* %16
br label %19
19: ; preds = %13, %7
ret void
}

LLVM IR (-O2):
define void @USBHighSpeed(i64 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = add nsw i64 %0, 1
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -33
%8 = select i1 %3, i32 0, i32 32
%9 = or i32 %7, %8
store volatile i32 %9, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(void) {
  printf("Line %d of file %s\n", 8,
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/frwdrik/prog_edu/refs/heads/oppgaver/CMA/"
         "ch14/exercise8.c");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Line %d of file %s\0A\00"
@.str.1 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/frwdrik/prog_edu/refs/heads/oppgaver/CMA/ch14/exercise8.c\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Line %d of file %s\0A\00"
@.str.1 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/frwdrik/prog_edu/refs/heads/oppgaver/CMA/ch14/exercise8.c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int get_node_row(int n_rows, int node_col, int node_index) {
  return node_index - (node_col * n_rows);
}


x86 assembly (clang, -O0):
<get_node_row>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x4(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_node_row>:
mov    %edx,%eax
imul   %esi,%edi
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @get_node_row(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_node_row(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = sub nsw i32 %2, %4
ret i32 %5
}
/* Variables and functions */
bool isSorted(size_t *array, size_t size) {
  size_t i;
  for (i = 0; i < size - 1; i++) {
    if (array[i] > array[i + 1])
      return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<isSorted>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jae    116a <isSorted+0x6a>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rdx
cmp    0x8(%rcx,%rdx,8),%rax
jbe    1154 <isSorted+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1171 <isSorted+0x71>
jmp    1159 <isSorted+0x59>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <isSorted+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSorted>:
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %rax,%rsi
je     112a <isSorted+0x2a>
mov    -0x8(%rdi,%rax,8),%rcx
lea    0x1(%rax),%rdx
cmp    (%rdi,%rax,8),%rcx
mov    %rdx,%rax
jbe    1110 <isSorted+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isSorted(i64* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 0, i64* %6
br label %7
7: ; preds = %25, %2
%8 = load i64, i64* %6
%9 = load i64, i64* %5
%10 = sub i64 %9, 1
%11 = icmp ult i64 %8, %10
br i1 %11, label %12, label %28
12: ; preds = %7
%13 = load i64*, i64** %4
%14 = load i64, i64* %6
%15 = getelementptr inbounds i64, i64* %13, i64 %14
%16 = load i64, i64* %15
%17 = load i64*, i64** %4
%18 = load i64, i64* %6
%19 = add i64 %18, 1
%20 = getelementptr inbounds i64, i64* %17, i64 %19
%21 = load i64, i64* %20
%22 = icmp ugt i64 %16, %21
br i1 %22, label %23, label %24
23: ; preds = %12
store i32 0, i32* %3
br label %29
24: ; preds = %12
br label %25
25: ; preds = %24
%26 = load i64, i64* %6
%27 = add i64 %26, 1
store i64 %27, i64* %6
br label %7
28: ; preds = %7
store i32 1, i32* %3
br label %29
29: ; preds = %28, %23
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @isSorted(i64* nocapture %0, i64 %1) {
%3 = add i64 %1, -1
br label %4
4: ; preds = %7, %2
%5 = phi i64 [ 0, %2 ], [ %10, %7 ]
%6 = icmp eq i64 %5, %3
br i1 %6, label %14, label %7
7: ; preds = %4
%8 = getelementptr inbounds i64, i64* %0, i64 %5
%9 = load i64, i64* %8
%10 = add i64 %5, 1
%11 = getelementptr inbounds i64, i64* %0, i64 %10
%12 = load i64, i64* %11
%13 = icmp ugt i64 %9, %12
br i1 %13, label %14, label %4
14: ; preds = %4, %7
%15 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %15
}
/* Variables and functions */
int Particione(int *, int, int);
void Quick(int *v, int esquerda, int direita) {
  int i;
  if (esquerda < direita) {
    i = Particione(v, esquerda, direita);
    Quick(v, esquerda, i - 1);
    Quick(v, i + 1, direita);
  }
}


x86 assembly (clang, -O0):
<Quick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <Quick+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <Particione@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <Quick@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <Quick@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Quick>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <Quick+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <Particione@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <Quick@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <Quick+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Quick(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @Particione(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @Quick(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(long);
void cmdWait(unsigned int clocks, unsigned long usedTime) {
  signed long procTime, waitTime;
  procTime = clocks * 0.2;
  waitTime = procTime - usedTime;
  if (waitTime > 0) {
    delay(waitTime);
  }
}


x86 assembly (clang, -O0):
<cmdWait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jle    115c <cmdWait+0x4c>
mov    -0x20(%rbp),%rdi
call   1030 <delay@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdWait>:
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
mulsd  0xee1(%rip),%xmm0
cvttsd2si %xmm0,%rdi
sub    %rsi,%rdi
test   %rdi,%rdi
jle    1131 <cmdWait+0x21>
jmp    1030 <delay@plt>
ret

LLVM IR (-O0):
define void @cmdWait(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%7 = load i32, i32* %3
%8 = uitofp i32 %7 to double
%9 = fmul double %8, 2.000000e-01
%10 = fptosi double %9 to i64
store i64 %10, i64* %5
%11 = load i64, i64* %5
%12 = load i64, i64* %4
%13 = sub i64 %11, %12
store i64 %13, i64* %6
%14 = load i64, i64* %6
%15 = icmp sgt i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = load i64, i64* %6
%18 = call i32 @delay(i64 %17)
br label %19
19: ; preds = %16, %2
ret void
}

LLVM IR (-O2):
define void @cmdWait(i32 %0, i64 %1) {
%3 = uitofp i32 %0 to double
%4 = fmul double %3, 2.000000e-01
%5 = fptosi double %4 to i64
%6 = sub i64 %5, %1
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @delay(i64 %6)
br label %10
10: ; preds = %8, %2
ret void
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int offset(int, int, int, int);
int owl_eyespace(int, int);
int autohelperowl_vital_apat39(struct pattern *patt, int transformation,
                               int move, int color, int action) {
  int A, B;
  (void)patt;
  (void)color;
  (void)action;
  A = offset(1, -2, move, transformation);
  B = offset(1, -1, move, transformation);
  return owl_eyespace(A, B);
}


x86 assembly (clang, -O0):
<autohelperowl_vital_apat39>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
mov    $0xfffffffe,%esi
call   1040 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
mov    $0xffffffff,%esi
call   1040 <offset@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1030 <owl_eyespace@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_vital_apat39>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    $0x1,%edi
mov    $0xfffffffe,%esi
mov    %ebp,%ecx
call   1040 <offset@plt>
mov    %eax,%r14d
mov    $0x1,%edi
mov    $0xffffffff,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1040 <offset@plt>
mov    %r14d,%edi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <owl_eyespace@plt>

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_vital_apat39(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load %struct.pattern*, %struct.pattern** %6
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = load i32, i32* %8
%17 = load i32, i32* %7
%18 = call i32 @offset(i32 1, i32 -2, i32 %16, i32 %17)
store i32 %18, i32* %11
%19 = load i32, i32* %8
%20 = load i32, i32* %7
%21 = call i32 @offset(i32 1, i32 -1, i32 %19, i32 %20)
store i32 %21, i32* %12
%22 = load i32, i32* %11
%23 = load i32, i32* %12
%24 = call i32 @owl_eyespace(i32 %22, i32 %23)
ret i32 %24
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_vital_apat39(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 1, i32 -2, i32 %2, i32 %1)
%7 = tail call i32 @offset(i32 1, i32 -1, i32 %2, i32 %1)
%8 = tail call i32 @owl_eyespace(i32 %6, i32 %7)
ret i32 %8
}
int int_cmp(const void *_a, const void *_b) {
  int a = *(int *)_a;
  int b = *(int *)_b;
  return a - b;
}


x86 assembly (clang, -O0):
<int_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @int_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xf2() {
  Assert_real((isalnum(242) == 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_isalnum.c",
              1215, ("isalnum should be 0 for 0xf2"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xf2\00"
define void @t_isalnum_0xf2() {
%1 = call i64 @isalnum(i32 242)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1215, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xf2\00"
define void @t_isalnum_0xf2() {
%1 = tail call i64 @isalnum(i32 242)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1215, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void toggleMute(struct playerHandles *ph, int *mute) {}


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

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

LLVM IR (-O0):
%struct.playerHandles = type opaque
define void @toggleMute(%struct.playerHandles* %0, i32* %1) {
%3 = alloca %struct.playerHandles*
%4 = alloca i32*
store %struct.playerHandles* %0, %struct.playerHandles** %3
store i32* %1, i32** %4
ret void
}

LLVM IR (-O2):
%struct.playerHandles = type opaque
define void @toggleMute(%struct.playerHandles* nocapture %0, i32* nocapture %1) {
ret void
}
double fabs(double x) {
  __asm__("fabs" : "+t"(x));
  return x;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
fldl   -0x10(%rbp)
fabs
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
fabs
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double asm "fabs", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %3)
store double %4, double* %2
%5 = load double, double* %2
ret double %5
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = tail call double asm "fabs", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %0)
ret double %2
}
/* Variables and functions */
int init_server_long(int *, int, int /*<<< orphan*/ *, int);
int init_server(int *sock, int port, int type) {
  return (init_server_long(sock, port, NULL, type));
}


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

x86 assembly (clang, -O2):
<init_server>:
mov    %edx,%ecx
xor    %edx,%edx
jmp    1030 <init_server_long@plt>

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

LLVM IR (-O2):
define i32 @init_server(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @init_server_long(i32* %0, i32 %1, i32* null, i32 %2)
ret i32 %4
}
void rop3_222_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk1 = S | stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_222_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_222_0_0>:
xor    (%rdi),%dl
or     %sil,%dl
mov    %dl,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_222_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = or i8 %5, %1
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("I am the mighty foo!\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"I am the mighty foo!\0A\00"
define void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"I am the mighty foo!\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
int bat(int n, int p[n]) { return p[n]; }


x86 assembly (clang, -O0):
<bat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bat>:
movslq %edi,%rax
mov    (%rsi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @bat(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
%7 = load i32*, i32** %4
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @bat(i32 %0, i32* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
int hex_digit(char c) {
  return ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') ||
          (c >= 'a' && c <= 'f'));
}


x86 assembly (clang, -O0):
<hex_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <hex_digit+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <hex_digit+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <hex_digit+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x46,%ecx
mov    %al,-0x2(%rbp)
jle    116d <hex_digit+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <hex_digit+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x66,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_digit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @hex_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 70
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 97
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 102
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @hex_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef size_t uint64_t;

/* Variables and functions */
int access(uint64_t j) {
  int a[3];
  a[0] = 100;
  a[1] = 101;
  a[2] = 102;
  return a[j];
}


x86 assembly (clang, -O0):
<access>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x64,-0x14(%rbp)
movl   $0x65,-0x10(%rbp)
movl   $0x66,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp,%rax,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<access>:
movabs $0x6500000064,%rax
mov    %rax,-0xc(%rsp)
movl   $0x66,-0x4(%rsp)
mov    -0xc(%rsp,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @access(i64 %0) {
%2 = alloca i64
%3 = alloca [3 x i32]
store i64 %0, i64* %2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32 100, i32* %4
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
store i32 101, i32* %5
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
store i32 102, i32* %6
%7 = load i64, i64* %2
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @access(i64 %0) {
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %2 to i8*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32 100, i32* %4
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
store i32 101, i32* %5
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
store i32 102, i32* %6
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 %0
%8 = load i32, i32* %7
ret i32 %8
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ event;
};
struct TYPE_4__ {
  TYPE_1__ xconfigure;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xconfigure_event(void *_p) {
  return (unsigned long)((XEvent *)_p)->xconfigure.event;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xconfigure_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
const char *lex_feature_value(char *feat) { return (feat ? feat : ""); }


x86 assembly (clang, -O0):
<lex_feature_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1120 <lex_feature_value+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <lex_feature_value+0x30>
lea    0xed9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <lex_feature_value+0x30>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lex_feature_value>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @lex_feature_value(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i8*, i8** %2
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %5
%9 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %7 ]
ret i8* %9
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @lex_feature_value(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}
int lhs(int x) {
  void *ptr;
  ptr = (void *)x;
  return (int)ptr;
}


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

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

LLVM IR (-O0):
define i32 @lhs(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lhs(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ sleepao();
void think_eat(void) {
  sleepao();
  return;
}


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

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

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

LLVM IR (-O2):
define void @think_eat() {
%1 = tail call i32 (...) @sleepao()
ret void
}
void nullpo_init(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_set_filename() {
ret void
}
char __readUARTChar() {
  int i;
  char out;
  i = (*(volatile int *)(((0x7f000000) | 0x9000000000000000)));
  while ((i & 0x00800000) == 0) {
    i = (*(volatile int *)(((0x7f000000) | 0x9000000000000000)));
  }
  i = i >> 24;
  out = (char)i;
  return out;
}


x86 assembly (clang, -O0):
<__readUARTChar>:
push   %rbp
mov    %rsp,%rbp
movabs $0x900000007f000000,%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x800000,%eax
cmp    $0x0,%eax
jne    1138 <__readUARTChar+0x38>
movabs $0x900000007f000000,%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1113 <__readUARTChar+0x13>
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__readUARTChar>:
movabs $0x900000007f000000,%rcx
nopw   0x0(%rax,%rax,1)
mov    (%rcx),%eax
test   $0x800000,%eax
je     1110 <__readUARTChar+0x10>
shr    $0x18,%eax
ret

LLVM IR (-O0):
define signext i8 @__readUARTChar() {
%1 = alloca i32
%2 = alloca i8
%3 = load volatile i32, i32* inttoptr (i64 -8070450530117222400 to i32*)
store i32 %3, i32* %1
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %1
%6 = and i32 %5, 8388608
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load volatile i32, i32* inttoptr (i64 -8070450530117222400 to i32*)
store i32 %9, i32* %1
br label %4
10: ; preds = %4
%11 = load i32, i32* %1
%12 = ashr i32 %11, 24
store i32 %12, i32* %1
%13 = load i32, i32* %1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @__readUARTChar() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 -8070450530117222400 to i32*)
%3 = and i32 %2, 8388608
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = lshr i32 %2, 24
%7 = trunc i32 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void cmd_arg_default_helpfun(void *data) {
  char *name = (char *)data;
  printf("Usage: %s [OPTION]\n"
         "\t-h - help (this text)\n"
         "\t-v - version information\n"
         "\t-c filename - use configuration file \"filename\"\n",
         name);
  exit(EXIT_SUCCESS);
}


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

x86 assembly (clang, -O2):
<cmd_arg_default_helpfun>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [118 x i8] c"Usage: %s [OPTION]\0A\09-h - help (this text)\0A\09-v - version information\0A\09-c filename - use configuration file \22filename\22\0A\00"
@EXIT_SUCCESS = global i32 0
define void @cmd_arg_default_helpfun(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @EXIT_SUCCESS
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [118 x i8] c"Usage: %s [OPTION]\0A\09-h - help (this text)\0A\09-v - version information\0A\09-c filename - use configuration file \22filename\22\0A\00"
@EXIT_SUCCESS = global i32 0
define void @cmd_arg_default_helpfun(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void function() { puts("function!"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"function!\00"
define void @function() {
%1 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"function!\00"
define void @function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
void ls() {}


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

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

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

LLVM IR (-O2):
define void @ls() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
__attribute__((always_)) uint16_t BME_LAC1_H(volatile uint16_t *addr,
                                             uint8_t bit) {
  return *(volatile uint16_t *)((uint32_t)addr | (1 << 27) | (bit << 21));
}


x86 assembly (clang, -O0):
<BME_LAC1_H>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
or     $0x8000000,%eax
mov    -0xc(%rbp),%ecx
shl    $0x15,%ecx
or     %ecx,%eax
cltq
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BME_LAC1_H>:
shl    $0x15,%esi
or     %edi,%esi
movslq %esi,%rax
or     $0x8000000,%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @BME_LAC1_H(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = ptrtoint i32* %5 to i32
%7 = or i32 %6, 134217728
%8 = load i32, i32* %4
%9 = shl i32 %8, 21
%10 = or i32 %7, %9
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @BME_LAC1_H(i32* %0, i32 %1) {
%3 = ptrtoint i32* %0 to i64
%4 = trunc i64 %3 to i32
%5 = shl i32 %1, 21
%6 = or i32 %5, %4
%7 = or i32 %6, 134217728
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  int i = 0;
  printf("%d", a);
  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>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb0(%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),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%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"
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)
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 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
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}