xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int toupper(char const);
int uppercase(int msg_len, const char *msg) {
  int i;
  for (i = 0; i < msg_len; ++i)
    printf("%c", toupper(msg[i]));
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1171 <uppercase+0x51>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <uppercase+0x16>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uppercase>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    115a <uppercase+0x3a>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <uppercase+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @uppercase(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @toupper(i8 signext %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @uppercase(i32 %0, i8* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @toupper(i8 signext %9)
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret i32 0
}
void clear() {}


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

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

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

LLVM IR (-O2):
define void @clear() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
int main(void) {
  int exp = -1;
  if ((exp < 2 ? 2U : (unsigned int)exp) != 2)
    link_error();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    113d <main+0x2d>
mov    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <main+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    $0x2,%eax
je     1156 <main+0x46>
mov    $0x0,%al
call   1030 <link_error@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 2
br i1 %4, label %5, label %6
5: ; preds = %0
br label %8
6: ; preds = %0
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 2, %5 ], [ %7, %6 ]
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @link_error()
br label %13
13: ; preds = %11, %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ StabilizationSettingsBank3Handle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void StabilizationSettingsBank3Updated() {
  UAVObjUpdated(StabilizationSettingsBank3Handle());
}


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

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

LLVM IR (-O0):
define void @StabilizationSettingsBank3Updated() {
%1 = call i32 (...) @StabilizationSettingsBank3Handle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @StabilizationSettingsBank3Updated() {
%1 = tail call i32 (...) @StabilizationSettingsBank3Handle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main() {
  char s[15] = "redrum redrum";
  printf("%s\n", s);
  reverse(s);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeba(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x13(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
lea    -0x13(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0x13(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x6d7572646572,%rax
mov    %rax,0xf(%rsp)
movabs $0x72206d7572646572,%rax
6d 20 72
mov    %rax,0x8(%rsp)
lea    0xec3(%rip),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@__const.main.s = [15 x i8] c"redrum redrum\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @reverse(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int main(void) {
  char a = "Hello"[2];
  char b = 2 ["World"];
  return a + b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xef1(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeee(%rip),%al
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [6 x i8] c"World\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
%4 = load i8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 2)
store i8 %4, i8* %2
%5 = load i8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 2)
store i8 %5, i8* %3
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
ret i32 222
}
struct Value *handle_recall_command(args)
char *args;
{
  return newint_fl(do_recall(args),
                   "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                   "outputs/2022-01-22/02-19-57/repos/gary9872/tf40s1/refs/"
                   "heads/master/src/history.c",
                   270);
}


x86 assembly (clang, -O0):
<handle_recall_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <do_recall@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
mov    $0x10e,%edx
mov    $0x0,%al
call   1030 <newint_fl@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_recall_command>:
push   %rax
xor    %eax,%eax
call   1040 <do_recall@plt>
lea    0xed1(%rip),%rsi
mov    %eax,%edi
mov    $0x10e,%edx
xor    %eax,%eax
call   1030 <newint_fl@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.Value = type opaque
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gary9872/tf40s1/refs/heads/master/src/history.c\00"
define %struct.Value* @handle_recall_command(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @do_recall to i32 (i8*, ...)*)(i8* %3)
%5 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @newint_fl to i32 (i32, i8*, i32, ...)*)(i32 %4, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 270)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.Value*
ret %struct.Value* %7
}

LLVM IR (-O2):
%struct.Value = type opaque
@.str = [138 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/gary9872/tf40s1/refs/heads/master/src/history.c\00"
define %struct.Value* @handle_recall_command(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @do_recall to i32 (i8*, ...)*)(i8* %0)
%3 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @newint_fl to i32 (i32, i8*, i32, ...)*)(i32 %2, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i32 270)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to %struct.Value*
ret %struct.Value* %5
}
/* Variables and functions */
int /*<<< orphan*/ Vectors();
void foo_dummy() { Vectors(); }


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

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

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

LLVM IR (-O2):
define void @foo_dummy() {
%1 = tail call i32 (...) @Vectors()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ byteorder();
int main() { byteorder(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <byteorder@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @byteorder()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @byteorder()
ret i32 0
}
/* Variables and functions */
scalar_t__ close(int);
int powercap_close(int fd) { return (fd > 0 && close(fd)) ? -1 : 0; }


x86 assembly (clang, -O0):
<powercap_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113c <powercap_close+0x2c>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0xffffffff,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<powercap_close>:
test   %edi,%edi
jle    1124 <powercap_close+0x14>
push   %rax
call   1030 <close@plt>
neg    %rax
sbb    %eax,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @powercap_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i64 @close(i32 %6)
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 -1, i32 0
ret i32 %12
}

LLVM IR (-O2):
define i32 @powercap_close(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i64 @close(i32 %0)
%5 = icmp ne i64 %4, 0
%6 = sext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
long tzdecode(codep)
char *codep;
{
  register int i;
  register long result;
  result = 0;
  for (i = 0; i < 4; ++i)
    result = (result << 8) | (codep[i] & 0xff);
  return result;
}


x86 assembly (clang, -O0):
<tzdecode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1153 <tzdecode+0x53>
mov    -0x18(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
and    $0xff,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <tzdecode+0x17>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tzdecode>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

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

LLVM IR (-O2):
define i64 @tzdecode(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = shl nuw nsw i64 %3, 16
%8 = shl nuw nsw i64 %6, 8
%9 = or i64 %7, %8
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = or i64 %9, %12
%14 = shl nuw nsw i64 %13, 8
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %14, %17
ret i64 %18
}
unsigned char low_nibble_to_char(unsigned char input) {
  input &= 0x0F;
  if (input < 10) {
    input += '0';
    return input;
  }
  input -= 10;
  input += 'A';
  return input;
}


x86 assembly (clang, -O0):
<low_nibble_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1136 <low_nibble_to_char+0x36>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1150 <low_nibble_to_char+0x50>
movzbl -0x2(%rbp),%eax
sub    $0xa,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
add    $0x41,%eax
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<low_nibble_to_char>:
and    $0xf,%dil
lea    0x30(%rdi),%eax
lea    0x37(%rdi),%ecx
cmp    $0xa,%dil
movzbl %al,%edx
movzbl %cl,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @low_nibble_to_char(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 15
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %17
11: ; preds = %1
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = add nsw i32 %13, 48
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
%16 = load i8, i8* %3
store i8 %16, i8* %2
br label %27
17: ; preds = %1
%18 = load i8, i8* %3
%19 = zext i8 %18 to i32
%20 = sub nsw i32 %19, 10
%21 = trunc i32 %20 to i8
store i8 %21, i8* %3
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = add nsw i32 %23, 65
%25 = trunc i32 %24 to i8
store i8 %25, i8* %3
%26 = load i8, i8* %3
store i8 %26, i8* %2
br label %27
27: ; preds = %17, %11
%28 = load i8, i8* %2
ret i8 %28
}

LLVM IR (-O2):
define zeroext i8 @low_nibble_to_char(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = icmp ult i8 %2, 10
%4 = or i8 %2, 48
%5 = add nuw nsw i8 %2, 55
%6 = select i1 %3, i8 %4, i8 %5
ret i8 %6
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ unix_error(char *);
void Connect(int sockfd, struct sockaddr *serv_addr, int addrlen) {
  int rc;
  if ((rc = connect(sockfd, serv_addr, addrlen)) < 0)
    unix_error("Connect error");
}


x86 assembly (clang, -O0):
<Connect>:
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 <connect@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1159 <Connect+0x39>
lea    0xeac(%rip),%rdi
call   1030 <unix_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Connect>:
push   %rax
call   1040 <connect@plt>
test   %eax,%eax
js     112c <Connect+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <unix_error@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [14 x i8] c"Connect error\00"
define void @Connect(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load %struct.sockaddr*, %struct.sockaddr** %5
%10 = load i32, i32* %6
%11 = call i32 @connect(i32 %8, %struct.sockaddr* %9, i32 %10)
store i32 %11, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @unix_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [14 x i8] c"Connect error\00"
define void @Connect(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @connect(i32 %0, %struct.sockaddr* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @unix_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

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


x86 assembly (clang, -O0):
<getMilis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMilis>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%eax
movslq 0x4(%rsp),%rcx
imul   $0x10624dd3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
add    %eax,%ecx
cvtsi2sd %ecx,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define double @getMilis() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sitofp i32 %10 to double
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void exitB1() {
  exit(1);
  printf("B1\n");
}


x86 assembly (clang, -O0):
<exitB1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @exitB1() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @exitB1() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
RCU_DEF_TEST_FUNC(user_f0, param) {}


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

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

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

LLVM IR (-O2):
define i32 @RCU_DEF_TEST_FUNC(i32 %0, i32 %1) {
ret i32 undef
}
foo() {
  int i;
  i = 3;
  while (foo()) {
    int i;
    i++;
  }
  i = 42;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x8(%rbp)
call   1030 <foo@plt>
cmp    $0x0,%eax
je     113b <foo+0x2b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <foo+0xf>
movl   $0x2a,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
br label %1
1: ; preds = %1, %0
br label %1
}
void pathcon_nm9_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathcon_nm9_decref() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void FPUFlushToZeroModeSet(uint32_t ui32Mode) {
  (*((volatile uint32_t *)(0xE000EF3C))) =
      ((*((volatile uint32_t *)(0xE000EF3C))) & ~(0x01000000)) | ui32Mode;
}


x86 assembly (clang, -O0):
<FPUFlushToZeroModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xe000ef3c,%eax
mov    (%rax),%ecx
and    $0xfeffffff,%ecx
or     -0x4(%rbp),%ecx
mov    $0xe000ef3c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPUFlushToZeroModeSet>:
mov    $0xe000ef3c,%eax
mov    $0xfeffffff,%ecx
and    (%rax),%ecx
or     %edi,%ecx
mov    %ecx,(%rax)
ret

LLVM IR (-O0):
define void @FPUFlushToZeroModeSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load volatile i32, i32* inttoptr (i64 3758157628 to i32*)
%4 = and i32 %3, -16777217
%5 = load i32, i32* %2
%6 = or i32 %4, %5
store volatile i32 %6, i32* inttoptr (i64 3758157628 to i32*)
ret void
}

LLVM IR (-O2):
define void @FPUFlushToZeroModeSet(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 3758157628 to i32*)
%3 = and i32 %2, -16777217
%4 = or i32 %3, %0
store volatile i32 %4, i32* inttoptr (i64 3758157628 to i32*)
ret void
}
int foo() {
  char x = 3;
  return x;
}


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i8
store i8 3, i8* %1
%2 = load i8, i8* %1
%3 = sext i8 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void enomem(void) {
  extern char *progname;
  (void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno));
  exit(2);
}


x86 assembly (clang, -O0):
<enomem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rdx
mov    %rax,%rcx
lea    0xe8f(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<enomem>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%rax
mov    (%rax),%ebx
mov    0x2e8c(%rip),%rax
mov    (%rax),%r14
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea4(%rip),%rsi
mov    %ebx,%edi
mov    %r14,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"%s: %s.\0A\00"
@progname = external global i8*
@errno = global i32 0
define void @enomem() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @progname
%3 = load i32, i32* @errno
%4 = call i8* @strerror(i32 %3)
%5 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %4)
%6 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"%s: %s.\0A\00"
@progname = external global i8*
@errno = global i32 0
define void @enomem() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @progname
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %4)
%6 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void pwm_close_devmem(int dev_fd) { close(dev_fd); }


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

x86 assembly (clang, -O2):
<pwm_close_devmem>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @pwm_close_devmem(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int isDelChar(char c) {
  return (c == '-') || (c == '.') || (c == '=') || (c == '_');
}


x86 assembly (clang, -O0):
<isDelChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     114d <isDelChar+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2e,%ecx
mov    %al,-0x2(%rbp)
je     114d <isDelChar+0x4d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3d,%ecx
mov    %al,-0x2(%rbp)
je     114d <isDelChar+0x4d>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDelChar>:
cmp    $0x3d,%dil
ja     1120 <isDelChar+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x2000600000000000,%rdx
bt     %rcx,%rdx
jae    1120 <isDelChar+0x20>
ret
xor    %eax,%eax
cmp    $0x5f,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isDelChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 45
br i1 %5, label %18, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 46
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 61
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 95
br label %18
18: ; preds = %14, %10, %6, %1
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isDelChar(i8 signext %0) {
switch i8 %0, label %2 [
i8 61, label %5
i8 46, label %5
i8 45, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 95
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
struct value {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct value *value_copy(struct value *);
struct value *id(struct list *args, struct value *in) {
  return value_copy(in);
}


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

x86 assembly (clang, -O2):
<id>:
mov    %rsi,%rdi
jmp    1030 <value_copy@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
%struct.value = type { i32 }
define %struct.value* @id(%struct.list* %0, %struct.value* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.value*
store %struct.list* %0, %struct.list** %3
store %struct.value* %1, %struct.value** %4
%5 = load %struct.value*, %struct.value** %4
%6 = call %struct.value* @value_copy(%struct.value* %5)
ret %struct.value* %6
}

LLVM IR (-O2):
%struct.list = type { i32 }
%struct.value = type { i32 }
define %struct.value* @id(%struct.list* nocapture readnone %0, %struct.value* %1) {
%3 = tail call %struct.value* @value_copy(%struct.value* %1)
ret %struct.value* %3
}
int kvmppc_get_cap_count_cache_flush_assist(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kvmppc_get_cap_count_cache_flush_assist() {
ret i32 0
}
unsigned utility_trie_map(char c) {
  if (c >= 'A' && c <= 'Z')
    return c - 'A';
  else if (c >= 'a' && c <= 'z')
    return c - 'a';
  else
    return 'Z' - 'A' + 1;
}


x86 assembly (clang, -O0):
<utility_trie_map>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <utility_trie_map+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <utility_trie_map+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <utility_trie_map+0x63>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     115c <utility_trie_map+0x5c>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     115c <utility_trie_map+0x5c>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <utility_trie_map+0x63>
movl   $0x1a,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utility_trie_map>:
mov    %edi,%eax
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     110e <utility_trie_map+0xe>
add    $0xffffffbf,%eax
ret
lea    -0x61(%rax),%ecx
add    $0xffffff9f,%eax
cmp    $0x1a,%cl
mov    $0x1a,%ecx
cmovb  %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @utility_trie_map(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 65
store i32 %14, i32* %2
br label %28
15: ; preds = %7, %1
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 97
br i1 %18, label %19, label %27
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 122
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 97
store i32 %26, i32* %2
br label %28
27: ; preds = %19, %15
store i32 26, i32* %2
br label %28
28: ; preds = %27, %23, %11
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @utility_trie_map(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 26
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nsw i32 %2, -65
br label %12
7: ; preds = %1
%8 = add i8 %0, -97
%9 = icmp ult i8 %8, 26
%10 = add nsw i32 %2, -97
%11 = select i1 %9, i32 %10, i32 26
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int __int64_t_encode_array(void *, int, int, int /*<<< orphan*/ *, int);
int __double_encode_array(void *_buf, int offset, int maxlen, const double *p,
                          int elements) {
  return __int64_t_encode_array(_buf, offset, maxlen, (int64_t *)p, elements);
}


x86 assembly (clang, -O0):
<__double_encode_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <__int64_t_encode_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__double_encode_array>:
jmp    1030 <__int64_t_encode_array@plt>

LLVM IR (-O0):
define i32 @__double_encode_array(i8* %0, i32 %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load double*, double** %9
%15 = bitcast double* %14 to i32*
%16 = load i32, i32* %10
%17 = call i32 @__int64_t_encode_array(i8* %11, i32 %12, i32 %13, i32* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @__double_encode_array(i8* %0, i32 %1, i32 %2, double* %3, i32 %4) {
%6 = bitcast double* %3 to i32*
%7 = tail call i32 @__int64_t_encode_array(i8* %0, i32 %1, i32 %2, i32* %6, i32 %4)
ret i32 %7
}
int test_second(int sec2ond2) { return sec2ond2; }


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

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

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

LLVM IR (-O2):
define i32 @test_second(i32 returned %0) {
ret i32 %0
}
int hpd_panel_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hpd_panel_init() {
ret i32 0
}
/* Type definitions */
struct iw_context {
  int dummy;
};

/* Variables and functions */
int iw_get_version_int();
int /*<<< orphan*/ iw_snprintf(char *, int, char *, int, int, int);
char *iw_get_version_string(struct iw_context *ctx, char *s, int s_len) {
  int ver;
  ver = iw_get_version_int();
  iw_snprintf(s, s_len, "%d.%d.%d", (ver & 0xff0000) >> 16, (ver & 0xff00) >> 8,
              (ver & 0xff));
  return s;
}


x86 assembly (clang, -O0):
<iw_get_version_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1040 <iw_get_version_int@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x10,%ecx
mov    -0x18(%rbp),%r8d
and    $0xff00,%r8d
sar    $0x8,%r8d
mov    -0x18(%rbp),%r9d
and    $0xff,%r9d
lea    0xe8f(%rip),%rdx
call   1030 <iw_snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iw_get_version_string>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
xor    %eax,%eax
call   1040 <iw_get_version_int@plt>
movzbl %ah,%ebp
movzbl %al,%r9d
shr    $0x10,%eax
movzbl %al,%ecx
lea    0xebb(%rip),%rdx
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%r8d
call   1030 <iw_snprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.iw_context = type { i32 }
@.str = [9 x i8] c"%d.%d.%d\00"
define i8* @iw_get_version_string(%struct.iw_context* %0, i8* %1, i32 %2) {
%4 = alloca %struct.iw_context*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store %struct.iw_context* %0, %struct.iw_context** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = call i32 (...) @iw_get_version_int()
store i32 %8, i32* %7
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = and i32 %11, 16711680
%13 = ashr i32 %12, 16
%14 = load i32, i32* %7
%15 = and i32 %14, 65280
%16 = ashr i32 %15, 8
%17 = load i32, i32* %7
%18 = and i32 %17, 255
%19 = call i32 @iw_snprintf(i8* %9, i32 %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %16, i32 %18)
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
%struct.iw_context = type { i32 }
@.str = [9 x i8] c"%d.%d.%d\00"
define i8* @iw_get_version_string(%struct.iw_context* nocapture readnone %0, i8* returned %1, i32 %2) {
%4 = tail call i32 (...) @iw_get_version_int()
%5 = lshr i32 %4, 16
%6 = and i32 %5, 255
%7 = lshr i32 %4, 8
%8 = and i32 %7, 255
%9 = and i32 %4, 255
%10 = tail call i32 @iw_snprintf(i8* %1, i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8, i32 %9)
ret i8* %1
}
void emit_type_definition_satisfies(
    struct processor_explicatory_state *process_state,
    struct modern_stream *stream, void *stream_state,
    struct modern_vfile *vfile, void *vfile_state) {}


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

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_satisfies(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_satisfies(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
int __attribute__((unused)) ndigits(int n) {
  int nd = 0;
  if (n < 0) {
    nd = 1;
    n = -n;
  }
  while (n > 0) {
    nd++;
    n = n / 10;
  }
  return nd;
}


x86 assembly (clang, -O0):
<ndigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1127 <ndigits+0x27>
movl   $0x1,-0x8(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112c <ndigits+0x2c>
cmpl   $0x0,-0x4(%rbp)
jle    1152 <ndigits+0x52>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    112c <ndigits+0x2c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndigits>:
test   %edi,%edi
je     1135 <ndigits+0x35>
mov    %edi,%eax
shr    $0x1f,%eax
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    $0xcccccccd,%edx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
cmp    $0x9,%ecx
mov    %esi,%ecx
ja     1120 <ndigits+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ndigits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 31
%5 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
br label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %4, %3 ]
%8 = phi i32 [ %10, %6 ], [ %5, %3 ]
%9 = add nuw nsw i32 %7, 1
%10 = udiv i32 %8, 10
%11 = icmp ult i32 %8, 10
br i1 %11, label %12, label %6
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %9, %6 ]
ret i32 %13
}
void nbr_String(_tot) int *_tot;
{
  int Base_String;
  String_FIRST_FNC_OBJ(_tot, &Base_String);
}


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

x86 assembly (clang, -O2):
<nbr_String>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <String_FIRST_FNC_OBJ@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @nbr_String(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @String_FIRST_FNC_OBJ to i32 (i32*, i32*, ...)*)(i32* %4, i32* %3)
ret void
}

LLVM IR (-O2):
define void @nbr_String(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @String_FIRST_FNC_OBJ to i32 (i32*, i32*, ...)*)(i32* %0, i32* %2)
ret void
}
int test_imm_F2int16_reg(short val) {
  return ((val) & (0xF2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F2int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xf2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F2int16_reg>:
test   $0xf2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F2int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 242
%6 = icmp ne i32 %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_F2int16_reg(i16 signext %0) {
%2 = and i16 %0, 242
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned addval_480(unsigned x) { return x + 2430634304U; }


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

x86 assembly (clang, -O2):
<addval_480>:
lea    -0x6f1f76c0(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addval_480(i32 %0) {
%2 = add i32 %0, -1864332992
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x0c() {
  Assert_real((ispunct(12) == 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_ispunct.c",
              65, ("ispunct should be 0 for 0x0c"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x0c>:
push   %rax
mov    $0xc,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x41,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x0c\00"
define void @t_ispunct_0x0c() {
%1 = call i64 @ispunct(i32 12)
%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 65, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x0c\00"
define void @t_ispunct_0x0c() {
%1 = tail call i64 @ispunct(i32 12)
%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 65, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printusage(void) {
  fprintf(stderr, "Usage: bundlecss [-abv] [-n name] [-o outfile] "
                  "[infile]\n");
}


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

x86 assembly (clang, -O2):
<printusage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: bundlecss [-abv] [-n name] [-o outfile] [infile]\0A\00"
define void @printusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: bundlecss [-abv] [-n name] [-o outfile] [infile]\0A\00"
define void @printusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}