xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fillup(int, int **, int);
int /*<<< orphan*/ printMatrix(int, int **);
int main() {
  int n = 8;
  int m[n][n];
  fillup(n, m, 1);
  printMatrix(n, m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,%rax
mov    %rsp,%rdx
mov    %rdx,-0x10(%rbp)
mov    %rcx,%rdx
imul   %rdx,%rdx
lea    0xf(,%rdx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rsi
sub    %rdx,%rsi
mov    %rsi,-0x28(%rbp)
mov    %rsi,%rsp
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%edx
call   1040 <fillup@plt>
mov    -0x28(%rbp),%rsi
mov    -0x8(%rbp),%edi
call   1030 <printMatrix@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
mov    %rsp,%rbx
mov    $0x8,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <fillup@plt>
mov    $0x8,%edi
mov    %rbx,%rsi
call   1030 <printMatrix@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i32 8, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %3
%11 = mul nuw i64 %7, %9
%12 = alloca i32, i64 %11
store i64 %7, i64* %4
store i64 %9, i64* %5
%13 = load i32, i32* %2
%14 = bitcast i32* %12 to i32**
%15 = call i32 @fillup(i32 %13, i32** %14, i32 1)
%16 = load i32, i32* %2
%17 = bitcast i32* %12 to i32**
%18 = call i32 @printMatrix(i32 %16, i32** %17)
store i32 0, i32* %1
%19 = load i8*, i8** %3
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [32 x i32*]
%2 = getelementptr inbounds [32 x i32*], [32 x i32*]* %1, i64 0, i64 0
%3 = call i32 @fillup(i32 8, i32** %2, i32 1)
%4 = call i32 @printMatrix(i32 8, i32** %2)
ret i32 0
}
unsigned int rotate6(unsigned int a) { return (a >> 6) | (a << (32 - 6)); }


x86 assembly (clang, -O0):
<rotate6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x6,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1a,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate6>:
mov    %edi,%eax
rol    $0x1a,%eax
ret

LLVM IR (-O0):
define i32 @rotate6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 6
%5 = load i32, i32* %2
%6 = shl i32 %5, 26
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rotate6(i32 %0) {
%2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 26)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *);
void illegal_rdwr() {
  int *array = malloc(5 * sizeof(int));
  array[5] = 5;
  if (array[5] == 5) {
    printf("hi\n");
  }
  free(array);
}


x86 assembly (clang, -O0):
<illegal_rdwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x5,0x14(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x5,0x14(%rax)
jne    116b <illegal_rdwr+0x3b>
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<illegal_rdwr>:
push   %rbx
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movl   $0x5,0x14(%rax)
lea    0xeb4(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"hi\0A\00"
define void @illegal_rdwr() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 20)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 5
store i32 5, i32* %4
%5 = load i32*, i32** %1
%6 = getelementptr inbounds i32, i32* %5, i64 5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 5
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
%12 = load i32*, i32** %1
%13 = call i32 @free(i32* %12)
ret void
}

LLVM IR (-O2):
@str = [3 x i8] c"hi\00"
define void @illegal_rdwr() {
%1 = tail call i32* @malloc(i32 20)
%2 = getelementptr inbounds i32, i32* %1, i64 5
store i32 5, i32* %2
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @free(i32* %1)
ret void
}
void power_info_eeprom_4k(struct edump *edump) {}


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

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

LLVM IR (-O0):
%struct.edump = type opaque
define void @power_info_eeprom_4k(%struct.edump* %0) {
%2 = alloca %struct.edump*
store %struct.edump* %0, %struct.edump** %2
ret void
}

LLVM IR (-O2):
%struct.edump = type opaque
define void @power_info_eeprom_4k(%struct.edump* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *new_string_from(char *src, int index, int count) {
  char *str;
  str = (char *)malloc(count + 1);
  memset(str, 0, count + 1);
  strncpy(str, src + index, count);
  return str;
}


x86 assembly (clang, -O0):
<new_string_from>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_string_from>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r12d
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r12),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1040 <memset@plt>
movslq %r15d,%rsi
add    %r14,%rsi
mov    %rbx,%rdi
mov    %r12d,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @new_string_from(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
%15 = call i32 @memset(i8* %12, i32 0, i32 %14)
%16 = load i8*, i8** %7
%17 = load i8*, i8** %4
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i32, i32* %6
%22 = call i32 @strncpy(i8* %16, i8* %20, i32 %21)
%23 = load i8*, i8** %7
ret i8* %23
}

LLVM IR (-O2):
define i8* @new_string_from(i8* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @memset(i8* %6, i32 0, i32 %4)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = tail call i32 @strncpy(i8* %6, i8* %9, i32 %2)
ret i8* %6
}
int conversor(char letra) {
  int l;
  switch (letra) {
  case 'A':
    l = 1;
    break;
  case 'B':
    l = 2;
    break;
  case 'C':
    l = 3;
    break;
  case 'D':
    l = 4;
    break;
  case 'E':
    l = 5;
    break;
  case 'F':
    l = 6;
    break;
  default:
    l = 0;
    break;
  }
  return (l);
}


x86 assembly (clang, -O0):
<conversor>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     117c <conversor+0x7c>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    1183 <conversor+0x83>
movl   $0x2,-0x8(%rbp)
jmp    1183 <conversor+0x83>
movl   $0x3,-0x8(%rbp)
jmp    1183 <conversor+0x83>
movl   $0x4,-0x8(%rbp)
jmp    1183 <conversor+0x83>
movl   $0x5,-0x8(%rbp)
jmp    1183 <conversor+0x83>
movl   $0x6,-0x8(%rbp)
jmp    1183 <conversor+0x83>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conversor>:
lea    -0x41(%rdi),%ecx
lea    -0x40(%rdi),%edx
xor    %eax,%eax
cmp    $0x6,%ecx
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @conversor(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %12 [
i32 65, label %6
i32 66, label %7
i32 67, label %8
i32 68, label %9
i32 69, label %10
i32 70, label %11
]
6: ; preds = %1
store i32 1, i32* %3
br label %13
7: ; preds = %1
store i32 2, i32* %3
br label %13
8: ; preds = %1
store i32 3, i32* %3
br label %13
9: ; preds = %1
store i32 4, i32* %3
br label %13
10: ; preds = %1
store i32 5, i32* %3
br label %13
11: ; preds = %1
store i32 6, i32* %3
br label %13
12: ; preds = %1
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @conversor(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -65
%4 = icmp ult i32 %3, 6
%5 = add nsw i32 %2, -64
%6 = select i1 %4, i32 %5, i32 0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x14() {
  Assert_real((isgraph(20) == 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_isgraph.c",
              105, ("isgraph should be 0 for 0x14"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0x14>:
push   %rax
mov    $0x14,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x69,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x14\00"
define void @t_isgraph_0x14() {
%1 = call i64 @isgraph(i32 20)
%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 105, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x14\00"
define void @t_isgraph_0x14() {
%1 = tail call i64 @isgraph(i32 20)
%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 105, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int baz(void) { return -42; }


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

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

LLVM IR (-O0):
define i32 @baz() {
ret i32 -42
}

LLVM IR (-O2):
define i32 @baz() {
ret i32 -42
}
int dns_v_abi(void) { return 0x20160608; }


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

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

LLVM IR (-O0):
define i32 @dns_v_abi() {
ret i32 538314248
}

LLVM IR (-O2):
define i32 @dns_v_abi() {
ret i32 538314248
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int main(void) {
  if (1) {
    exit(9);
  } else {
    exit(4);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x9,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x9,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @exit(i32 9)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 9)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EOPNOTSUPP;
int /*<<< orphan*/ errno;
int get_sndtimeo(int fd, void *optval, int *optlen) {
  errno = EOPNOTSUPP;
  return -1;
}


x86 assembly (clang, -O0):
<get_sndtimeo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sndtimeo>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EOPNOTSUPP = global i32 0
@errno = global i32 0
define i32 @get_sndtimeo(i32 %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i32, i32* @EOPNOTSUPP
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EOPNOTSUPP = global i32 0
@errno = global i32 0
define i32 @get_sndtimeo(i32 %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @EOPNOTSUPP
store i32 %4, i32* @errno
ret i32 -1
}
int test_imm_B0int16_mem(short *val) {
  return ((*val) & (0xB0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B0int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xb0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_B0int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 176
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int uiplib_ip4addrconv(char const *, int /*<<< orphan*/ *);
void ip4addrconv(const char *parameter, const char *addrstr, uint8_t *ipaddr) {
  int result = uiplib_ip4addrconv(addrstr, ipaddr);
  if (result == 0) {
    fprintf(stderr, "Error: %s: invalid argument\n", parameter);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<ip4addrconv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <uiplib_ip4addrconv@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1181 <ip4addrconv+0x51>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8e(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip4addrconv>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <uiplib_ip4addrconv@plt>
test   %eax,%eax
je     1145 <ip4addrconv+0x15>
pop    %rbx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"Error: %s: invalid argument\0A\00"
define void @ip4addrconv(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %5
%9 = load i32*, i32** %6
%10 = call i32 @uiplib_ip4addrconv(i8* %8, i32* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %4
%16 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"Error: %s: invalid argument\0A\00"
define void @ip4addrconv(i8* %0, i8* %1, i32* %2) {
%4 = tail call i32 @uiplib_ip4addrconv(i8* %1, i32* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
ret void
}
void compose_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @compose_reset() {
ret void
}
/* Type definitions */
struct timeb {
  int millitm;
  int time;
};

/* Variables and functions */
int /*<<< orphan*/ ftime(struct timeb *);
int BMK_GetMilliStart(void) {
  struct timeb tb;
  int nCount;
  ftime(&tb);
  nCount = tb.millitm + (tb.time & 0xfffff) * 1000;
  return nCount;
}


x86 assembly (clang, -O0):
<BMK_GetMilliStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <ftime@plt>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    $0xfffff,%ecx
imul   $0x3e8,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMK_GetMilliStart>:
push   %rax
mov    %rsp,%rdi
call   1030 <ftime@plt>
mov    $0xfffff,%eax
and    0x4(%rsp),%eax
imul   $0x3e8,%eax,%eax
add    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeb = type { i32, i32 }
define i32 @BMK_GetMilliStart() {
%1 = alloca %struct.timeb
%2 = alloca i32
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = and i32 %7, 1048575
%9 = mul nsw i32 %8, 1000
%10 = add nsw i32 %5, %9
store i32 %10, i32* %2
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.timeb = type { i32, i32 }
define i32 @BMK_GetMilliStart() {
%1 = alloca %struct.timeb
%2 = bitcast %struct.timeb* %1 to i8*
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = and i32 %7, 1048575
%9 = mul nuw nsw i32 %8, 1000
%10 = add nsw i32 %9, %5
ret i32 %10
}
long GetAbbotLen(short *data, int count) {
  long okcount = 0;
  long x = count;
  while (x--) {
    if (*data == -32768) {
      break;
    }
    ++data;
    ++okcount;
  }
  return okcount;
}


x86 assembly (clang, -O0):
<GetAbbotLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movslq -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     1168 <GetAbbotLen+0x68>
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cmp    $0xffff8000,%eax
jne    114b <GetAbbotLen+0x4b>
jmp    1168 <GetAbbotLen+0x68>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111b <GetAbbotLen+0x1b>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetAbbotLen>:
test   %esi,%esi
je     1129 <GetAbbotLen+0x29>
movslq %esi,%rcx
xor    %eax,%eax
nopl   0x0(%rax)
movzwl (%rdi,%rax,2),%edx
cmp    $0x8000,%edx
je     1128 <GetAbbotLen+0x28>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <GetAbbotLen+0x10>
mov    %rcx,%rax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @GetAbbotLen(i16* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = icmp eq i32 %1, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %12
%6 = phi i64 [ %9, %12 ], [ %3, %2 ]
%7 = phi i64 [ %14, %12 ], [ 0, %2 ]
%8 = phi i16* [ %13, %12 ], [ %0, %2 ]
%9 = add nsw i64 %6, -1
%10 = load i16, i16* %8
%11 = icmp eq i16 %10, -32768
br i1 %11, label %16, label %12
12: ; preds = %5
%13 = getelementptr inbounds i16, i16* %8, i64 1
%14 = add nuw nsw i64 %7, 1
%15 = icmp eq i64 %9, 0
br i1 %15, label %16, label %5
16: ; preds = %12, %5, %2
%17 = phi i64 [ 0, %2 ], [ %7, %5 ], [ %3, %12 ]
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int f1(int);
int f2(int);
int f3(int);
int f4(int);
int main() {
  if (f1(0xf0000000) != 0xffffffff00000000)
    abort();
  if (f2(0xf0000000) != 0xf00000000)
    abort();
  if (f3(0xf0000000) != 0xf00000000)
    abort();
  if (f4(0xf0000000) != 0xffffffff00000000)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf0000000,%edi
call   1060 <f1@plt>
cltq
movabs $0xffffffff00000000,%rcx
ff ff ff
cmp    %rcx,%rax
je     1185 <main+0x35>
mov    $0x0,%al
call   1040 <abort@plt>
mov    $0xf0000000,%edi
call   1030 <f2@plt>
cltq
movabs $0xf00000000,%rcx
cmp    %rcx,%rax
je     11ab <main+0x5b>
mov    $0x0,%al
call   1040 <abort@plt>
mov    $0xf0000000,%edi
call   1050 <f3@plt>
cltq
movabs $0xf00000000,%rcx
cmp    %rcx,%rax
je     11d1 <main+0x81>
mov    $0x0,%al
call   1040 <abort@plt>
mov    $0xf0000000,%edi
call   1070 <f4@plt>
cltq
movabs $0xffffffff00000000,%rcx
ff ff ff
cmp    %rcx,%rax
je     11f7 <main+0xa7>
mov    $0x0,%al
call   1040 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf0000000,%edi
call   1040 <f1@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f1(i32 -268435456)
%3 = sext i32 %2 to i64
%4 = icmp ne i64 %3, -4294967296
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = call i32 @f2(i32 -268435456)
%9 = sext i32 %8 to i64
%10 = icmp ne i64 %9, 64424509440
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %7
%14 = call i32 @f3(i32 -268435456)
%15 = sext i32 %14 to i64
%16 = icmp ne i64 %15, 64424509440
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %13
%20 = call i32 @f4(i32 -268435456)
%21 = sext i32 %20 to i64
%22 = icmp ne i64 %21, -4294967296
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = call i32 (...) @abort()
unreachable
25: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 -268435456)
%2 = tail call i32 (...) @abort()
unreachable
}
void MemFaultISR(void) {
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<MemFaultISR>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <MemFaultISR+0x9>
jmp    1109 <MemFaultISR+0x9>

x86 assembly (clang, -O2):
<MemFaultISR>:
jmp    1100 <MemFaultISR>

LLVM IR (-O0):
define void @MemFaultISR() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @MemFaultISR() {
br label %1
1: ; preds = %1, %0
br label %1
}
double D(const double m, const double j1, const double j2, const double j3,
         const double m1) {
  return j2 * (j2 + 1.0) + j3 * (j3 + 1.0) - j1 * (j1 + 1.0) -
         2.0 * m * (m + m1);
}


x86 assembly (clang, -O0):
<D>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xede(%rip),%xmm2
addsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm1
movsd  0xecc(%rip),%xmm3
addsd  -0x20(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xeae(%rip),%xmm2
addsd  -0x10(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe7a(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
addsd  -0x28(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<D>:
movsd  0xef8(%rip),%xmm5
movapd %xmm2,%xmm6
addsd  %xmm5,%xmm6
movapd %xmm3,%xmm7
addsd  %xmm5,%xmm7
mulsd  %xmm3,%xmm7
mulsd  %xmm2,%xmm6
addsd  %xmm7,%xmm6
addsd  %xmm1,%xmm5
mulsd  %xmm1,%xmm5
subsd  %xmm5,%xmm6
addsd  %xmm0,%xmm4
mulsd  0xecc(%rip),%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm6,%xmm0
ret

LLVM IR (-O0):
define double @D(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %8
%12 = load double, double* %8
%13 = fadd double %12, 1.000000e+00
%14 = load double, double* %9
%15 = load double, double* %9
%16 = fadd double %15, 1.000000e+00
%17 = fmul double %14, %16
%18 = call double @llvm.fmuladd.f64(double %11, double %13, double %17)
%19 = load double, double* %7
%20 = load double, double* %7
%21 = fadd double %20, 1.000000e+00
%22 = fneg double %19
%23 = call double @llvm.fmuladd.f64(double %22, double %21, double %18)
%24 = load double, double* %6
%25 = fmul double 2.000000e+00, %24
%26 = load double, double* %6
%27 = load double, double* %10
%28 = fadd double %26, %27
%29 = fneg double %25
%30 = call double @llvm.fmuladd.f64(double %29, double %28, double %23)
ret double %30
}

LLVM IR (-O2):
define double @D(double %0, double %1, double %2, double %3, double %4) {
%6 = fadd double %2, 1.000000e+00
%7 = fadd double %3, 1.000000e+00
%8 = fmul double %7, %3
%9 = tail call double @llvm.fmuladd.f64(double %2, double %6, double %8)
%10 = fadd double %1, 1.000000e+00
%11 = fneg double %1
%12 = tail call double @llvm.fmuladd.f64(double %11, double %10, double %9)
%13 = fadd double %0, %4
%14 = fmul double %0, -2.000000e+00
%15 = tail call double @llvm.fmuladd.f64(double %14, double %13, double %12)
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Here's one way to print a ");
  printf("long string.\n");
  printf("Here's another way to print a long string.\n");
  printf("Here's the newest way to print a "
         "long string.\n");
  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 <printf@plt>
lea    0xf07(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"Here's one way to print a \00"
@.str.1 = [14 x i8] c"long string.\0A\00"
@.str.2 = [44 x i8] c"Here's another way to print a long string.\0A\00"
@.str.3 = [47 x i8] c"Here's the newest way to print a long string.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Here's one way to print a \00"
@str = [13 x i8] c"long string.\00"
@str.4 = [43 x i8] c"Here's another way to print a long string.\00"
@str.5 = [46 x i8] c"Here's the newest way to print a long string.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
void av_small_strptime() {}


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

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

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

LLVM IR (-O2):
define void @av_small_strptime() {
ret void
}
/* Variables and functions */
scalar_t__ gethrtime();
double elg_pform_wtime() { return (double)gethrtime() * 1.0e-9; }


x86 assembly (clang, -O0):
<elg_pform_wtime>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gethrtime@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<elg_pform_wtime>:
push   %rax
xor    %eax,%eax
call   1030 <gethrtime@plt>
cvtsi2sd %rax,%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @elg_pform_wtime() {
%1 = call i64 (...) @gethrtime()
%2 = sitofp i64 %1 to double
%3 = fmul double %2, 1.000000e-09
ret double %3
}

LLVM IR (-O2):
define double @elg_pform_wtime() {
%1 = tail call i64 (...) @gethrtime()
%2 = sitofp i64 %1 to double
%3 = fmul double %2, 1.000000e-09
ret double %3
}
/* Variables and functions */
scalar_t__ strlen(char *);
char toupper(char);
void upstring(char *str) {
  int i;
  for (i = 0; (i < (int)strlen(str)); i++)
    str[i] = toupper(str[i]);
}


x86 assembly (clang, -O0):
<upstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117c <upstring+0x5c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <upstring+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upstring>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1161 <upstring+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <upstring+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @upstring(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %15
5: ; preds = %1, %5
%6 = phi i64 [ %10, %5 ], [ 0, %1 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call signext i8 @toupper(i8 signext %8)
store i8 %9, i8* %7
%10 = add nuw nsw i64 %6, 1
%11 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%12 = shl i64 %11, 32
%13 = ashr exact i64 %12, 32
%14 = icmp slt i64 %10, %13
br i1 %14, label %5, label %15
15: ; preds = %5, %1
ret void
}
/* Variables and functions */
scalar_t__ isprint(char const);
int /*<<< orphan*/ printf(char *, char const, ...);
void printKeyPress(const char c) {
  if (isprint(c)) {
    printf("%d ('%c')\r\n", c, c);
  } else {
    printf("%d\r\n", c);
  }
}


x86 assembly (clang, -O0):
<printKeyPress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isprint@plt>
cmp    $0x0,%rax
je     115e <printKeyPress+0x3e>
mov    -0x1(%rbp),%al
movsbl -0x1(%rbp),%edx
lea    0xeb1(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1170 <printKeyPress+0x50>
lea    0xea7(%rip),%rdi
movsbl -0x1(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printKeyPress>:
push   %rbx
mov    %edi,%ebx
call   1040 <isprint@plt>
test   %rax,%rax
je     1141 <printKeyPress+0x21>
movsbl %bl,%edx
lea    0xec9(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>
movsbl %bl,%esi
lea    0xec1(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%d ('%c')\0D\0A\00"
@.str.1 = [5 x i8] c"%d\0D\0A\00"
define void @printKeyPress(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isprint(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext %7, i32 %9)
br label %14
11: ; preds = %1
%12 = load i8, i8* %2
%13 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8 signext %12)
br label %14
14: ; preds = %11, %6
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d ('%c')\0D\0A\00"
@.str.1 = [5 x i8] c"%d\0D\0A\00"
define void @printKeyPress(i8 signext %0) {
%2 = tail call i64 @isprint(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = sext i8 %0 to i32
%6 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext %0, i32 %5)
br label %9
7: ; preds = %1
%8 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8 signext %0)
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
bool paris(char left, char right) {
  return (left == '(' && right == ')') || (left == '[' && right == ']') ||
         (left == '{' && right == '}');
}


x86 assembly (clang, -O0):
<paris>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x28,%eax
jne    112f <paris+0x2f>
movsbl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x29,%ecx
mov    %al,-0x3(%rbp)
je     1173 <paris+0x73>
movsbl -0x1(%rbp),%eax
cmp    $0x5b,%eax
jne    114e <paris+0x4e>
movsbl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5d,%ecx
mov    %al,-0x3(%rbp)
je     1173 <paris+0x73>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x7b,%ecx
mov    %al,-0x4(%rbp)
jne    116d <paris+0x6d>
movsbl -0x2(%rbp),%eax
cmp    $0x7d,%eax
sete   %al
mov    %al,-0x4(%rbp)
mov    -0x4(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<paris>:
mov    $0x1,%eax
cmp    $0x28,%dil
jne    1112 <paris+0x12>
cmp    $0x29,%sil
jne    1112 <paris+0x12>
ret
cmp    $0x5b,%dil
jne    111e <paris+0x1e>
cmp    $0x5d,%sil
je     1111 <paris+0x11>
xor    $0x7b,%dil
xor    $0x7d,%sil
xor    %eax,%eax
or     %dil,%sil
sete   %al
ret

LLVM IR (-O0):
define i32 @paris(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 40
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 41
br i1 %11, label %30, label %12
12: ; preds = %8, %2
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 91
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 93
br i1 %19, label %30, label %20
20: ; preds = %16, %12
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 123
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load i8, i8* %4
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 125
br label %28
28: ; preds = %24, %20
%29 = phi i1 [ false, %20 ], [ %27, %24 ]
br label %30
30: ; preds = %28, %16, %8
%31 = phi i1 [ true, %16 ], [ true, %8 ], [ %29, %28 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @paris(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 40
%4 = icmp eq i8 %1, 41
%5 = and i1 %3, %4
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = icmp eq i8 %0, 91
%8 = icmp eq i8 %1, 93
%9 = and i1 %7, %8
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = icmp eq i8 %0, 123
%12 = icmp eq i8 %1, 125
%13 = and i1 %11, %12
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %6, %2, %10
%16 = phi i32 [ %14, %10 ], [ 1, %2 ], [ 1, %6 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage:\n");
  printf("  preprocess -f <matrix_file> [-c] [-h]\n");
  printf("  -c  generate Compressed Row Storage matrix file (default)\n");
  printf("  -h  generate Hilbert space-filling curve ordered matrix file\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2f(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [41 x i8] c" preprocess -f <matrix_file> [-c] [-h]\0A\00"
@.str.2 = [61 x i8] c" -c generate Compressed Row Storage matrix file (default)\0A\00"
@.str.3 = [64 x i8] c" -h generate Hilbert space-filling curve ordered matrix file\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.4 = [40 x i8] c" preprocess -f <matrix_file> [-c] [-h]\00"
@str.5 = [60 x i8] c" -c generate Compressed Row Storage matrix file (default)\00"
@str.6 = [63 x i8] c" -h generate Hilbert space-filling curve ordered matrix file\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ disp_str(char *);
int /*<<< orphan*/ milli_delay(int);
void TestC() {
  int i = 0x2000;
  while (1) {
    disp_str("C.");
    milli_delay(200);
  }
}


x86 assembly (clang, -O0):
<TestC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2000,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <disp_str@plt>
mov    $0xc8,%edi
call   1040 <milli_delay@plt>
jmp    112f <TestC+0xf>

x86 assembly (clang, -O2):
<TestC>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <disp_str@plt>
mov    $0xc8,%edi
call   1040 <milli_delay@plt>
jmp    1130 <TestC+0x10>

LLVM IR (-O0):
@.str = [3 x i8] c"C.\00"
define void @TestC() {
%1 = alloca i32
store i32 8192, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @disp_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @milli_delay(i32 200)
br label %2
}

LLVM IR (-O2):
@.str = [3 x i8] c"C.\00"
define void @TestC() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @disp_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @milli_delay(i32 200)
br label %1
}
/* Variables and functions */
void *memmove(void *, void const *, size_t);
void *memcpy(void *dest, const void *src, size_t n) {
  return memmove(dest, src, n);
}


x86 assembly (clang, -O0):
<memcpy>:
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    %rdi,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memmove@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define i8* @memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_GENERALIZEDTIME;

/* Variables and functions */
int /*<<< orphan*/ ASN1_GENERALIZEDTIME_it;
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &ASN1_GENERALIZEDTIME_it);
}


x86 assembly (clang, -O0):
<i2d_ASN1_GENERALIZEDTIME>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ea9(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_ASN1_GENERALIZEDTIME>:
mov    0x2ec1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@ASN1_GENERALIZEDTIME_it = global i32 0
define i32 @i2d_ASN1_GENERALIZEDTIME(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 @ASN1_item_i2d(i32* %5, i8** %6, i32* @ASN1_GENERALIZEDTIME_it)
ret i32 %7
}

LLVM IR (-O2):
@ASN1_GENERALIZEDTIME_it = global i32 0
define i32 @i2d_ASN1_GENERALIZEDTIME(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @ASN1_GENERALIZEDTIME_it)
ret i32 %3
}
/* Variables and functions */
int power(int *, int *);
int square(int *a) {
  int i = 2;
  return power(a, &i);
}


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <power@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
push   %rax
movl   $0x2,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <power@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @square(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%4 = call i32 @power(i32* %0, i32* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ OnEx(unsigned char, unsigned char);
int /*<<< orphan*/ Rev(unsigned char);
int /*<<< orphan*/ SetSpeed(unsigned char, char);
void OnRevRegEx(unsigned char Outputs, char Speed, unsigned char RegMode,
                unsigned char reset) {
  Rev(Outputs);
  SetSpeed(Outputs, Speed);
  OnEx(Outputs, reset);
}


x86 assembly (clang, -O0):
<OnRevRegEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <Rev@plt>
mov    -0x1(%rbp),%al
movzbl %al,%edi
movsbl -0x2(%rbp),%esi
call   1050 <SetSpeed@plt>
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x4(%rbp),%esi
call   1040 <OnEx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OnRevRegEx>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <Rev@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   1050 <SetSpeed@plt>
mov    %ebx,%edi
mov    %r14d,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <OnEx@plt>

LLVM IR (-O0):
define void @OnRevRegEx(i8 zeroext %0, i8 signext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %5
%10 = call i32 @Rev(i8 zeroext %9)
%11 = load i8, i8* %5
%12 = load i8, i8* %6
%13 = call i32 @SetSpeed(i8 zeroext %11, i8 signext %12)
%14 = load i8, i8* %5
%15 = load i8, i8* %8
%16 = call i32 @OnEx(i8 zeroext %14, i8 zeroext %15)
ret void
}

LLVM IR (-O2):
define void @OnRevRegEx(i8 zeroext %0, i8 signext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = tail call i32 @Rev(i8 zeroext %0)
%6 = tail call i32 @SetSpeed(i8 zeroext %0, i8 signext %1)
%7 = tail call i32 @OnEx(i8 zeroext %0, i8 zeroext %3)
ret void
}