xunge/DecIR huggingface dataset:
/* Variables and functions */
char *corta_string(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *s = "Campos verdes";
  while (*(s = corta_string(s)) != ' ')
    ;
  {
    s = corta_string(s - 1);
    printf("%s\n", s);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <corta_string@plt>
mov    %rax,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1158 <main+0x38>
jmp    113a <main+0x1a>
mov    -0x10(%rbp),%rdi
add    $0xffffffffffffffff,%rdi
call   1040 <corta_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe9a(%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),%rax
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1040 <corta_string@plt>
cmpb   $0x20,(%rax)
jne    1130 <main+0x10>
add    $0xffffffffffffffff,%rax
mov    %rax,%rdi
call   1040 <corta_string@plt>
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Campos verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %0 ], [ %3, %1 ]
%3 = tail call i8* @corta_string(i8* %2)
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %3, i64 -1
%8 = tail call i8* @corta_string(i8* %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}
int get_mingzhongup(int level) {
  if (level >= 23)
    return 39;
  else if (level >= 13)
    return 16 + level * 1;
  else if (level >= 1)
    return 3 + level * 2;
  return 0;
}


x86 assembly (clang, -O0):
<get_mingzhongup>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x17,-0x8(%rbp)
jl     111d <get_mingzhongup+0x1d>
movl   $0x27,-0x4(%rbp)
jmp    1164 <get_mingzhongup+0x64>
cmpl   $0xd,-0x8(%rbp)
jl     1138 <get_mingzhongup+0x38>
mov    -0x8(%rbp),%eax
shl    $0x0,%eax
add    $0x10,%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <get_mingzhongup+0x64>
cmpl   $0x1,-0x8(%rbp)
jl     1153 <get_mingzhongup+0x53>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <get_mingzhongup+0x64>
jmp    1158 <get_mingzhongup+0x58>
jmp    115d <get_mingzhongup+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mingzhongup>:
mov    $0x27,%eax
cmp    $0x16,%edi
jg     111f <get_mingzhongup+0x1f>
cmp    $0xd,%edi
jl     1115 <get_mingzhongup+0x15>
add    $0x10,%edi
mov    %edi,%eax
ret
test   %edi,%edi
jle    1120 <get_mingzhongup+0x20>
lea    (%rdi,%rdi,1),%eax
add    $0x3,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @get_mingzhongup(i32 %0) {
%2 = icmp sgt i32 %0, 22
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 12
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = add nuw nsw i32 %0, 16
br label %12
7: ; preds = %3
%8 = icmp sgt i32 %0, 0
br i1 %8, label %9, label %12
9: ; preds = %7
%10 = shl nuw nsw i32 %0, 1
%11 = add nuw nsw i32 %10, 3
br label %12
12: ; preds = %7, %1, %9, %5
%13 = phi i32 [ %6, %5 ], [ %11, %9 ], [ 39, %1 ], [ 0, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ pr_mask(char *);
void sig_alrm(int signo) { pr_mask("in sig_alrm: "); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"in sig_alrm: \00"
define void @sig_alrm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pr_mask(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"in sig_alrm: \00"
define void @sig_alrm(i32 %0) {
%2 = tail call i32 @pr_mask(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int I2CSlaveIntStatus(unsigned int baseAdd) {
  return (((*((volatile unsigned int *)(baseAdd + (0x28))))));
}


x86 assembly (clang, -O0):
<I2CSlaveIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x28,%eax
mov    %eax,%eax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntStatus>:
add    $0x28,%edi
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @I2CSlaveIntStatus(i32 %0) {
%2 = add i32 %0, 40
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}
long int_make_l(long v) {
  return ((2UL << 28UL) | ((unsigned long)v & 0x0fffffffUL));
}


x86 assembly (clang, -O0):
<int_make_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffffff,%rax
or     $0x20000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_make_l>:
and    $0xfffffff,%edi
lea    0x20000000(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @int_make_l(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 268435455
%5 = or i64 536870912, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @int_make_l(i64 %0) {
%2 = and i64 %0, 268435455
%3 = or i64 %2, 536870912
ret i64 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int printUsage(char *execName) {
  printf("VGM (AY) converter"
         "Usage: %s file.vgm\n",
         execName);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"VGM (AY) converterUsage: %s file.vgm\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@.str = [38 x i8] c"VGM (AY) converterUsage: %s file.vgm\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(int argc, char *argv[]) {
  char character = 'a';
  character = 'k';
  printf("character: %c", character);
  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)
movb   $0x61,-0x11(%rbp)
movb   $0x6b,-0x11(%rbp)
lea    0xecb(%rip),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"character: %c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 97, i8* %6
store i8 107, i8* %6
%7 = load i8, i8* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"character: %c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8 signext 107)
ret i32 0
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ erase();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_erase(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(erase());
}


x86 assembly (clang, -O0):
<cmd_erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_erase+0x27>
jmp    117f <cmd_erase+0x3f>
mov    $0x1,%edi
call   1060 <report_count@plt>
mov    $0x0,%al
call   1040 <erase@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_erase>:
push   %rax
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_erase+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1060 <report_count@plt>
xor    %eax,%eax
call   1040 <erase@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_erase(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 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @erase()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_erase(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @erase()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
void dependsOnValueOfPtr(int *g, unsigned f) {
  int *p;
  if (f) {
    p = g;
  } else {
    p = malloc(12);
  }
  if (p != g)
    free(p);
  else
    return;
  return;
}


x86 assembly (clang, -O0):
<dependsOnValueOfPtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1146 <dependsOnValueOfPtr+0x26>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1154 <dependsOnValueOfPtr+0x34>
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     1170 <dependsOnValueOfPtr+0x50>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    1175 <dependsOnValueOfPtr+0x55>
jmp    117a <dependsOnValueOfPtr+0x5a>
jmp    117a <dependsOnValueOfPtr+0x5a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dependsOnValueOfPtr>:
test   %esi,%esi
je     1125 <dependsOnValueOfPtr+0x5>
ret
push   %rbx
mov    %rdi,%rbx
mov    $0xc,%edi
call   1040 <malloc@plt>
cmp    %rbx,%rax
pop    %rbx
je     1124 <dependsOnValueOfPtr+0x4>
mov    %rax,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @dependsOnValueOfPtr(i32* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = tail call i32* @malloc(i32 12)
%6 = icmp eq i32* %5, %0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @free(i32* %5)
br label %9
9: ; preds = %2, %4, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ refresh();
void init_screen() {
  initscr();
  noecho();
  cbreak();
  refresh();
}


x86 assembly (clang, -O0):
<init_screen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <initscr@plt>
mov    $0x0,%al
call   1060 <noecho@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_screen>:
push   %rax
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1060 <noecho@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <refresh@plt>

LLVM IR (-O0):
define void @init_screen() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @noecho()
%3 = call i32 (...) @cbreak()
%4 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
define void @init_screen() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @noecho()
%3 = tail call i32 (...) @cbreak()
%4 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void usage() {
  fatal(
      "usage: build_index [-filelist <str> (REQUIRED)]\n\t[-indexfile <str> "
      "(REQUIRED)]\n\t[-P <n> (defaults to 4)]\n\t[-S <n> (defaults to 32)]\n");
}


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

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

LLVM IR (-O0):
@.str = [133 x i8] c"usage: build_index [-filelist <str> (REQUIRED)]\0A\09[-indexfile <str> (REQUIRED)]\0A\09[-P <n> (defaults to 4)]\0A\09[-S <n> (defaults to 32)]\0A\00"
define void @usage() {
%1 = call i32 @fatal(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [133 x i8] c"usage: build_index [-filelist <str> (REQUIRED)]\0A\09[-indexfile <str> (REQUIRED)]\0A\09[-P <n> (defaults to 4)]\0A\09[-S <n> (defaults to 32)]\0A\00"
define void @usage() {
%1 = tail call i32 @fatal(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int isalpha(int);
int ISALPHA(int ch) { return isalpha(ch); }


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

x86 assembly (clang, -O2):
<ISALPHA>:
jmp    1030 <isalpha@plt>

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

LLVM IR (-O2):
define i32 @ISALPHA(i32 %0) {
%2 = tail call i32 @isalpha(i32 %0)
ret i32 %2
}
int fbcon_fb_registered(struct fb_info *info) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.fb_info = type opaque
define i32 @fbcon_fb_registered(%struct.fb_info* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ print_ophead(int, char const *, int);
int /*<<< orphan*/ printf(char *, int, int);
void print_vx_vy(uint16_t op, const char *name, int index) {
  print_ophead(op, name, index);
  printf("V%X, V%X\n", (op & 0x0F00) >> 8, (op & 0x00F0) >> 4);
}


x86 assembly (clang, -O0):
<print_vx_vy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <print_ophead@plt>
mov    -0x4(%rbp),%esi
and    $0xf00,%esi
sar    $0x8,%esi
mov    -0x4(%rbp),%edx
and    $0xf0,%edx
sar    $0x4,%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_vx_vy>:
push   %rbx
mov    %edi,%ebx
call   1040 <print_ophead@plt>
mov    %ebx,%esi
shr    $0x8,%esi
and    $0xf,%esi
shr    $0x4,%ebx
and    $0xf,%ebx
lea    0xec3(%rip),%rdi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"V%X, V%X\0A\00"
define void @print_vx_vy(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* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @print_ophead(i32 %7, i8* %8, i32 %9)
%11 = load i32, i32* %4
%12 = and i32 %11, 3840
%13 = ashr i32 %12, 8
%14 = load i32, i32* %4
%15 = and i32 %14, 240
%16 = ashr i32 %15, 4
%17 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"V%X, V%X\0A\00"
define void @print_vx_vy(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @print_ophead(i32 %0, i8* %1, i32 %2)
%5 = lshr i32 %0, 8
%6 = and i32 %5, 15
%7 = lshr i32 %0, 4
%8 = and i32 %7, 15
%9 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcheck_current();
size_t mock_retire(int /*<<< orphan*/);
size_t memcheck_retire_mocks() { return mock_retire(memcheck_current()); }


x86 assembly (clang, -O0):
<memcheck_retire_mocks>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <memcheck_current@plt>
mov    %eax,%edi
call   1030 <mock_retire@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcheck_retire_mocks>:
push   %rax
xor    %eax,%eax
call   1040 <memcheck_current@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <mock_retire@plt>

LLVM IR (-O0):
define i64 @memcheck_retire_mocks() {
%1 = call i32 (...) @memcheck_current()
%2 = call i64 @mock_retire(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
define i64 @memcheck_retire_mocks() {
%1 = tail call i32 (...) @memcheck_current()
%2 = tail call i64 @mock_retire(i32 %1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
int qemu_stop_tracing() {
  int fd = open("/sys/qemu_trace/state", O_WRONLY);
  if (fd < 0)
    return fd;
  write(fd, "0\n", 2);
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<qemu_stop_tracing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1165 <qemu_stop_tracing+0x35>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1188 <qemu_stop_tracing+0x58>
mov    -0x8(%rbp),%edi
lea    0xea7(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qemu_stop_tracing>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1168 <qemu_stop_tracing+0x38>
lea    0xec3(%rip),%rsi
mov    %ebx,%edi
mov    $0x2,%edx
call   1030 <write@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"/sys/qemu_trace/state\00"
@O_WRONLY = global i32 0
@.str.1 = [3 x i8] c"0\0A\00"
define i32 @qemu_stop_tracing() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @O_WRONLY
%4 = call i32 @open(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i32, i32* %2
store i32 %8, i32* %1
br label %14
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @write(i32 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%12 = load i32, i32* %2
%13 = call i32 @close(i32 %12)
store i32 0, i32* %1
br label %14
14: ; preds = %9, %7
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [22 x i8] c"/sys/qemu_trace/state\00"
@O_WRONLY = global i32 0
@.str.1 = [3 x i8] c"0\0A\00"
define i32 @qemu_stop_tracing() {
%1 = load i32, i32* @O_WRONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp slt i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @write(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%6 = tail call i32 @close(i32 %2)
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ 0, %4 ], [ %2, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void strfreekey(void *key) { free(key); }


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

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

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

LLVM IR (-O2):
define void @strfreekey(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
unsigned int UARTOperatingModeSelect(unsigned int baseAdd,
                                     unsigned int modeFlag) {
  unsigned int operMode = 0;
  operMode = ((*((volatile unsigned int *)(baseAdd + (0x20)))) & (0x00000007u));
  (*((volatile unsigned int *)(baseAdd + (0x20)))) &= ~((0x00000007u));
  (*((volatile unsigned int *)(baseAdd + (0x20)))) |=
      (modeFlag & (0x00000007u));
  return operMode;
}


x86 assembly (clang, -O0):
<UARTOperatingModeSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x7,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffff8,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x7,%edx
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTOperatingModeSelect>:
add    $0x20,%edi
mov    (%rdi),%eax
and    $0x7,%eax
andl   $0xfffffff8,(%rdi)
and    $0x7,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define i32 @UARTOperatingModeSelect(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %3
%7 = add i32 %6, 32
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, 7
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = add i32 %12, 32
%14 = zext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
%17 = and i32 %16, -8
store volatile i32 %17, i32* %15
%18 = load i32, i32* %4
%19 = and i32 %18, 7
%20 = load i32, i32* %3
%21 = add i32 %20, 32
%22 = zext i32 %21 to i64
%23 = inttoptr i64 %22 to i32*
%24 = load volatile i32, i32* %23
%25 = or i32 %24, %19
store volatile i32 %25, i32* %23
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @UARTOperatingModeSelect(i32 %0, i32 %1) {
%3 = add i32 %0, 32
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 7
%8 = load volatile i32, i32* %5
%9 = and i32 %8, -8
store volatile i32 %9, i32* %5
%10 = and i32 %1, 7
%11 = load volatile i32, i32* %5
%12 = or i32 %11, %10
store volatile i32 %12, i32* %5
ret i32 %7
}
int fun799() { return 799; }


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

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

LLVM IR (-O0):
define i32 @fun799() {
ret i32 799
}

LLVM IR (-O2):
define i32 @fun799() {
ret i32 799
}
/* Variables and functions */
int /*<<< orphan*/ FH_DU();
int /*<<< orphan*/ init();
int /*<<< orphan*/ interface();
int main(void) {
  unsigned int i;
  for (i = 0; i < 268; i++) {
    init();
    interface();
    FH_DU();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x10c,-0x8(%rbp)
jae    1176 <main+0x46>
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <interface@plt>
mov    $0x0,%al
call   1050 <FH_DU@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x10c,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <interface@plt>
xor    %eax,%eax
call   1050 <FH_DU@plt>
add    $0xffffffff,%ebx
jne    1140 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp ult i32 %4, 268
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = call i32 (...) @init()
%8 = call i32 (...) @interface()
%9 = call i32 (...) @FH_DU()
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @interface()
%5 = tail call i32 (...) @FH_DU()
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 268
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
int *foo() {
  int i;
  int array[5];
  for (i = 0; i < 5; i++) {
    array[i] = 42;
  }
  return array;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    112f <foo+0x2f>
movslq -0x4(%rbp),%rax
movl   $0x2a,-0x20(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <foo+0xb>
lea    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    -0x18(%rsp),%rax
ret

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

LLVM IR (-O2):
define noalias i32* @foo() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
ret i32* %3
}
void ADC0Seq0_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @ADC0Seq0_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ apt_clean(char *);
int /*<<< orphan*/ apt_fullupgrade(char *);
int /*<<< orphan*/ apt_update(char *);
int /*<<< orphan*/ clam_scan_util(char *, int /*<<< orphan*/);
int /*<<< orphan*/ clapt_confirm(char *);
int /*<<< orphan*/ clapt_init();
int /*<<< orphan*/ clapt_lock_apt(char *);
void clapt_complete(char *prog) {
  clapt_confirm(prog);
  clapt_init();
  clapt_lock_apt(prog);
  apt_update(prog);
  apt_fullupgrade(prog);
  clam_scan_util(prog, 0);
  apt_clean(prog);
}


x86 assembly (clang, -O0):
<clapt_complete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1090 <clapt_confirm@plt>
mov    $0x0,%al
call   1040 <clapt_init@plt>
mov    -0x8(%rbp),%rdi
call   1060 <clapt_lock_apt@plt>
mov    -0x8(%rbp),%rdi
call   1080 <apt_update@plt>
mov    -0x8(%rbp),%rdi
call   1050 <apt_fullupgrade@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <clam_scan_util@plt>
mov    -0x8(%rbp),%rdi
call   1070 <apt_clean@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clapt_complete>:
push   %rbx
mov    %rdi,%rbx
call   1090 <clapt_confirm@plt>
xor    %eax,%eax
call   1040 <clapt_init@plt>
mov    %rbx,%rdi
call   1060 <clapt_lock_apt@plt>
mov    %rbx,%rdi
call   1080 <apt_update@plt>
mov    %rbx,%rdi
call   1050 <apt_fullupgrade@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <clam_scan_util@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1070 <apt_clean@plt>

LLVM IR (-O0):
define void @clapt_complete(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @clapt_confirm(i8* %3)
%5 = call i32 (...) @clapt_init()
%6 = load i8*, i8** %2
%7 = call i32 @clapt_lock_apt(i8* %6)
%8 = load i8*, i8** %2
%9 = call i32 @apt_update(i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @apt_fullupgrade(i8* %10)
%12 = load i8*, i8** %2
%13 = call i32 @clam_scan_util(i8* %12, i32 0)
%14 = load i8*, i8** %2
%15 = call i32 @apt_clean(i8* %14)
ret void
}

LLVM IR (-O2):
define void @clapt_complete(i8* %0) {
%2 = tail call i32 @clapt_confirm(i8* %0)
%3 = tail call i32 (...) @clapt_init()
%4 = tail call i32 @clapt_lock_apt(i8* %0)
%5 = tail call i32 @apt_update(i8* %0)
%6 = tail call i32 @apt_fullupgrade(i8* %0)
%7 = tail call i32 @clam_scan_util(i8* %0, i32 0)
%8 = tail call i32 @apt_clean(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("Main\n\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"Main\0A\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"Main\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
double slope(int x1, int y1, int x2, int y2) { return (y2 - y1) / (x2 - x1); }


x86 assembly (clang, -O0):
<slope>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<slope>:
mov    %ecx,%eax
mov    %edx,%ecx
sub    %esi,%eax
sub    %edi,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @slope(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32, i32* %6
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = load i32, i32* %5
%14 = sub nsw i32 %12, %13
%15 = sdiv i32 %11, %14
%16 = sitofp i32 %15 to double
ret double %16
}

LLVM IR (-O2):
define double @slope(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %3, %1
%6 = sub nsw i32 %2, %0
%7 = sdiv i32 %5, %6
%8 = sitofp i32 %7 to double
ret double %8
}
void free_2d_float(float **ptr) {
  free(ptr[0]);
  free(ptr);
}


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

x86 assembly (clang, -O2):
<free_2d_float>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_2d_float(float** nocapture %0) {
%2 = bitcast float** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast float** %0 to i8*
tail call void @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  int *p;
  unsigned int n;
  p = malloc(sizeof(int) * 10);
  free(p);
  p[1] = 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movl   $0x1,0x4(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @malloc(i32 40)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @free(i32* %4)
%6 = load i32*, i32** %1
%7 = getelementptr inbounds i32, i32* %6, i64 1
store i32 1, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 40)
%2 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Variables and functions */
float boxstepf(float, float, float);
float boxpulsef(float value, float up_slope_start, float up_slope_end,
                float down_slope_start, float down_slope_end) {
  return boxstepf(value, up_slope_start, up_slope_end) -
         boxstepf(value, down_slope_start, down_slope_end);
}


x86 assembly (clang, -O0):
<boxpulsef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <boxstepf@plt>
movss  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
call   1030 <boxstepf@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
subss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<boxpulsef>:
sub    $0x18,%rsp
movss  %xmm4,0x14(%rsp)
movss  %xmm3,0x10(%rsp)
movss  %xmm0,0x8(%rsp)
call   1030 <boxstepf@plt>
movss  %xmm0,0xc(%rsp)
movss  0x8(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
call   1030 <boxstepf@plt>
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @boxpulsef(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %6
%12 = load float, float* %7
%13 = load float, float* %8
%14 = call float @boxstepf(float %11, float %12, float %13)
%15 = load float, float* %6
%16 = load float, float* %9
%17 = load float, float* %10
%18 = call float @boxstepf(float %15, float %16, float %17)
%19 = fsub float %14, %18
ret float %19
}

LLVM IR (-O2):
define float @boxpulsef(float %0, float %1, float %2, float %3, float %4) {
%6 = tail call float @boxstepf(float %0, float %1, float %2)
%7 = tail call float @boxstepf(float %0, float %3, float %4)
%8 = fsub float %6, %7
ret float %8
}
int test_imm_3Aint16_mem(short *val) {
  return ((*val) & (0x3A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Aint16_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, 58
%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_3Aint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 58
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ write16(int *, int);
void write24(uint8_t *base, uint32_t value) {
  write16(base, value);
  base[2] = (value >> 16) & 0xff;
}


x86 assembly (clang, -O0):
<write24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <write16@plt>
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write24>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <write16@plt>
shr    $0x10,%ebx
movzbl %bl,%eax
mov    %eax,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @write24(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 @write16(i32* %5, i32 %6)
%8 = load i32, i32* %4
%9 = ashr i32 %8, 16
%10 = and i32 %9, 255
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 2
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
define void @write24(i32* %0, i32 %1) {
%3 = tail call i32 @write16(i32* %0, i32 %1)
%4 = lshr i32 %1, 16
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TIM12_ISR();
int /*<<< orphan*/ TIM8_BRK_ISR();
void TIM8_BRK_TIM12_ISR(void) {
  TIM8_BRK_ISR();
  TIM12_ISR();
}


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

x86 assembly (clang, -O2):
<TIM8_BRK_TIM12_ISR>:
push   %rax
xor    %eax,%eax
call   1040 <TIM8_BRK_ISR@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <TIM12_ISR@plt>

LLVM IR (-O0):
define void @TIM8_BRK_TIM12_ISR() {
%1 = call i32 (...) @TIM8_BRK_ISR()
%2 = call i32 (...) @TIM12_ISR()
ret void
}

LLVM IR (-O2):
define void @TIM8_BRK_TIM12_ISR() {
%1 = tail call i32 (...) @TIM8_BRK_ISR()
%2 = tail call i32 (...) @TIM12_ISR()
ret void
}
void literal_pool(int n) {}


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

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

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

LLVM IR (-O2):
define void @literal_pool(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_6() {
  Assert_real((isqrt(6) == 2),
              "/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/stdlib/isqrt.c",
              35, ("Integer square root of 6 should be 2"));
}


x86 assembly (clang, -O0):
<t_sqrt_6>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
call   1030 <isqrt@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x23,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_6>:
push   %rax
mov    $0x6,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x23,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [37 x i8] c"Integer square root of 6 should be 2\00"
define void @t_sqrt_6() {
%1 = call i32 @isqrt(i32 6)
%2 = icmp eq i32 %1, 2
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [37 x i8] c"Integer square root of 6 should be 2\00"
define void @t_sqrt_6() {
%1 = tail call i32 @isqrt(i32 6)
%2 = icmp eq i32 %1, 2
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 35, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *);
void print_error_output_file(void) {
  print_error("Cannot write output file");
  return;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Cannot write output file\00"
define void @print_error_output_file() {
%1 = call i32 @print_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Cannot write output file\00"
define void @print_error_output_file() {
%1 = tail call i32 @print_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}
void eapol_sm_notify_config(struct eapol_sm *sm, struct wpa_ssid *config,
                            struct eapol_config *conf) {}


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

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

LLVM IR (-O0):
%struct.eapol_sm = type opaque
%struct.wpa_ssid = type opaque
%struct.eapol_config = type opaque
define void @eapol_sm_notify_config(%struct.eapol_sm* %0, %struct.wpa_ssid* %1, %struct.eapol_config* %2) {
%4 = alloca %struct.eapol_sm*
%5 = alloca %struct.wpa_ssid*
%6 = alloca %struct.eapol_config*
store %struct.eapol_sm* %0, %struct.eapol_sm** %4
store %struct.wpa_ssid* %1, %struct.wpa_ssid** %5
store %struct.eapol_config* %2, %struct.eapol_config** %6
ret void
}

LLVM IR (-O2):
%struct.eapol_sm = type opaque
%struct.wpa_ssid = type opaque
%struct.eapol_config = type opaque
define void @eapol_sm_notify_config(%struct.eapol_sm* nocapture %0, %struct.wpa_ssid* nocapture %1, %struct.eapol_config* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: value ...\n");
  exit(2);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"usage: value ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"usage: value ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
int foo(int x) {
  if (x < 0)
    x = 1;
  return x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1118 <foo+0x18>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
mov    $0x1,%eax
cmovns %edi,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 1, i32* %2
br label %6
6: ; preds = %5, %1
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
ret i32 %3
}
char *TeX_search_config_file(char **name) { return *name; }


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

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

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

LLVM IR (-O2):
define i8* @TeX_search_config_file(i8** nocapture %0) {
%2 = load i8*, i8** %0
ret i8* %2
}
int md_get_info(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @md_get_info() {
ret i32 1
}