xunge/DecIR huggingface dataset:
void NullDottedArc(struct ADrawTag *ctx __attribute__((unused)),
                   unsigned int cx __attribute__((unused)),
                   unsigned int cy __attribute__((unused)),
                   unsigned int w __attribute__((unused)),
                   unsigned int h __attribute__((unused)),
                   unsigned int s __attribute__((unused)),
                   unsigned int e __attribute__((unused))) {}


x86 assembly (clang, -O0):
<NullDottedArc>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ADrawTag = type opaque
define void @NullDottedArc(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca %struct.ADrawTag*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store %struct.ADrawTag* %0, %struct.ADrawTag** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type opaque
define void @NullDottedArc(%struct.ADrawTag* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
ret void
}
/* Variables and functions */
char const **sys_errlist;
int sys_nerr;
const char *terror(int err) {
  if ((err < 0) || (err >= sys_nerr)) {
    return "unknown error";
  }
  return sys_errlist[err];
}


x86 assembly (clang, -O0):
<terror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1123 <terror+0x23>
mov    -0xc(%rbp),%eax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%eax
jl     1133 <terror+0x33>
lea    0xed6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1149 <terror+0x49>
mov    0x2ebe(%rip),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<terror>:
lea    0xef9(%rip),%rax
test   %edi,%edi
js     1126 <terror+0x26>
mov    0x2ed6(%rip),%rcx
cmp    %edi,(%rcx)
jle    1126 <terror+0x26>
mov    0x2edb(%rip),%rax
mov    (%rax),%rax
mov    %edi,%ecx
mov    (%rax,%rcx,8),%rax
ret

LLVM IR (-O0):
@sys_nerr = global i32 0
@.str = [14 x i8] c"unknown error\00"
@sys_errlist = global i8** null
define i8* @terror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = load i32, i32* @sys_nerr
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6, %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
11: ; preds = %6
%12 = load i8**, i8*** @sys_errlist
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
store i8* %16, i8** %2
br label %17
17: ; preds = %11, %10
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@sys_nerr = global i32 0
@.str = [14 x i8] c"unknown error\00"
@sys_errlist = global i8** null
define i8* @terror(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = load i32, i32* @sys_nerr
%4 = icmp sgt i32 %3, %0
%5 = select i1 %2, i1 %4, i1 false
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8**, i8*** @sys_errlist
%8 = zext i32 %0 to i64
%9 = getelementptr inbounds i8*, i8** %7, i64 %8
%10 = load i8*, i8** %9
br label %11
11: ; preds = %1, %6
%12 = phi i8* [ %10, %6 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %12
}
int test_imm_9Duint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x9D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Duint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x9d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Duint64_midword_reg>:
test   $0x9d0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Duint64_midword_reg(i64 %0) {
%2 = and i64 %0, 10289152
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage() {
  fprintf(stderr, "wipe <system|data|all>\n\n"
                  "system means '/system'\n"
                  "data means '/data'\n");
  return -1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [67 x i8] c"wipe <system|data|all>\0A\0Asystem means '/system'\0Adata means '/data'\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [67 x i8] c"wipe <system|data|all>\0A\0Asystem means '/system'\0Adata means '/data'\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int getValue(char *string) {
  int value;
  printf("\tPlease enter %s", string);
  scanf("%d", &value);
  return value;
}


x86 assembly (clang, -O0):
<getValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getValue>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"\09Please enter %s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @getValue(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"\09Please enter %s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @getValue(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void footbar_menu() {
  printf("\tUse the 'w' & 's' to switch the select option - press "
         "\x1b[32m"
         "ENTER"
         "\x1b[0m"
         " to select\n\t\t\t\t\t\t\t  "
         "\x1b[36m"
         "Version %s\n\n"
         "\x1b[0m",
         "1.5");
}


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

x86 assembly (clang, -O2):
<footbar_menu>:
lea    0xee9(%rip),%rdi
lea    0xf51(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [111 x i8] c"\09Use the 'w' & 's' to switch the select option - press \1B[32mENTER\1B[0m to select\0A\09\09\09\09\09\09\09 \1B[36mVersion %s\0A\0A\1B[0m\00"
@.str.1 = [4 x i8] c"1.5\00"
define void @footbar_menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [111 x i8] c"\09Use the 'w' & 's' to switch the select option - press \1B[32mENTER\1B[0m to select\0A\09\09\09\09\09\09\09 \1B[36mVersion %s\0A\0A\1B[0m\00"
@.str.1 = [4 x i8] c"1.5\00"
define void @footbar_menu() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main(void) { printf("%d", simpleArraySum((int[]){1, 2, 3, 4, 10, 11})); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2f01(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2efe(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2efb(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <simpleArraySum@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee9(%rip),%rax
mov    %rax,0x10(%rsp)
movups 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <simpleArraySum@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@constinit = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 10, i32 11]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 (i32*, ...) bitcast (i32 (...)* @simpleArraySum to i32 (i32*, ...)*)(i32* %3)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
char *U_EMR_CORE5_set(int);
char *U_EMRBEGINPATH_set(void) { return (U_EMR_CORE5_set(59)); }


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

x86 assembly (clang, -O2):
<U_EMRBEGINPATH_set>:
mov    $0x3b,%edi
jmp    1030 <U_EMR_CORE5_set@plt>

LLVM IR (-O0):
define i8* @U_EMRBEGINPATH_set() {
%1 = call i8* @U_EMR_CORE5_set(i32 59)
ret i8* %1
}

LLVM IR (-O2):
define i8* @U_EMRBEGINPATH_set() {
%1 = tail call i8* @U_EMR_CORE5_set(i32 59)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void EthernetPHYAddrSet(unsigned long ulBase, unsigned char ucAddr) {
  DEBUG_ASSERT(ulBase == 0x40048000);
  while ((*((volatile unsigned long *)(ulBase + 0x00000020))) & 0x00000001) {
  }
  (*((volatile unsigned long *)(ulBase + 0x00000028))) = ucAddr;
}


x86 assembly (clang, -O0):
<EthernetPHYAddrSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpq   $0x40048000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1152 <EthernetPHYAddrSet+0x42>
jmp    1137 <EthernetPHYAddrSet+0x27>
movzbl -0x9(%rbp),%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %rcx,0x28(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EthernetPHYAddrSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40048000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
nopw   0x0(%rax,%rax,1)
mov    0x20(%rbx),%rax
test   $0x1,%al
jne    1130 <EthernetPHYAddrSet+0x20>
movzbl %bpl,%eax
mov    %rax,0x28(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @EthernetPHYAddrSet(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074036736
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
br label %9
9: ; preds = %16, %2
%10 = load i64, i64* %3
%11 = add i64 %10, 32
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, 1
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %9
br label %9
17: ; preds = %9
%18 = load i8, i8* %4
%19 = zext i8 %18 to i64
%20 = load i64, i64* %3
%21 = add i64 %20, 40
%22 = inttoptr i64 %21 to i64*
store volatile i64 %19, i64* %22
ret void
}

LLVM IR (-O2):
define void @EthernetPHYAddrSet(i64 %0, i8 zeroext %1) {
%3 = icmp eq i64 %0, 1074036736
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = add i64 %0, 32
%7 = inttoptr i64 %6 to i64*
br label %8
8: ; preds = %8, %2
%9 = load volatile i64, i64* %7
%10 = and i64 %9, 1
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %8
12: ; preds = %8
%13 = zext i8 %1 to i64
%14 = add i64 %0, 40
%15 = inttoptr i64 %14 to i64*
store volatile i64 %13, i64* %15
ret void
}
void qc_wait(int val) {
  int i;
  while (val--)
    for (i = 0; i < 50000; i++)
      ;
}


x86 assembly (clang, -O0):
<qc_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1147 <qc_wait+0x47>
movl   $0x0,-0x8(%rbp)
cmpl   $0xc350,-0x8(%rbp)
jge    1142 <qc_wait+0x42>
jmp    1134 <qc_wait+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <qc_wait+0x22>
jmp    1107 <qc_wait+0x7>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @qc_wait(i32 %0) {
ret void
}
int _nx_upper_power_of_two(int number) {
  --number;
  number |= number >> 1;
  number |= number >> 2;
  number |= number >> 4;
  number |= number >> 8;
  number |= number >> 16;
  return ++number;
}


x86 assembly (clang, -O0):
<_nx_upper_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nx_upper_power_of_two>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @_nx_upper_power_of_two(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
void gdk_device_get_core_pointer() {}


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

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

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

LLVM IR (-O2):
define void @gdk_device_get_core_pointer() {
ret void
}
int is_a_vowel(ch)
char ch;
{
  switch (ch) {
  case 'a':
  case 'e':
  case 'i':
  case 'o':
  case 'u':
  case 'A':
  case 'E':
  case 'I':
  case 'O':
  case 'U':
    return (1);
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<is_a_vowel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x41,%eax
je     11b8 <is_a_vowel+0xb8>
jmp    111f <is_a_vowel+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x45,%eax
je     11b8 <is_a_vowel+0xb8>
jmp    1130 <is_a_vowel+0x30>
mov    -0xc(%rbp),%eax
sub    $0x49,%eax
je     11b8 <is_a_vowel+0xb8>
jmp    1141 <is_a_vowel+0x41>
mov    -0xc(%rbp),%eax
sub    $0x4f,%eax
je     11b8 <is_a_vowel+0xb8>
jmp    1152 <is_a_vowel+0x52>
mov    -0xc(%rbp),%eax
sub    $0x55,%eax
je     11b8 <is_a_vowel+0xb8>
jmp    1163 <is_a_vowel+0x63>
mov    -0xc(%rbp),%eax
sub    $0x61,%eax
je     11b8 <is_a_vowel+0xb8>
jmp    1174 <is_a_vowel+0x74>
mov    -0xc(%rbp),%eax
sub    $0x65,%eax
je     11b8 <is_a_vowel+0xb8>
jmp    1185 <is_a_vowel+0x85>
mov    -0xc(%rbp),%eax
sub    $0x69,%eax
je     11b8 <is_a_vowel+0xb8>
jmp    1196 <is_a_vowel+0x96>
mov    -0xc(%rbp),%eax
sub    $0x6f,%eax
je     11b8 <is_a_vowel+0xb8>
jmp    11a7 <is_a_vowel+0xa7>
mov    -0xc(%rbp),%eax
sub    $0x75,%eax
jne    11c4 <is_a_vowel+0xc4>
jmp    11b8 <is_a_vowel+0xb8>
movl   $0x1,-0x4(%rbp)
jmp    11cb <is_a_vowel+0xcb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_a_vowel>:
movsbl %dil,%ecx
add    $0xffffffbf,%ecx
cmp    $0x34,%ecx
ja     1122 <is_a_vowel+0x22>
mov    $0x1,%eax
movabs $0x10411100104111,%rdx
bt     %rcx,%rdx
jae    1122 <is_a_vowel+0x22>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_a_vowel(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
switch i32 %6, label %8 [
i32 97, label %7
i32 101, label %7
i32 105, label %7
i32 111, label %7
i32 117, label %7
i32 65, label %7
i32 69, label %7
i32 73, label %7
i32 79, label %7
i32 85, label %7
]
7: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_a_vowel(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
switch i32 %3, label %4 [
i32 97, label %5
i32 101, label %5
i32 105, label %5
i32 111, label %5
i32 117, label %5
i32 65, label %5
i32 69, label %5
i32 73, label %5
i32 79, label %5
i32 85, label %5
]
4: ; preds = %1
br label %5
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %4
%6 = phi i32 [ 0, %4 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
float *quat_null(float *result) {
  result[0] = 0.0f;
  result[1] = 0.0f;
  result[2] = 0.0f;
  result[3] = 1.0f;
  return result;
}


x86 assembly (clang, -O0):
<quat_null>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  0xec9(%rip),%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_null>:
mov    %rdi,%rax
movaps 0xef6(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define float* @quat_null(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 0.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 3
store float 1.000000e+00, float* %10
%11 = load float*, float** %2
ret float* %11
}

LLVM IR (-O2):
define float* @quat_null(float* returned writeonly %0) {
%2 = bitcast float* %0 to <4 x float>*
store <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00>, <4 x float>* %2
ret float* %0
}
/* Variables and functions */
void *alloc4();
void *alloc3(void) { return alloc4(); }


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

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

LLVM IR (-O0):
define i8* @alloc3() {
%1 = call i8* (...) @alloc4()
ret i8* %1
}

LLVM IR (-O2):
define i8* @alloc3() {
%1 = tail call i8* (...) @alloc4()
ret i8* %1
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int gob_decode_int64(scalar_t__ *, char *, size_t);
int gob_decode_int(int *v, char *buf, size_t buf_size) {
  int n;
  int64_t vv = 0;
  n = gob_decode_int64(&vv, buf, buf_size);
  *v = (int)vv;
  return n;
}


x86 assembly (clang, -O0):
<gob_decode_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x28(%rbp),%rdi
call   1030 <gob_decode_int64@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gob_decode_int>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <gob_decode_int64@plt>
mov    0x8(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gob_decode_int(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i64 0, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @gob_decode_int64(i64* %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = load i64, i64* %8
%13 = trunc i64 %12 to i32
%14 = load i32*, i32** %4
store i32 %13, i32* %14
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
define i32 @gob_decode_int(i32* nocapture writeonly %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
store i64 0, i64* %4
%6 = call i32 @gob_decode_int64(i64* %4, i8* %1, i64 %2)
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
store i32 %8, i32* %0
ret i32 %6
}
int endian() {
  int i = 1;
  char *p = (char *)&i;
  if (p[0] == 1)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    112f <endian+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1136 <endian+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @endian() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 1, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %0
store i32 0, i32* %1
br label %12
11: ; preds = %0
store i32 1, i32* %1
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @endian() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func() { printf("Hi, this is bar!\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Hi, this is bar!\0A\00"
define void @func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"Hi, this is bar!\00"
define void @func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
float average(float array[10]) {
  int i;
  float aver, sum = 0;
  for (i = 0; i < 10; i++) {
    sum += array[i];
  }
  aver = sum / 10;
  return aver;
}


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1146 <average+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <average+0x17>
movss  -0x14(%rbp),%xmm0
movss  0xead(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
xorps  %xmm0,%xmm0
addss  (%rdi),%xmm0
addss  0x4(%rdi),%xmm0
addss  0x8(%rdi),%xmm0
addss  0xc(%rdi),%xmm0
addss  0x10(%rdi),%xmm0
addss  0x14(%rdi),%xmm0
addss  0x18(%rdi),%xmm0
addss  0x1c(%rdi),%xmm0
addss  0x20(%rdi),%xmm0
addss  0x24(%rdi),%xmm0
divss  0xec4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @average(float* %0) {
%2 = alloca float*
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float* %0, float** %2
store float 0.000000e+00, float* %5
store i32 0, i32* %3
br label %6
6: ; preds = %17, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load float*, float** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds float, float* %10, i64 %12
%14 = load float, float* %13
%15 = load float, float* %5
%16 = fadd float %15, %14
store float %16, float* %5
br label %17
17: ; preds = %9
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %6
20: ; preds = %6
%21 = load float, float* %5
%22 = fdiv float %21, 1.000000e+01
store float %22, float* %4
%23 = load float, float* %4
ret float %23
}

LLVM IR (-O2):
define float @average(float* nocapture %0) {
%2 = load float, float* %0
%3 = fadd float %2, 0.000000e+00
%4 = getelementptr inbounds float, float* %0, i64 1
%5 = load float, float* %4
%6 = fadd float %3, %5
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = fadd float %6, %8
%10 = getelementptr inbounds float, float* %0, i64 3
%11 = load float, float* %10
%12 = fadd float %9, %11
%13 = getelementptr inbounds float, float* %0, i64 4
%14 = load float, float* %13
%15 = fadd float %12, %14
%16 = getelementptr inbounds float, float* %0, i64 5
%17 = load float, float* %16
%18 = fadd float %15, %17
%19 = getelementptr inbounds float, float* %0, i64 6
%20 = load float, float* %19
%21 = fadd float %18, %20
%22 = getelementptr inbounds float, float* %0, i64 7
%23 = load float, float* %22
%24 = fadd float %21, %23
%25 = getelementptr inbounds float, float* %0, i64 8
%26 = load float, float* %25
%27 = fadd float %24, %26
%28 = getelementptr inbounds float, float* %0, i64 9
%29 = load float, float* %28
%30 = fadd float %27, %29
%31 = fdiv float %30, 1.000000e+01
ret float %31
}
const char *sw(int x) {
  switch (x) {
  case 4:
    return "four";
  case 5:
    return "five";
  case 6:
    return "six";
  default:
    return "default";
  }
}


x86 assembly (clang, -O0):
<sw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x4,%eax
je     113d <sw+0x3d>
jmp    111b <sw+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x5,%eax
je     114d <sw+0x4d>
jmp    112c <sw+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x6,%eax
je     115d <sw+0x5d>
jmp    116d <sw+0x6d>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <sw+0x78>
lea    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <sw+0x78>
lea    0xea6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <sw+0x78>
lea    0xe9a(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sw>:
add    $0xfffffffc,%edi
cmp    $0x2,%edi
ja     111a <sw+0x1a>
movslq %edi,%rax
lea    0xf06(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xeed(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"four\00"
@.str.1 = [5 x i8] c"five\00"
@.str.2 = [4 x i8] c"six\00"
@.str.3 = [8 x i8] c"default\00"
define i8* @sw(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 4, label %5
i32 5, label %6
i32 6, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"four\00"
@.str.1 = [5 x i8] c"five\00"
@.str.2 = [4 x i8] c"six\00"
@.str.3 = [8 x i8] c"default\00"
@reltable.sw = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.sw to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.sw to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.sw to i64)) to i32)]
define i8* @sw(i32 %0) {
%2 = add i32 %0, -4
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.sw to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %9
}
doincr(ap, c) char **ap;
{
  if (c >= 1)
    putnum(ctol(ap[1]) + 1);
}


x86 assembly (clang, -O0):
<doincr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     1154 <doincr+0x34>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1030 <ctol@plt>
mov    %eax,%edi
add    $0x1,%edi
mov    $0x0,%al
call   1040 <putnum@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doincr>:
test   %esi,%esi
jle    113e <doincr+0x1e>
push   %rax
mov    0x8(%rdi),%rdi
xor    %eax,%eax
call   1030 <ctol@plt>
lea    0x1(%rax),%edi
xor    %eax,%eax
call   1040 <putnum@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @doincr(i8** %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp sge i32 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @ctol to i32 (i8*, ...)*)(i8* %11)
%13 = add nsw i32 %12, 1
%14 = call i32 (i32, ...) bitcast (i32 (...)* @putnum to i32 (i32, ...)*)(i32 %13)
br label %15
15: ; preds = %8, %2
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @doincr(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %0, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ctol to i32 (i8*, ...)*)(i8* %6)
%8 = add nsw i32 %7, 1
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @putnum to i32 (i32, ...)*)(i32 %8)
br label %10
10: ; preds = %4, %2
ret i32 undef
}
/* Type definitions */
struct HNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int freeHNode(struct HNode *node, int height, void *adata) {
  if (node)
    free((void *)node);
  return 1;
}


x86 assembly (clang, -O0):
<freeHNode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <freeHNode+0x27>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeHNode>:
test   %rdi,%rdi
je     111f <freeHNode+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.HNode = type { i32 }
define i32 @freeHNode(%struct.HNode* %0, i32 %1, i8* %2) {
%4 = alloca %struct.HNode*
%5 = alloca i32
%6 = alloca i8*
store %struct.HNode* %0, %struct.HNode** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.HNode*, %struct.HNode** %4
%8 = icmp ne %struct.HNode* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load %struct.HNode*, %struct.HNode** %4
%11 = bitcast %struct.HNode* %10 to i8*
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %9, %3
ret i32 1
}

LLVM IR (-O2):
%struct.HNode = type { i32 }
define i32 @freeHNode(%struct.HNode* %0, i32 %1, i8* nocapture readnone %2) {
%4 = icmp eq %struct.HNode* %0, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = bitcast %struct.HNode* %0 to i8*
%7 = tail call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %3
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ error();
int /*<<< orphan*/ errorANOTHER();
int /*<<< orphan*/ say_four();
int /*<<< orphan*/ say_three();
int /*<<< orphan*/ say_two();
int main() {
  say_two();
  say_three();
  say_four();
  errorANOTHER();
  error();
  errorANOTHER();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <say_two@plt>
mov    $0x0,%al
call   1060 <say_three@plt>
mov    $0x0,%al
call   1030 <say_four@plt>
mov    $0x0,%al
call   1040 <errorANOTHER@plt>
mov    $0x0,%al
call   1070 <error@plt>
mov    $0x0,%al
call   1040 <errorANOTHER@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <say_two@plt>
xor    %eax,%eax
call   1060 <say_three@plt>
xor    %eax,%eax
call   1030 <say_four@plt>
xor    %eax,%eax
call   1040 <errorANOTHER@plt>
xor    %eax,%eax
call   1070 <error@plt>
xor    %eax,%eax
call   1040 <errorANOTHER@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @say_two()
%3 = call i32 (...) @say_three()
%4 = call i32 (...) @say_four()
%5 = call i32 (...) @errorANOTHER()
%6 = call i32 (...) @error()
%7 = call i32 (...) @errorANOTHER()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @say_two()
%2 = tail call i32 (...) @say_three()
%3 = tail call i32 (...) @say_four()
%4 = tail call i32 (...) @errorANOTHER()
%5 = tail call i32 (...) @error()
%6 = tail call i32 (...) @errorANOTHER()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_char(char const, int);
void print_string(const char *str, int color) {
  int i = 0;
  while (str[i] != '\0') {
    print_char(str[i], color);
    i++;
  }
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115f <print_string+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0xc(%rbp),%esi
movsbl %al,%edi
call   1030 <print_char@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_string+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <print_string+0x35>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <print_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <print_string+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @print_string(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = tail call i32 @print_char(i8 signext %7, i32 %1)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int i = 1;
  int j = i + 2 * i++;
  printf("i is %d \n", j);
  i = 1;
  printf("i is %d \n", i + 2 + i++);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%esi
add    $0x2,%esi
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
add    %eax,%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"i is %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
%6 = mul nsw i32 2, %4
%7 = add nsw i32 %3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 1, i32* %1
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 2
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
%14 = add nsw i32 %11, %12
%15 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"i is %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xd4() {
  Assert_real((islower(212) == 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_islower.c",
              1065, ("islower should be 0 for 0xd4"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xd4\00"
define void @t_islower_0xd4() {
%1 = call i64 @islower(i32 212)
%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 1065, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xd4\00"
define void @t_islower_0xd4() {
%1 = tail call i64 @islower(i32 212)
%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 1065, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *program) {
  printf("usage: %s domain [dns]\n", program);
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"usage: %s domain [dns]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"usage: %s domain [dns]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int BIO_seek(int /*<<< orphan*/ *, int);
int BioSeek(BIO *bio, int ofs) {
  if (!bio) {
    return -1;
  }
  return BIO_seek(bio, ofs);
}


x86 assembly (clang, -O0):
<BioSeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1136 <BioSeek+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <BioSeek+0x35>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <BIO_seek@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BioSeek>:
test   %rdi,%rdi
je     111a <BioSeek+0xa>
jmp    1030 <BIO_seek@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @BioSeek(i32* %0, i32 %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @BIO_seek(i32* %0, i32 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ -1, %2 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
unsigned fget_u16(FILE *fp) {
  unsigned ret;
  ret = fgetc(fp);
  ret |= fgetc(fp) << 8;
  return ret;
}


x86 assembly (clang, -O0):
<fget_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fget_u16>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fget_u16(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = call i32 @fgetc(i32* %6)
%8 = shl i32 %7, 8
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @fget_u16(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @fgetc(i32* %0)
%4 = shl i32 %3, 8
%5 = or i32 %4, %2
ret i32 %5
}