xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  for (int i = 0; i < 5; i++) {
    puts("Hello, world!");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    1151 <main+0x41>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int dal_reg_write(unsigned int, unsigned int, unsigned int);
int emac1_reg_set(unsigned int dev_id, unsigned int reg_addr,
                  unsigned int value) {
  return dal_reg_write(dev_id, reg_addr + 0x8000, value);
}


x86 assembly (clang, -O0):
<emac1_reg_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x8000,%esi
mov    -0xc(%rbp),%edx
call   1030 <dal_reg_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emac1_reg_set>:
add    $0x8000,%esi
jmp    1030 <dal_reg_write@plt>

LLVM IR (-O0):
define i32 @emac1_reg_set(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 = add i32 %8, 32768
%10 = load i32, i32* %6
%11 = call i32 @dal_reg_write(i32 %7, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @emac1_reg_set(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %1, 32768
%5 = tail call i32 @dal_reg_write(i32 %0, i32 %4, i32 %2)
ret i32 %5
}
void UARTEnableTX(void) { *((char *)0xFFFFFFE2) = *((char *)0xFFFFFFE2) | 4; }


x86 assembly (clang, -O0):
<UARTEnableTX>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffe2,%eax
movsbl (%rax),%eax
or     $0x4,%eax
mov    %al,%cl
mov    $0xffffffe2,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTEnableTX>:
mov    $0xffffffe2,%eax
orb    $0x4,(%rax)
ret

LLVM IR (-O0):
define void @UARTEnableTX() {
%1 = load i8, i8* inttoptr (i64 4294967266 to i8*)
%2 = sext i8 %1 to i32
%3 = or i32 %2, 4
%4 = trunc i32 %3 to i8
store i8 %4, i8* inttoptr (i64 4294967266 to i8*)
ret void
}

LLVM IR (-O2):
define void @UARTEnableTX() {
%1 = load i8, i8* inttoptr (i64 4294967266 to i8*)
%2 = or i8 %1, 4
store i8 %2, i8* inttoptr (i64 4294967266 to i8*)
ret void
}
void func(int x) {
  switch (x) {
  case sizeof("abc"):
    break;
  case sizeof("loooong"):
    func(4);
  case sizeof("\ploooong"):
    func(4);
  }
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x4,%eax
je     1151 <func+0x41>
jmp    112f <func+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
je     1156 <func+0x46>
jmp    1140 <func+0x30>
mov    -0x8(%rbp),%eax
sub    $0x9,%eax
je     1160 <func+0x50>
jmp    116a <func+0x5a>
jmp    116a <func+0x5a>
mov    $0x4,%edi
call   1030 <func@plt>
mov    $0x4,%edi
call   1030 <func@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %7 [
i32 4, label %4
i32 8, label %5
i32 9, label %6
]
4: ; preds = %1
br label %7
5: ; preds = %1
br label %6
6: ; preds = %1, %5
br label %7
7: ; preds = %6, %1, %4
ret void
}

LLVM IR (-O2):
define void @func(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ declare_arrayNnomemset(int, int, int, int);
float **declare_float_nomemset(int first, int second) {
  return (float **)declare_arrayNnomemset(2, sizeof(float), first, second);
}


x86 assembly (clang, -O0):
<declare_float_nomemset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x2,%edi
mov    $0x4,%esi
call   1030 <declare_arrayNnomemset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<declare_float_nomemset>:
mov    %esi,%ecx
mov    %edi,%edx
mov    $0x2,%edi
mov    $0x4,%esi
jmp    1030 <declare_arrayNnomemset@plt>

LLVM IR (-O0):
define float** @declare_float_nomemset(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 = call i64 @declare_arrayNnomemset(i32 2, i32 4, i32 %5, i32 %6)
%8 = inttoptr i64 %7 to float**
ret float** %8
}

LLVM IR (-O2):
define float** @declare_float_nomemset(i32 %0, i32 %1) {
%3 = tail call i64 @declare_arrayNnomemset(i32 2, i32 4, i32 %0, i32 %1)
%4 = inttoptr i64 %3 to float**
ret float** %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int qualaHandleNull() {
  fprintf(stderr, "saved from a null dereference!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<qualaHandleNull>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<qualaHandleNull>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"saved from a null dereference!\0A\00"
define i32 @qualaHandleNull() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"saved from a null dereference!\0A\00"
define i32 @qualaHandleNull() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printn(int n) { printf("%06o\n", n); }


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

x86 assembly (clang, -O2):
<printn>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%06o\0A\00"
define void @printn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%06o\0A\00"
define void @printn(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct pf_config {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pf_emit_uint(struct pf_config *, unsigned long long, int);
void pf_emit_int(struct pf_config *c, long long n) {
  int neg = 0;
  if (n < 0) {
    neg = 1;
    n *= -1;
  }
  pf_emit_uint(c, (unsigned long long)n, neg);
}


x86 assembly (clang, -O0):
<pf_emit_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1142 <pf_emit_int+0x32>
movl   $0x1,-0x14(%rbp)
imul   $0xffffffffffffffff,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <pf_emit_uint@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pf_emit_int>:
mov    %rsi,%rdx
neg    %rsi
cmovs  %rdx,%rsi
shr    $0x3f,%rdx
jmp    1030 <pf_emit_uint@plt>

LLVM IR (-O0):
%struct.pf_config = type { i32 }
define void @pf_emit_int(%struct.pf_config* %0, i64 %1) {
%3 = alloca %struct.pf_config*
%4 = alloca i64
%5 = alloca i32
store %struct.pf_config* %0, %struct.pf_config** %3
store i64 %1, i64* %4
store i32 0, i32* %5
%6 = load i64, i64* %4
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
store i32 1, i32* %5
%9 = load i64, i64* %4
%10 = mul nsw i64 %9, -1
store i64 %10, i64* %4
br label %11
11: ; preds = %8, %2
%12 = load %struct.pf_config*, %struct.pf_config** %3
%13 = load i64, i64* %4
%14 = load i32, i32* %5
%15 = call i32 @pf_emit_uint(%struct.pf_config* %12, i64 %13, i32 %14)
ret void
}

LLVM IR (-O2):
%struct.pf_config = type { i32 }
define void @pf_emit_int(%struct.pf_config* %0, i64 %1) {
%3 = tail call i64 @llvm.abs.i64(i64 %1, i1 true)
%4 = lshr i64 %1, 63
%5 = trunc i64 %4 to i32
%6 = tail call i32 @pf_emit_uint(%struct.pf_config* %0, i64 %3, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x49() {
  Assert_real((isdigit(73) == 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",
              370, ("isdigit should be 0 for I"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x49>:
push   %rax
mov    $0x49,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x172,%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 I\00"
define void @t_isdigit_0x49() {
%1 = call i64 @isdigit(i32 73)
%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 370, 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 I\00"
define void @t_isdigit_0x49() {
%1 = tail call i64 @isdigit(i32 73)
%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 370, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _getline(char *, int);
int /*<<< orphan*/ detab(char *, int);
int main() {
  int length;
  int tabwidth;
  tabwidth = 4;
  char line[1000];
  while ((length = _getline(line, 1000)) > 0) {
    detab(line, tabwidth);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
lea    -0x400(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <_getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    116a <main+0x4a>
lea    -0x400(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <detab@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <_getline@plt>
test   %eax,%eax
jle    115e <main+0x3e>
mov    %rsp,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <detab@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <_getline@plt>
test   %eax,%eax
jg     1140 <main+0x20>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @_getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0, %5
%6 = call i32 @detab(i8* %2, i32 4)
%7 = call i32 @_getline(i8* %2, i32 1000)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
scalar_t__ log1p(double);
long double log1pl(long double x) { return (long double)log1p((double)x); }


x86 assembly (clang, -O0):
<log1pl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <log1p@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log1pl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <log1p@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @log1pl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @log1p(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @log1pl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @log1p(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Type definitions */
struct object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ push_root(struct object **);
void push_root_g(struct object **root) { push_root(root); }


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

x86 assembly (clang, -O2):
<push_root_g>:
jmp    1030 <push_root@plt>

LLVM IR (-O0):
%struct.object = type { i32 }
define void @push_root_g(%struct.object** %0) {
%2 = alloca %struct.object**
store %struct.object** %0, %struct.object*** %2
%3 = load %struct.object**, %struct.object*** %2
%4 = call i32 @push_root(%struct.object** %3)
ret void
}

LLVM IR (-O2):
%struct.object = type { i32 }
define void @push_root_g(%struct.object** %0) {
%2 = tail call i32 @push_root(%struct.object** %0)
ret void
}
unsigned int read_u32_be(unsigned char *src) {
  return (src[0] << 24) + (src[1] << 16) + (src[2] << 8) + (src[3] << 0);
}


x86 assembly (clang, -O0):
<read_u32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x0,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_u32_be>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @read_u32_be(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = add nsw i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = add nsw i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = shl i32 %23, 0
%25 = add nsw i32 %19, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @read_u32_be(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
void array_access_Ok(int x, int y) {
  int a[1];
  if (x + y == 1) {
    a[x + y - 1] = 0;
  }
}


x86 assembly (clang, -O0):
<array_access_Ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x1,%eax
jne    112c <array_access_Ok+0x2c>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
movl   $0x0,-0xc(%rbp,%rax,4)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @array_access_Ok(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_sub_overflow_p(int /*<<< orphan*/,
                                            int /*<<< orphan*/,
                                            int /*<<< orphan*/);
uint64_t __hsail_borrow_u64(uint64_t a, uint64_t b) {
  return __builtin_sub_overflow_p(a, b, a);
}


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

x86 assembly (clang, -O2):
<__hsail_borrow_u64>:
mov    %edi,%edx
jmp    1030 <__builtin_sub_overflow_p@plt>

LLVM IR (-O0):
define i32 @__hsail_borrow_u64(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 = load i32, i32* %3
%8 = call i32 @__builtin_sub_overflow_p(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @__hsail_borrow_u64(i32 %0, i32 %1) {
%3 = tail call i32 @__builtin_sub_overflow_p(i32 %0, i32 %1, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ log(double);
double lua_check_number(int, char *);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void math_log(void) {
  double d = lua_check_number(1, "log");
  lua_pushnumber(log(d));
}


x86 assembly (clang, -O0):
<math_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    0xebc(%rip),%rsi
call   1030 <lua_check_number@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1050 <log@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_log>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
call   1030 <lua_check_number@plt>
call   1050 <log@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"log\00"
define void @math_log() {
%1 = alloca double
%2 = call double @lua_check_number(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store double %2, double* %1
%3 = load double, double* %1
%4 = call i32 @log(double %3)
%5 = call i32 @lua_pushnumber(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"log\00"
define void @math_log() {
%1 = tail call double @lua_check_number(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @log(double %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
unsigned char read_byte(unsigned long addr) {
  return *(volatile unsigned char *)addr;
}


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

x86 assembly (clang, -O2):
<read_byte>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define zeroext i8 @read_byte(i64 %0) {
%2 = inttoptr i64 %0 to i8*
%3 = load volatile i8, i8* %2
ret i8 %3
}
void qp_echo(char *name, char *text) {}


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

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

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

LLVM IR (-O2):
define void @qp_echo(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void show_usage(const char *name) {
  fprintf(stderr, "Syntax: %s [-d duration] filename\n", name);
  fprintf(stderr, "\t-d duration of test (in seconds)\n");
  exit((2));
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<show_usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Syntax: %s [-d duration] filename\0A\00"
@.str.1 = [35 x i8] c"\09-d duration of test (in seconds)\0A\00"
define void @show_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Syntax: %s [-d duration] filename\0A\00"
@.str.1 = [35 x i8] c"\09-d duration of test (in seconds)\0A\00"
define void @show_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 2)
unreachable
}
void foo329(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo329(i32 %0) {
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int avltree_strcmpr(const char *s1, const char *s2) {
  return -(strcmp(s1, s2));
}


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

x86 assembly (clang, -O2):
<avltree_strcmpr>:
push   %rax
call   1030 <strcmp@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @avltree_strcmpr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @avltree_strcmpr(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
int test(void) { return (100); }


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

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

LLVM IR (-O0):
define i32 @test() {
ret i32 100
}

LLVM IR (-O2):
define i32 @test() {
ret i32 100
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
typedef scalar_t__ __uint64_t;

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
__uint64_t getCurrentPhysicalTime() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<getCurrentPhysicalTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrentPhysicalTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @getCurrentPhysicalTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @getCurrentPhysicalTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ String_Crop(char *);
char *strchr(char *, int);
int strlen(char *);
int strip(char *str) {
  char *c;
  c = strchr(str, 10);
  if (c)
    *c = 0;
  c = strchr(str, 13);
  if (c)
    *c = 0;
  String_Crop(str);
  return strlen(str);
}


x86 assembly (clang, -O0):
<strip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1160 <strip+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1184 <strip+0x54>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1050 <String_Crop@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1146 <strip+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0xd,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     115b <strip+0x2b>
movb   $0x0,(%rax)
mov    %rbx,%rdi
call   1050 <String_Crop@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @strip(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i32 10)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %2
%12 = call i8* @strchr(i8* %11, i32 13)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i8*, i8** %3
store i8 0, i8* %16
br label %17
17: ; preds = %15, %10
%18 = load i8*, i8** %2
%19 = call i32 @String_Crop(i8* %18)
%20 = load i8*, i8** %2
%21 = call i32 @strlen(i8* %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @strip(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
%6 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 13)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %5
store i8 0, i8* %6
br label %9
9: ; preds = %8, %5
%10 = tail call i32 @String_Crop(i8* %0)
%11 = tail call i32 @strlen(i8* %0)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ SIGSTOP;
int /*<<< orphan*/ _termios_reset();
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void _sighandler_stop(int sig) {
  _termios_reset();
  kill(getpid(), SIGSTOP);
}


x86 assembly (clang, -O0):
<_sighandler_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <_termios_reset@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sighandler_stop>:
push   %rax
xor    %eax,%eax
call   1050 <_termios_reset@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2e9a(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <kill@plt>

LLVM IR (-O0):
@SIGSTOP = global i32 0
define void @_sighandler_stop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @_termios_reset()
%4 = call i32 (...) @getpid()
%5 = load i32, i32* @SIGSTOP
%6 = call i32 @kill(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@SIGSTOP = global i32 0
define void @_sighandler_stop(i32 %0) {
%2 = tail call i32 (...) @_termios_reset()
%3 = tail call i32 (...) @getpid()
%4 = load i32, i32* @SIGSTOP
%5 = tail call i32 @kill(i32 %3, i32 %4)
ret void
}
void nop_pre_define(char *definition) { (void)definition; }


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

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

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

LLVM IR (-O2):
define void @nop_pre_define(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lirerr(int);
int strlen(char *);
void append_blanks_fcdgrmsg(char *msg) {
  int i;
  i = strlen(msg);
  if (i >= 30)
    lirerr(3413400);
  while (i < 30 - 1) {
    msg[i] = ' ';
    i++;
  }
  msg[30 - 1] = 0;
}


x86 assembly (clang, -O0):
<append_blanks_fcdgrmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1e,-0xc(%rbp)
jl     114c <append_blanks_fcdgrmsg+0x2c>
mov    $0x341598,%edi
call   1040 <lirerr@plt>
jmp    1151 <append_blanks_fcdgrmsg+0x31>
cmpl   $0x1d,-0xc(%rbp)
jge    1175 <append_blanks_fcdgrmsg+0x55>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <append_blanks_fcdgrmsg+0x31>
mov    -0x8(%rbp),%rax
movb   $0x0,0x1d(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_blanks_fcdgrmsg>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x1e,%eax
jl     114a <append_blanks_fcdgrmsg+0x1a>
mov    $0x341598,%edi
call   1050 <lirerr@plt>
jmp    116a <append_blanks_fcdgrmsg+0x3a>
cmp    $0x1d,%eax
je     116a <append_blanks_fcdgrmsg+0x3a>
movslq %eax,%rdi
add    %rbx,%rdi
mov    $0x1c,%edx
sub    %eax,%edx
add    $0x1,%rdx
mov    $0x20,%esi
call   1040 <memset@plt>
movb   $0x0,0x1d(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @append_blanks_fcdgrmsg(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 = icmp sge i32 %6, 30
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @lirerr(i32 3413400)
br label %10
10: ; preds = %8, %1
br label %11
11: ; preds = %14, %10
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 29
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
store i8 32, i8* %18
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %11
21: ; preds = %11
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 29
store i8 0, i8* %23
ret void
}

LLVM IR (-O2):
define void @append_blanks_fcdgrmsg(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 29
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lirerr(i32 3413400)
br label %14
6: ; preds = %1
%7 = icmp eq i32 %2, 29
br i1 %7, label %14, label %8
8: ; preds = %6
%9 = sext i32 %2 to i64
%10 = getelementptr i8, i8* %0, i64 %9
%11 = sub i32 28, %2
%12 = zext i32 %11 to i64
%13 = add nuw nsw i64 %12, 1
br label %14
14: ; preds = %4, %8, %6
%15 = getelementptr inbounds i8, i8* %0, i64 29
store i8 0, i8* %15
ret void
}
struct thread *arch_curr_thread(void) {
  struct thread *addr;
  __asm__("mov %%gs:8, %0" : "=r"(addr));
  return addr;
}


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

x86 assembly (clang, -O2):
<arch_curr_thread>:
mov    %gs:0x8,%rax
ret

LLVM IR (-O0):
%struct.thread = type opaque
define %struct.thread* @arch_curr_thread() {
%1 = alloca %struct.thread*
%2 = call %struct.thread* asm "mov %gs:8, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store %struct.thread* %2, %struct.thread** %1
%3 = load %struct.thread*, %struct.thread** %1
ret %struct.thread* %3
}

LLVM IR (-O2):
%struct.thread = type opaque
define %struct.thread* @arch_curr_thread() {
%1 = tail call %struct.thread* asm "mov %gs:8, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret %struct.thread* %1
}
/* Variables and functions */
int /*<<< orphan*/ SetNameFunction(char *);
int /*<<< orphan*/ Test1(char *, char *);
int /*<<< orphan*/ Test2();
void run_Tests(int all, char *arg, char *str, char *file) {
  SetNameFunction(arg);
  if (all) {
    Test1(str, file);
  }
  Test2();
}


x86 assembly (clang, -O0):
<run_Tests>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <SetNameFunction@plt>
cmpl   $0x0,-0x4(%rbp)
je     1167 <run_Tests+0x37>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <Test1@plt>
mov    $0x0,%al
call   1030 <Test2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_Tests>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <SetNameFunction@plt>
test   %ebp,%ebp
je     1153 <run_Tests+0x23>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <Test1@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <Test2@plt>

LLVM IR (-O0):
define void @run_Tests(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = call i32 @SetNameFunction(i8* %9)
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %4
%14 = load i8*, i8** %7
%15 = load i8*, i8** %8
%16 = call i32 @Test1(i8* %14, i8* %15)
br label %17
17: ; preds = %13, %4
%18 = call i32 (...) @Test2()
ret void
}

LLVM IR (-O2):
define void @run_Tests(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @SetNameFunction(i8* %1)
%6 = icmp eq i32 %0, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @Test1(i8* %2, i8* %3)
br label %9
9: ; preds = %7, %4
%10 = tail call i32 (...) @Test2()
ret void
}
void UARTParityModeSet(unsigned long ulBase, unsigned long ulParity) {
  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) =
      (((*((volatile unsigned long *)(ulBase + 0x0000002C))) &
        ~(0x00000080 | 0x00000004 | 0x00000002)) |
       ulParity);
}


x86 assembly (clang, -O0):
<UARTParityModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rcx
and    $0xffffffffffffff79,%rcx
or     -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x2c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTParityModeSet>:
mov    $0xffffffffffffff79,%rax
and    0x2c(%rdi),%rax
or     %rsi,%rax
mov    %rax,0x2c(%rdi)
ret

LLVM IR (-O0):
define void @UARTParityModeSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = add i64 %5, 44
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, -135
%10 = load i64, i64* %4
%11 = or i64 %9, %10
%12 = load i64, i64* %3
%13 = add i64 %12, 44
%14 = inttoptr i64 %13 to i64*
store volatile i64 %11, i64* %14
ret void
}

LLVM IR (-O2):
define void @UARTParityModeSet(i64 %0, i64 %1) {
%3 = add i64 %0, 44
%4 = inttoptr i64 %3 to i64*
%5 = load volatile i64, i64* %4
%6 = and i64 %5, -135
%7 = or i64 %6, %1
store volatile i64 %7, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  if (*(long *)"\200\0\0\0\0\0\0\0" < 0)
    printf("-DDATA_BIGENDIAN");
  else
    printf("-DDATA_LITTLEENDIAN");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpq   $0x0,0xed9(%rip)
jge    113e <main+0x2e>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
jmp    114a <main+0x3a>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"\80\00\00\00\00\00\00\00\00"
@.str.1 = [17 x i8] c"-DDATA_BIGENDIAN\00"
@.str.2 = [20 x i8] c"-DDATA_LITTLEENDIAN\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i64, i64* bitcast ([9 x i8]* @.str to i64*)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [20 x i8] c"-DDATA_LITTLEENDIAN\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
int nondetrange(int l, int u) { return l; }


x86 assembly (clang, -O0):
<nondetrange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @nondetrange(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @nondetrange(i32 returned %0, i32 %1) {
ret i32 %0
}
int niggli_get_minor_version(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @niggli_get_minor_version() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_FLASH_CLK_PIN() { set_io_bit(0x34, 3); }


x86 assembly (clang, -O0):
<TOSH_SET_FLASH_CLK_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
mov    $0x3,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_FLASH_CLK_PIN>:
mov    $0x34,%edi
mov    $0x3,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_FLASH_CLK_PIN() {
%1 = call i32 @set_io_bit(i32 52, i32 3)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_FLASH_CLK_PIN() {
%1 = tail call i32 @set_io_bit(i32 52, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DrawTextXYw137(char const *, unsigned long, unsigned long);
void drawtextxyw(const char *s, unsigned long x, unsigned long y) {
  DrawTextXYw137(s, x, y);
}


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

x86 assembly (clang, -O2):
<drawtextxyw>:
jmp    1030 <DrawTextXYw137@plt>

LLVM IR (-O0):
define void @drawtextxyw(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i32 @DrawTextXYw137(i8* %7, i64 %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @drawtextxyw(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @DrawTextXYw137(i8* %0, i64 %1, i64 %2)
ret void
}
/* Variables and functions */
int atoi(char *);
char *strchr(char *, char);
int level(char *str) {
  char *c;
  if (c = strchr(str, ':'))
    return atoi(++c);
  return 0;
}


x86 assembly (clang, -O0):
<level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1161 <level+0x41>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x18(%rbp)
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    1168 <level+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<level>:
push   %rax
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113d <level+0x1d>
add    $0x1,%rax
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @level(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 58)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = tail call i32 @atoi(i8* %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int sys_dup3(int, int, int /*<<< orphan*/);
int sys_dup2(int s, int d) { return sys_dup3(s, d, 0); }


x86 assembly (clang, -O0):
<sys_dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1030 <sys_dup3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_dup2>:
xor    %edx,%edx
jmp    1030 <sys_dup3@plt>

LLVM IR (-O0):
define i32 @sys_dup2(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 = call i32 @sys_dup3(i32 %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sys_dup2(i32 %0, i32 %1) {
%3 = tail call i32 @sys_dup3(i32 %0, i32 %1, i32 0)
ret i32 %3
}
int ar_cnt_get_triggered(int my_cid, int cnt) {}


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

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

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

LLVM IR (-O2):
define i32 @ar_cnt_get_triggered(i32 %0, i32 %1) {
ret i32 undef
}