xunge/DecIR huggingface dataset:
/* Variables and functions */
double log(int);
double logPDFNormal(double x, double mu, double sigma2) {
  return -0.5 * log(2 * 3.1415926535897932384626433832795 * sigma2) -
         0.5 / sigma2 * (x - mu) * (x - mu);
}


x86 assembly (clang, -O0):
<logPDFNormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee1(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  0xec3(%rip),%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  -0x8(%rbp),%xmm2
subsd  -0x10(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe7b(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logPDFNormal>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
movsd  0xed3(%rip),%xmm0
mulsd  %xmm2,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  (%rsp),%xmm2
subsd  0x8(%rsp),%xmm2
movsd  0xebb(%rip),%xmm1
mulsd  %xmm1,%xmm0
divsd  0x10(%rsp),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @logPDFNormal(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = fmul double 0x401921FB54442D18, %7
%9 = fptosi double %8 to i32
%10 = call double @log(i32 %9)
%11 = load double, double* %6
%12 = fdiv double 5.000000e-01, %11
%13 = load double, double* %4
%14 = load double, double* %5
%15 = fsub double %13, %14
%16 = fmul double %12, %15
%17 = load double, double* %4
%18 = load double, double* %5
%19 = fsub double %17, %18
%20 = fmul double %16, %19
%21 = fneg double %20
%22 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %10, double %21)
ret double %22
}

LLVM IR (-O2):
define double @logPDFNormal(double %0, double %1, double %2) {
%4 = fmul double %2, 0x401921FB54442D18
%5 = fptosi double %4 to i32
%6 = tail call double @log(i32 %5)
%7 = fsub double %0, %1
%8 = fdiv double -5.000000e-01, %2
%9 = fmul double %7, %8
%10 = fmul double %7, %9
%11 = tail call double @llvm.fmuladd.f64(double %6, double -5.000000e-01, double %10)
ret double %11
}
int do_541() { return 541; }


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

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

LLVM IR (-O0):
define i32 @do_541() {
ret i32 541
}

LLVM IR (-O2):
define i32 @do_541() {
ret i32 541
}
/* Variables and functions */
int /*<<< orphan*/ pifacecad_lcd_send_command(int);
void pifacecad_lcd_move_left(void) {
  pifacecad_lcd_send_command(0x10 | 0x08 | 0x00);
}


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

x86 assembly (clang, -O2):
<pifacecad_lcd_move_left>:
mov    $0x18,%edi
jmp    1030 <pifacecad_lcd_send_command@plt>

LLVM IR (-O0):
define void @pifacecad_lcd_move_left() {
%1 = call i32 @pifacecad_lcd_send_command(i32 24)
ret void
}

LLVM IR (-O2):
define void @pifacecad_lcd_move_left() {
%1 = tail call i32 @pifacecad_lcd_send_command(i32 24)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("%d", 5);
  printf("A\n");
  char c[] = "1234567";
  printf(c);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
movabs $0x37363534333231,%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [2 x i8] c"A\00"
define i32 @main() {
%1 = alloca i64
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%4 = bitcast i64* %1 to i8*
store i64 15540725856023089, i64* %1
%5 = call i32 (i8*, ...) @printf(i8* %4)
ret i32 0
}
/* Variables and functions */
char toupper(unsigned char);
void convertToUpperCase(char *s) {
  while (*s != '\0') {
    *s = toupper((unsigned char)*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<convertToUpperCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <convertToUpperCase+0x41>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <convertToUpperCase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertToUpperCase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <convertToUpperCase+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <convertToUpperCase+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @convertToUpperCase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call signext i8 @toupper(i8 zeroext %10)
%12 = load i8*, i8** %2
store i8 %11, i8* %12
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @convertToUpperCase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 zeroext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bcm2835_spi_transfern(char *, int);
unsigned char Read_MFRC522(unsigned char addr) {
  char buf[2];
  buf[0] = ((addr << 1) & 0x7E) | 0x80;
  buf[1] = 0x00;
  bcm2835_spi_transfern(buf, 2);
  return buf[1];
}


x86 assembly (clang, -O0):
<Read_MFRC522>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
and    $0x7e,%eax
or     $0x80,%eax
mov    %al,-0x3(%rbp)
movb   $0x0,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
mov    $0x2,%esi
call   1030 <bcm2835_spi_transfern@plt>
movzbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read_MFRC522>:
push   %rax
add    %dil,%dil
or     $0x80,%dil
mov    %dil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <bcm2835_spi_transfern@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @Read_MFRC522(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = shl i32 %5, 1
%7 = and i32 %6, 126
%8 = or i32 %7, 128
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %9, i8* %10
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %11
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%13 = call i32 @bcm2835_spi_transfern(i8* %12, i32 2)
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%15 = load i8, i8* %14
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @Read_MFRC522(i8 zeroext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = shl i8 %0, 1
%5 = or i8 %4, -128
store i8 %5, i8* %3
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 0, i8* %6
%7 = call i32 @bcm2835_spi_transfern(i8* %3, i32 2)
%8 = load i8, i8* %6
ret i8 %8
}
int compare_down(const void *num1, const void *num2) {
  return (*(int *)num2 - *(int *)num1);
}


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

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

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

LLVM IR (-O2):
define i32 @compare_down(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, char);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void showBadNumeralPairMessage(char a, char b) {
  fprintf(stderr, "Error. Invalid Roman numeral pair '%c%c' ", a, b);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<showBadNumeralPairMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    -0x1(%rbp),%al
lea    0xeb9(%rip),%rsi
movsbl %al,%edx
movsbl -0x2(%rbp),%ecx
call   1030 <fprintf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showBadNumeralPairMessage>:
push   %rax
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Error. Invalid Roman numeral pair '%c%c' \00"
@stdout = global i32 0
define void @showBadNumeralPairMessage(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i32, i32* @stderr
%6 = load i8, i8* %3
%7 = load i8, i8* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8 signext %6, i8 signext %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Error. Invalid Roman numeral pair '%c%c' \00"
@stdout = global i32 0
define void @showBadNumeralPairMessage(i8 signext %0, i8 signext %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1)
%5 = load i32, i32* @stdout
%6 = tail call i32 @fflush(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x2e() {
  Assert_real((isdigit(46) == 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_isdigit.c",
              235, ("isdigit should be 0 for ."));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x2e>:
push   %rax
mov    $0x2e,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xeb,%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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for .\00"
define void @t_isdigit_0x2e() {
%1 = call i64 @isdigit(i32 46)
%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 235, i8* getelementptr inbounds ([26 x i8], [26 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for .\00"
define void @t_isdigit_0x2e() {
%1 = tail call i64 @isdigit(i32 46)
%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 235, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};
typedef int in_addr_t;

/* Variables and functions */
int htonl(int /*<<< orphan*/);
int get_nmask(struct in_addr mask) {
  int i;
  in_addr_t m = htonl(mask.s_addr);
  for (i = 0; m <<= 1; i++)
    ;
  if (i)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<get_nmask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1152 <get_nmask+0x42>
jmp    1144 <get_nmask+0x34>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <get_nmask+0x1d>
cmpl   $0x0,-0xc(%rbp)
je     1165 <get_nmask+0x55>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_nmask>:
push   %rax
call   1030 <htonl@plt>
add    %eax,%eax
je     111f <get_nmask+0xf>
bsf    %eax,%edx
jmp    1124 <get_nmask+0x14>
mov    $0x20,%edx
mov    $0x21,%ecx
sub    %edx,%ecx
test   %eax,%eax
cmove  %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i32 @get_nmask(i32 %0) {
%2 = alloca %struct.in_addr
%3 = alloca i32
%4 = alloca i32
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @htonl(i32 %7)
store i32 %8, i32* %4
store i32 0, i32* %3
br label %9
9: ; preds = %14, %1
%10 = load i32, i32* %4
%11 = shl i32 %10, 1
store i32 %11, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
br label %14
14: ; preds = %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %9
17: ; preds = %9
%18 = load i32, i32* %3
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %23
23: ; preds = %20, %17
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @get_nmask(i32 %0) {
%2 = tail call i32 @htonl(i32 %0)
%3 = shl i32 %2, 1
%4 = call i32 @llvm.cttz.i32(i32 %3, i1 false)
%5 = sub nuw nsw i32 33, %4
%6 = icmp eq i32 %3, 0
%7 = select i1 %6, i32 0, i32 %5
ret i32 %7
}
void wx11dv(dev) char dev[];
{}


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

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

LLVM IR (-O0):
define void @wx11dv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @wx11dv(i8* nocapture %0) {
ret void
}
int export_to_file() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @export_to_file() {
ret i32 0
}
unsigned long apic_read(unsigned long reg) {
  return *((volatile unsigned long *)(0xfee00000 + reg));
}


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

x86 assembly (clang, -O2):
<apic_read>:
mov    $0xfee00000,%eax
mov    (%rdi,%rax,1),%rax
ret

LLVM IR (-O0):
define i64 @apic_read(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 4276092928, %3
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @apic_read(i64 %0) {
%2 = add i64 %0, 4276092928
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
ret i64 %4
}
const char *Sys_SteamPath(void) {
  static char steamPath[256];
  return steamPath;
}


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

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

LLVM IR (-O0):
@Sys_SteamPath.steamPath = internal global [256 x i8] zeroinitializer
define i8* @Sys_SteamPath() {
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @Sys_SteamPath.steamPath, i64 0, i64 0)
}

LLVM IR (-O2):
@Sys_SteamPath.steamPath = internal global [256 x i8] zeroinitializer
define i8* @Sys_SteamPath() {
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @Sys_SteamPath.steamPath, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ function3();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello from program.c\n");
  function3();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Hello from program.c\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @function3()
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"Hello from program.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @function3()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fread(void *ptr __attribute__((unused)),
             size_t size __attribute__((unused)),
             size_t nmemb __attribute__((unused)),
             FILE *stream __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<fread>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
ret i64 0
}

LLVM IR (-O2):
define i64 @fread(i8* nocapture readnone %0, i64 %1, i64 %2, i32* nocapture readnone %3) {
ret i64 0
}
/* Variables and functions */
scalar_t__ sfd_islower(char const);
char sfd_toupper(const char c) { return (sfd_islower(c)) ? (c - 32) : c; }


x86 assembly (clang, -O0):
<sfd_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <sfd_islower@plt>
cmp    $0x0,%rax
je     1140 <sfd_toupper+0x30>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <sfd_toupper+0x37>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfd_toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <sfd_islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
movzbl %cl,%eax
cmove  %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @sfd_toupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @sfd_islower(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %8, 32
br label %13
10: ; preds = %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
br label %13
13: ; preds = %10, %6
%14 = phi i32 [ %9, %6 ], [ %12, %10 ]
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @sfd_toupper(i8 signext %0) {
%2 = tail call i64 @sfd_islower(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %0, i8 %4
ret i8 %5
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
bool sancus_get_u16zu(size_t v, uint16_t *out) {
  if (v <= 0xffff) {
    if (out != NULL)
      *out = (uint16_t)v;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<sancus_get_u16zu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0xffff,-0x10(%rbp)
ja     113c <sancus_get_u16zu+0x3c>
cmpq   $0x0,-0x18(%rbp)
je     1130 <sancus_get_u16zu+0x30>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1143 <sancus_get_u16zu+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_u16zu>:
xor    %eax,%eax
cmp    $0xffff,%rdi
ja     1118 <sancus_get_u16zu+0x18>
mov    $0x1,%eax
test   %rsi,%rsi
je     1118 <sancus_get_u16zu+0x18>
mov    %rdi,(%rsi)
ret

LLVM IR (-O0):
define i32 @sancus_get_u16zu(i64 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %4
store i64* %1, i64** %5
%6 = load i64, i64* %4
%7 = icmp ule i64 %6, 65535
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i64*, i64** %5
%10 = icmp ne i64* %9, null
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i64, i64* %4
%13 = load i64*, i64** %5
store i64 %12, i64* %13
br label %14
14: ; preds = %11, %8
store i32 1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @sancus_get_u16zu(i64 %0, i64* writeonly %1) {
%3 = icmp ult i64 %0, 65536
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = icmp eq i64* %1, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i64 %0, i64* %1
br label %7
7: ; preds = %2, %4, %6
%8 = phi i32 [ 1, %6 ], [ 1, %4 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int A_NORMAL;
int COLOR_PAIR(int /*<<< orphan*/);
int /*<<< orphan*/ COLOR_WHITE;
int /*<<< orphan*/ attrset(int);
int /*<<< orphan*/ centered_string(int, char *);
int /*<<< orphan*/ draw_box(int);
int strlen(char *);
int wait_for_input();
int msgbox(char *message) {
  int len = strlen(message);
  draw_box(len);
  attrset(COLOR_PAIR(COLOR_WHITE) | A_NORMAL);
  centered_string(23 / 2, message);
  attrset(A_NORMAL);
  return wait_for_input();
}


x86 assembly (clang, -O0):
<msgbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <draw_box@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
mov    0x2e51(%rip),%rax
or     (%rax),%edi
call   1070 <attrset@plt>
mov    -0x8(%rbp),%rsi
mov    $0xb,%edi
call   1080 <centered_string@plt>
mov    0x2e35(%rip),%rax
mov    (%rax),%edi
call   1070 <attrset@plt>
mov    $0x0,%al
call   1040 <wait_for_input@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgbox>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <strlen@plt>
mov    %eax,%edi
call   1030 <draw_box@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1060 <COLOR_PAIR@plt>
mov    0x2e60(%rip),%r14
or     (%r14),%eax
mov    %eax,%edi
call   1070 <attrset@plt>
mov    $0xb,%edi
mov    %rbx,%rsi
call   1080 <centered_string@plt>
mov    (%r14),%edi
call   1070 <attrset@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <wait_for_input@plt>

LLVM IR (-O0):
@COLOR_WHITE = global i32 0
@A_NORMAL = global i32 0
define i32 @msgbox(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @draw_box(i32 %6)
%8 = load i32, i32* @COLOR_WHITE
%9 = call i32 @COLOR_PAIR(i32 %8)
%10 = load i32, i32* @A_NORMAL
%11 = or i32 %9, %10
%12 = call i32 @attrset(i32 %11)
%13 = load i8*, i8** %2
%14 = call i32 @centered_string(i32 11, i8* %13)
%15 = load i32, i32* @A_NORMAL
%16 = call i32 @attrset(i32 %15)
%17 = call i32 (...) @wait_for_input()
ret i32 %17
}

LLVM IR (-O2):
@COLOR_WHITE = global i32 0
@A_NORMAL = global i32 0
define i32 @msgbox(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @draw_box(i32 %2)
%4 = load i32, i32* @COLOR_WHITE
%5 = tail call i32 @COLOR_PAIR(i32 %4)
%6 = load i32, i32* @A_NORMAL
%7 = or i32 %6, %5
%8 = tail call i32 @attrset(i32 %7)
%9 = tail call i32 @centered_string(i32 11, i8* %0)
%10 = load i32, i32* @A_NORMAL
%11 = tail call i32 @attrset(i32 %10)
%12 = tail call i32 (...) @wait_for_input()
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ provider1();
void requestor1() { provider1(); }


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

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

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

LLVM IR (-O2):
define void @requestor1() {
%1 = tail call i32 (...) @provider1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addrange(char, int);
void addranges_W(void) {
  addrange(0, '0' - 1);
  addrange('9' + 1, 'A' - 1);
  addrange('Z' + 1, '_' - 1);
  addrange('_' + 1, 'a' - 1);
  addrange('z' + 1, 0xFFFF);
}


x86 assembly (clang, -O0):
<addranges_W>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x2f,%esi
call   1030 <addrange@plt>
mov    $0x3a,%edi
mov    $0x40,%esi
call   1030 <addrange@plt>
mov    $0x5b,%edi
mov    $0x5e,%esi
call   1030 <addrange@plt>
mov    $0x60,%esi
mov    %esi,%edi
call   1030 <addrange@plt>
mov    $0x7b,%edi
mov    $0xffff,%esi
call   1030 <addrange@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<addranges_W>:
push   %rax
xor    %edi,%edi
mov    $0x2f,%esi
call   1030 <addrange@plt>
mov    $0x3a,%edi
mov    $0x40,%esi
call   1030 <addrange@plt>
mov    $0x5b,%edi
mov    $0x5e,%esi
call   1030 <addrange@plt>
mov    $0x60,%edi
mov    $0x60,%esi
call   1030 <addrange@plt>
mov    $0x7b,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1030 <addrange@plt>

LLVM IR (-O0):
define void @addranges_W() {
%1 = call i32 @addrange(i8 signext 0, i32 47)
%2 = call i32 @addrange(i8 signext 58, i32 64)
%3 = call i32 @addrange(i8 signext 91, i32 94)
%4 = call i32 @addrange(i8 signext 96, i32 96)
%5 = call i32 @addrange(i8 signext 123, i32 65535)
ret void
}

LLVM IR (-O2):
define void @addranges_W() {
%1 = tail call i32 @addrange(i8 signext 0, i32 47)
%2 = tail call i32 @addrange(i8 signext 58, i32 64)
%3 = tail call i32 @addrange(i8 signext 91, i32 94)
%4 = tail call i32 @addrange(i8 signext 96, i32 96)
%5 = tail call i32 @addrange(i8 signext 123, i32 65535)
ret void
}
unsigned xrop3_180_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_180_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_180_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
%42 = load i32, i32* %5
%43 = load i32, i32* %7
%44 = and i32 %42, %43
%45 = or i32 %41, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_180_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ delete_record(int, int, char *);
void QMDeleteu(int fno, char *id) { delete_record(19, fno, id); }


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

x86 assembly (clang, -O2):
<QMDeleteu>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x13,%edi
jmp    1030 <delete_record@plt>

LLVM IR (-O0):
define void @QMDeleteu(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @delete_record(i32 19, i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @QMDeleteu(i32 %0, i8* %1) {
%3 = tail call i32 @delete_record(i32 19, i32 %0, i8* %1)
ret void
}
int IsSet(int x, int n) { return x & (1 << n); }


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

x86 assembly (clang, -O2):
<IsSet>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @IsSet(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
ret i32 %4
}
void cleanup_module() {}


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

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

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

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

/* Variables and functions */
size_t int32_hash(int /*<<< orphan*/);
size_t pointer_hash(const void *data) { return int32_hash((int32_t)data); }


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

x86 assembly (clang, -O2):
<pointer_hash>:
jmp    1030 <int32_hash@plt>

LLVM IR (-O0):
define i64 @pointer_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i64 @int32_hash(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @pointer_hash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i64 @int32_hash(i32 %3)
ret i64 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t splitmix32(uint32_t *x) {
  uint32_t z = (*x += 0x9e3779b9);
  z = (z ^ (z >> 16)) * 0x85ebca6b;
  z = (z ^ (z >> 13)) * 0xc2b2ae35;
  return z ^ (z >> 16);
}


x86 assembly (clang, -O0):
<splitmix32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%eax
add    $0x9e3779b9,%eax
mov    %eax,(%rcx)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
imul   $0x85ebca6b,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    $0xd,%ecx
xor    %ecx,%eax
imul   $0xc2b2ae35,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<splitmix32>:
mov    $0x9e3779b9,%eax
add    (%rdi),%eax
mov    %eax,(%rdi)
mov    %eax,%ecx
sar    $0x10,%ecx
xor    %eax,%ecx
imul   $0x85ebca6b,%ecx,%eax
mov    %eax,%ecx
sar    $0xd,%ecx
xor    %eax,%ecx
imul   $0xc2b2ae35,%ecx,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @splitmix32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = add i32 %5, -1640531527
store i32 %6, i32* %4
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = ashr i32 %8, 16
%10 = xor i32 %7, %9
%11 = mul i32 %10, -2048144789
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = ashr i32 %13, 13
%15 = xor i32 %12, %14
%16 = mul i32 %15, -1028477387
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = load i32, i32* %3
%19 = ashr i32 %18, 16
%20 = xor i32 %17, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @splitmix32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, -1640531527
store i32 %3, i32* %0
%4 = ashr i32 %3, 16
%5 = xor i32 %4, %3
%6 = mul i32 %5, -2048144789
%7 = ashr i32 %6, 13
%8 = xor i32 %7, %6
%9 = mul i32 %8, -1028477387
%10 = ashr i32 %9, 16
%11 = xor i32 %10, %9
ret i32 %11
}
char *ixp_estrdup(const char *str) {
  void *ret = strdup(str);
  if (!ret)
    mfatal("strdup", strlen(str));
  return ret;
}


x86 assembly (clang, -O0):
<ixp_estrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <ixp_estrdup+0x3e>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rsi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <mfatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ixp_estrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115d <ixp_estrdup+0x2d>
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    0xead(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <mfatal@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"strdup\00"
define i8* @ixp_estrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i64 @strlen(i8* %9)
%11 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @mfatal to i32 (i8*, i64, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"strdup\00"
define i8* @ixp_estrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = tail call i32 (i8*, i64, ...) bitcast (i32 (...)* @mfatal to i32 (i8*, i64, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %5)
br label %7
7: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c, nl;
  nl = 0;
  while ((c = getchar()) != EOF)
    if (c == '\n')
      ++nl;
  printf("%d\n", nl);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     1167 <main+0x47>
cmpl   $0xa,-0x8(%rbp)
jne    1162 <main+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb4(%rip),%r14
cmp    (%r14),%eax
je     1156 <main+0x36>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i32 [ 0, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const, int const, char const *);
void braf_displayErrorInInterpreter(const char *msg, const int col,
                                    const int rw) {
  printf("braf: error at line %d, column %d: %s\n", rw, col, msg);
}


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

x86 assembly (clang, -O2):
<braf_displayErrorInInterpreter>:
mov    %esi,%eax
mov    %rdi,%rcx
lea    0xee4(%rip),%rdi
mov    %edx,%esi
mov    %eax,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"braf: error at line %d, column %d: %s\0A\00"
define void @braf_displayErrorInInterpreter(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"braf: error at line %d, column %d: %s\0A\00"
define void @braf_displayErrorInInterpreter(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %1, i8* %0)
ret void
}
void pktinitmkiss(struct modemchannel *chan, const char *params[]) { return; }


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

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

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

LLVM IR (-O2):
%struct.modemchannel = type opaque
define void @pktinitmkiss(%struct.modemchannel* nocapture %0, i8** nocapture %1) {
ret void
}
/* Variables and functions */
int func();
int otherFunc() { return func(); }


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

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

LLVM IR (-O0):
define i32 @otherFunc() {
%1 = call i32 (...) @func()
ret i32 %1
}

LLVM IR (-O2):
define i32 @otherFunc() {
%1 = tail call i32 (...) @func()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("/usr/bin/env");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"/usr/bin/env\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"/usr/bin/env\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int u8isasciiletteri(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointc(char *);
int u8isasciiletterc(char *c) { return u8isasciiletteri(u8tointc(c)); }


x86 assembly (clang, -O0):
<u8isasciiletterc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointc@plt>
mov    %eax,%edi
call   1040 <u8isasciiletteri@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isasciiletterc>:
push   %rax
call   1030 <u8tointc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8isasciiletteri@plt>

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

LLVM IR (-O2):
define i32 @u8isasciiletterc(i8* %0) {
%2 = tail call i32 @u8tointc(i8* %0)
%3 = tail call i32 @u8isasciiletteri(i32 %2)
ret i32 %3
}
unsigned int test_19(int x) { return ~(x >> 31) & 0x000000FF; }


x86 assembly (clang, -O0):
<test_19>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
xor    $0xffffffff,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_19>:
xor    %ecx,%ecx
test   %edi,%edi
mov    $0xff,%eax
cmovs  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_19(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 31
%5 = xor i32 %4, -1
%6 = and i32 %5, 255
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_19(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i32 0, i32 255
ret i32 %3
}
/* Variables and functions */
size_t fcitx_bitset_datasize(size_t bits) { return (bits + 7) / 8; }


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

x86 assembly (clang, -O2):
<fcitx_bitset_datasize>:
lea    0x7(%rdi),%rax
shr    $0x3,%rax
ret

LLVM IR (-O0):
define i64 @fcitx_bitset_datasize(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 7
%5 = udiv i64 %4, 8
ret i64 %5
}

LLVM IR (-O2):
define i64 @fcitx_bitset_datasize(i64 %0) {
%2 = add i64 %0, 7
%3 = lshr i64 %2, 3
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void default_heap_free_fn(void *memblock, size_t const size, void *context,
                          char const *file, int const line, char const *fn) {
  ((void)(context));
  ((void)(size));
  ((void)(file));
  ((void)(line));
  ((void)(fn));
  free(memblock);
}


x86 assembly (clang, -O0):
<default_heap_free_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @default_heap_free_fn(i8* %0, i64 %1, i8* %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
store i8* %0, i8** %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%13 = load i8*, i8** %9
%14 = load i64, i64* %8
%15 = load i8*, i8** %10
%16 = load i32, i32* %11
%17 = load i8*, i8** %12
%18 = load i8*, i8** %7
%19 = call i32 @free(i8* %18)
ret void
}

LLVM IR (-O2):
define void @default_heap_free_fn(i8* nocapture %0, i64 %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i32 %4, i8* nocapture readnone %5) {
%7 = tail call i32 @free(i8* %0)
ret void
}