xunge/DecIR huggingface dataset:
unsigned int f11(unsigned int x, int y __attribute__((unused))) {
  return (x << 1) | (x >> (8 * sizeof(unsigned int) - 1));
}


x86 assembly (clang, -O0):
<f11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1f,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f11(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = shl i32 %5, 1
%7 = load i32, i32* %3
%8 = lshr i32 %7, 31
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f11(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %3
}
int digit_to_char(int digit, int is_upper) {
  if (digit < 10)
    return '0' + digit;
  if (is_upper)
    return 'A' + digit - 10;
  else
    return 'a' + digit - 10;
}


x86 assembly (clang, -O0):
<digit_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1122 <digit_to_char+0x22>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <digit_to_char+0x49>
cmpl   $0x0,-0xc(%rbp)
je     113d <digit_to_char+0x3d>
mov    -0x8(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <digit_to_char+0x49>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_to_char>:
xor    %ecx,%ecx
test   %esi,%esi
sete   %cl
shl    $0x5,%ecx
add    $0x37,%ecx
cmp    $0xa,%edi
mov    $0x30,%eax
cmovge %ecx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @digit_to_char(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 slt i32 %6, 10
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = add nsw i32 48, %9
store i32 %10, i32* %3
br label %22
11: ; preds = %2
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %4
%16 = add nsw i32 65, %15
%17 = sub nsw i32 %16, 10
store i32 %17, i32* %3
br label %22
18: ; preds = %11
%19 = load i32, i32* %4
%20 = add nsw i32 97, %19
%21 = sub nsw i32 %20, 10
store i32 %21, i32* %3
br label %22
22: ; preds = %18, %14, %8
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @digit_to_char(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 10
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i32 87, i32 55
%6 = select i1 %3, i32 48, i32 %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
void __gnat_disable_all_sigpipes(void) {}


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

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

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

LLVM IR (-O2):
define void @__gnat_disable_all_sigpipes() {
ret void
}
void __initor_d() { return; }


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

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

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

LLVM IR (-O2):
define void @__initor_d() {
ret void
}
void RTVfsObjFromIoStream(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsObjFromIoStream() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x5b() {
  Assert_real((isbdigit(91) == 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_isbdigit.c",
              460, ("isbdigit should be 0 for ["));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x5b>:
push   %rax
mov    $0x5b,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x1cc,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for [\00"
define void @t_isbdigit_0x5b() {
%1 = call i64 @isbdigit(i32 91)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 460, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for [\00"
define void @t_isbdigit_0x5b() {
%1 = tail call i64 @isbdigit(i32 91)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 460, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float get_base_speed() { return 12.0; }


x86 assembly (clang, -O0):
<get_base_speed>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_base_speed>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @get_base_speed() {
ret float 1.200000e+01
}

LLVM IR (-O2):
define float @get_base_speed() {
ret float 1.200000e+01
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
unsigned int getshort(FILE *fp) {
  int c, c1;
  c = getc(fp);
  c1 = getc(fp);
  return ((unsigned int)c) + (((unsigned int)c1) << 8);
}


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

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

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

LLVM IR (-O2):
define i32 @getshort(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = shl i32 %3, 8
%5 = add i32 %4, %2
ret i32 %5
}
double to_float(char resolution, long fixed_num) {
  return ((double)fixed_num) / (double)(1 << resolution);
}


x86 assembly (clang, -O0):
<to_float>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsbl -0x1(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_float>:
mov    %edi,%ecx
cvtsi2sd %rsi,%xmm0
mov    $0x1,%eax
shl    %cl,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @to_float(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = shl i32 1, %8
%10 = sitofp i32 %9 to double
%11 = fdiv double %6, %10
ret double %11
}

LLVM IR (-O2):
define double @to_float(i8 signext %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = zext i8 %0 to i32
%5 = shl nuw i32 1, %4
%6 = sitofp i32 %5 to double
%7 = fdiv double %3, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void genPassMessage(int status) {
  printf("CHILD PROCESS normally terminated with exit status = %d\n", status);
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"CHILD PROCESS normally terminated with exit status = %d\0A\00"
define void @genPassMessage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"CHILD PROCESS normally terminated with exit status = %d\0A\00"
define void @genPassMessage(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x58() {
  Assert_real((isalpha(88)),
              "/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_isalpha.c",
              445, ("isalpha should be 1 for X"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x58>:
push   %rbp
mov    %rsp,%rbp
mov    $0x58,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1bd,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x58>:
push   %rax
mov    $0x58,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1bd,%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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for X\00"
define void @t_isalpha_0x58() {
%1 = call i32 @isalpha(i32 88)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for X\00"
define void @t_isalpha_0x58() {
%1 = tail call i32 @isalpha(i32 88)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct msqid_ds {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int msgctl(int, int, struct msqid_ds *);
int /*<<< orphan*/ perror(char *);
int Msgctl(int msqid, int cmd, struct msqid_ds *buf) {
  int ret = msgctl(msqid, cmd, buf);
  if (ret < 0) {
    perror("msgctl error");
    exit(0);
  }
  return ret;
}


x86 assembly (clang, -O0):
<Msgctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <msgctl@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1171 <Msgctl+0x41>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Msgctl>:
push   %rax
call   1030 <msgctl@plt>
test   %eax,%eax
js     113c <Msgctl+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
%struct.msqid_ds = type { i32 }
@.str = [13 x i8] c"msgctl error\00"
define i32 @Msgctl(i32 %0, i32 %1, %struct.msqid_ds* %2) {
%4 = tail call i32 @msgctl(i32 %0, i32 %1, %struct.msqid_ds* %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ k_parser_test_parts();
void k_parser_test() { k_parser_test_parts(); }


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

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

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

LLVM IR (-O2):
define void @k_parser_test() {
%1 = tail call i32 (...) @k_parser_test_parts()
ret void
}
/* Variables and functions */
int bar();
int /*<<< orphan*/ foo();
int x(void) {
  foo();
  return bar();
}


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

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

LLVM IR (-O0):
define i32 @x() {
%1 = call i32 (...) @foo()
%2 = call i32 (...) @bar()
ret i32 %2
}

LLVM IR (-O2):
define i32 @x() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @bar()
ret i32 %2
}
void set_italic(int flag) { flag = flag; }


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

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

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

LLVM IR (-O2):
define void @set_italic(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ grow1(int);
void grow(int frame) {
  if (frame >= 2048)
    for (;;)
      getpid();
  grow1(++frame);
}


x86 assembly (clang, -O0):
<grow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x800,-0x4(%rbp)
jl     1149 <grow+0x29>
jmp    113d <grow+0x1d>
mov    $0x0,%al
call   1040 <getpid@plt>
jmp    113d <grow+0x1d>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x4(%rbp)
call   1030 <grow1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grow>:
push   %rax
cmp    $0x800,%edi
jl     1139 <grow+0x19>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getpid@plt>
jmp    1130 <grow+0x10>
add    $0x1,%edi
pop    %rax
jmp    1030 <grow1@plt>

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

LLVM IR (-O2):
define void @grow(i32 %0) {
%2 = icmp sgt i32 %0, 2047
br i1 %2, label %3, label %5
3: ; preds = %1, %3
%4 = tail call i32 (...) @getpid()
br label %3
5: ; preds = %1
%6 = add nsw i32 %0, 1
%7 = tail call i32 @grow1(i32 %6)
ret void
}
void LCDWin_c(void) {}


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

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

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

LLVM IR (-O2):
define void @LCDWin_c() {
ret void
}
int main() {
  char c;
  int i;
  char s[80];
  float x;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca [80 x i8]
%5 = alloca float
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void if_ge(void) { printf("greater or equal\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"greater or equal\0A\00"
define void @if_ge() {
%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"greater or equal\00"
define void @if_ge() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
void xmlvm_init_native_java_lang_Throwable() {}


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

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

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

LLVM IR (-O2):
define void @xmlvm_init_native_java_lang_Throwable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void op_jze() { puts("JZE"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"JZE\00"
define void @op_jze() {
%1 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"JZE\00"
define void @op_jze() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _montimer(int, void *);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_timer(int cmd, void *arg) {
  int ret;
  monLock();
  ret = _montimer(cmd, arg);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <monLock@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <_montimer@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_timer>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <monLock@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <_montimer@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_timer(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i32 (...) @monLock()
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @_montimer(i32 %7, i8* %8)
store i32 %9, i32* %5
%10 = call i32 (...) @monUnlock()
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @mon_timer(i32 %0, i8* %1) {
%3 = tail call i32 (...) @monLock()
%4 = tail call i32 @_montimer(i32 %0, i8* %1)
%5 = tail call i32 (...) @monUnlock()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ iora_loread(int, int, char *, int *);
int iora_buffer_read(int filno, int record_num, char *dest, int *size) {
  iora_loread(filno, record_num, dest, size);
  return (0);
}


x86 assembly (clang, -O0):
<iora_buffer_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <iora_loread@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @iora_buffer_read(i32 %0, i32 %1, i8* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32*, i32** %8
%13 = call i32 @iora_loread(i32 %9, i32 %10, i8* %11, i32* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @iora_buffer_read(i32 %0, i32 %1, i8* %2, i32* %3) {
%5 = tail call i32 @iora_loread(i32 %0, i32 %1, i8* %2, i32* %3)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t seqdiff(uint32_t a, uint32_t b) { return a - b; }


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

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

LLVM IR (-O0):
define i64 @seqdiff(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @seqdiff(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__30__IO__makeOutput();
void Msp430GpioC__7__HplGeneralIO__makeOutput(void) {
  HplMsp430GeneralIOP__30__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__7__HplGeneralIO__makeOutput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__30__IO__makeOutput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ test_function();
int main(void) {
  sleep(1);
  while (1) {
    test_function();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <sleep@plt>
mov    $0x0,%al
call   1040 <test_function@plt>
jmp    1139 <main+0x19>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <sleep@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <test_function@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sleep(i32 1)
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @test_function()
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep(i32 1)
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @test_function()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) { printf("Foo\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c"Foo\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
int strcmp(const char *s1, const char *s2) {
  for (; *s1 == *s2; ++s1, ++s2)
    if (*s1 == '\0')
      return 0;
  return *s1 - *s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1160 <strcmp+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1173 <strcmp+0x73>
jmp    1143 <strcmp+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <strcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %21, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %9, %12
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %3
br label %34
20: ; preds = %14
br label %21
21: ; preds = %20
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %4
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %5
br label %6
26: ; preds = %6
%27 = load i8*, i8** %4
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = load i8*, i8** %5
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = sub nsw i32 %29, %32
store i32 %33, i32* %3
br label %34
34: ; preds = %26, %19
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Type definitions */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
int /*<<< orphan*/ regfree(int /*<<< orphan*/ *);
void free_re(void *v) { regfree((regex_t *)v); }


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

x86 assembly (clang, -O2):
<free_re>:
jmp    1030 <regfree@plt>

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

LLVM IR (-O2):
define void @free_re(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @regfree(i32* %2)
ret void
}
int *fn1() {
  int *r = fn1();
  if (r == (void *)0)
    return r;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
call   1030 <fn1@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <fn1+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i32* @fn1() {
br label %1
1: ; preds = %1, %0
br label %1
}
int unsignedShortCmpFn(const void *p1, const void *p2) {
  unsigned short v1, v2;
  v1 = *((unsigned short *)p1);
  v2 = *((unsigned short *)p2);
  if (v1 == v2)
    return 0;
  return (v1 < v2) ? -1 : +1;
}


x86 assembly (clang, -O0):
<unsignedShortCmpFn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1a(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1c(%rbp)
movzwl -0x1a(%rbp),%eax
movzwl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <unsignedShortCmpFn+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1158 <unsignedShortCmpFn+0x58>
movzwl -0x1a(%rbp),%edx
movzwl -0x1c(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsignedShortCmpFn>:
movzwl (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%ax
setae  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @unsignedShortCmpFn(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i16*
%10 = load i16, i16* %9
store i16 %10, i16* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i16*
%13 = load i16, i16* %12
store i16 %13, i16* %7
%14 = load i16, i16* %6
%15 = zext i16 %14 to i32
%16 = load i16, i16* %7
%17 = zext i16 %16 to i32
%18 = icmp eq i32 %15, %17
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 0, i32* %3
br label %28
20: ; preds = %2
%21 = load i16, i16* %6
%22 = zext i16 %21 to i32
%23 = load i16, i16* %7
%24 = zext i16 %23 to i32
%25 = icmp slt i32 %22, %24
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 -1, i32 1
store i32 %27, i32* %3
br label %28
28: ; preds = %20, %19
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @unsignedShortCmpFn(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i16*
%4 = load i16, i16* %3
%5 = bitcast i8* %1 to i16*
%6 = load i16, i16* %5
%7 = icmp eq i16 %4, %6
%8 = icmp ult i16 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Type definitions */
typedef unsigned char const uint32_t;

/* Variables and functions */
uint32_t get_u32(const unsigned char *addr) {
  return *addr | (*(addr + 1) << 8) | (*(addr + 2) << 16) | (*(addr + 3) << 24);
}


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

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

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

LLVM IR (-O2):
define zeroext i8 @get_u32(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
int sumofsquares(int num) {
  int sum;
  int i;
  for (i = 1, sum = 0; i <= num; ++i)
    sum += i * i;
  return sum;
}


x86 assembly (clang, -O0):
<sumofsquares>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     113c <sumofsquares+0x3c>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <sumofsquares+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumofsquares>:
test   %edi,%edi
jle    112d <sumofsquares+0x2d>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
lea    -0x3(%rdi),%eax
imul   %rcx,%rax
shr    %rax
imul   $0x55555556,%eax,%eax
shr    %rcx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
lea    (%rcx,%rdi,4),%eax
add    $0xfffffffd,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sumofsquares(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %22, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = add nsw i32 %0, -3
%10 = zext i32 %9 to i33
%11 = mul i33 %8, %10
%12 = lshr i33 %11, 1
%13 = trunc i33 %12 to i32
%14 = mul i32 %13, 1431655766
%15 = lshr i33 %8, 1
%16 = trunc i33 %15 to i32
%17 = mul i32 %16, 5
%18 = add i32 %14, %17
%19 = shl i32 %0, 2
%20 = add i32 %18, %19
%21 = add i32 %20, -3
br label %22
22: ; preds = %3, %1
%23 = phi i32 [ 0, %1 ], [ %21, %3 ]
ret i32 %23
}
/* Type definitions */
struct ansiseq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ screen_go(int /*<<< orphan*/, int);
void termop_curdown(struct ansiseq *s) { screen_go(0, 1); }


x86 assembly (clang, -O0):
<termop_curdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <screen_go@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_curdown>:
xor    %edi,%edi
mov    $0x1,%esi
jmp    1030 <screen_go@plt>

LLVM IR (-O0):
%struct.ansiseq = type { i32 }
define void @termop_curdown(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 @screen_go(i32 0, i32 1)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type { i32 }
define void @termop_curdown(%struct.ansiseq* nocapture readnone %0) {
%2 = tail call i32 @screen_go(i32 0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World\n");
  printf("Boooring, only C\n");
  printf("Hey!! this thing works!!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
@.str.1 = [18 x i8] c"Boooring, only C\0A\00"
@.str.2 = [26 x i8] c"Hey!! this thing works!!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
@str.3 = [17 x i8] c"Boooring, only C\00"
@str.4 = [25 x i8] c"Hey!! this thing works!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
void ARGBShuffleRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBShuffleRow_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ comportement_philosophe(int);
int /*<<< orphan*/ fin_tache();
void tache_philosophe4(void) {
  comportement_philosophe(4);
  fin_tache();
}


x86 assembly (clang, -O0):
<tache_philosophe4>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1040 <comportement_philosophe@plt>
mov    $0x0,%al
call   1030 <fin_tache@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tache_philosophe4>:
push   %rax
mov    $0x4,%edi
call   1040 <comportement_philosophe@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <fin_tache@plt>

LLVM IR (-O0):
define void @tache_philosophe4() {
%1 = call i32 @comportement_philosophe(i32 4)
%2 = call i32 (...) @fin_tache()
ret void
}

LLVM IR (-O2):
define void @tache_philosophe4() {
%1 = tail call i32 @comportement_philosophe(i32 4)
%2 = tail call i32 (...) @fin_tache()
ret void
}
unsigned xrop3_226_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T ^ D;
  stk2 = S & stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_226_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_226_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = load i32, i32* %5
%25 = xor i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = and i32 %36, %37
%39 = or i32 %35, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @xrop3_226_1_0(i8 zeroext %0, i8 zeroext %1) {
ret i32 255
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(int);
int /*<<< orphan*/ perror(char *);
void *xmalloc(int n) {
  void *r;
  if ((r = malloc(n)) == NULL) {
    perror("malloc");
    exit(errno);
  }
  return r;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    116b <xmalloc+0x3b>
lea    0xea8(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
@errno = global i32 0
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @errno
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
@errno = global i32 0
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @errno
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime_r(int /*<<< orphan*/ const *, struct tm *);
struct tm *gmtime(const time_t *timer) {
  static struct tm tmbuf;
  return gmtime_r(timer, &tmbuf);
}


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

x86 assembly (clang, -O2):
<gmtime>:
lea    0x2f15(%rip),%rsi
jmp    1030 <gmtime_r@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@gmtime.tmbuf = internal global %struct.tm zeroinitializer
define %struct.tm* @gmtime(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call %struct.tm* @gmtime_r(i32* %3, %struct.tm* @gmtime.tmbuf)
ret %struct.tm* %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@gmtime.tmbuf = internal global %struct.tm zeroinitializer
define %struct.tm* @gmtime(i32* %0) {
%2 = tail call %struct.tm* @gmtime_r(i32* %0, %struct.tm* @gmtime.tmbuf)
ret %struct.tm* %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void doit(bool p) {
  if (p)
    puts("p is true");
  if (!p)
    puts("p is false");
}


x86 assembly (clang, -O0):
<doit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1131 <doit+0x21>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1147 <doit+0x37>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doit>:
test   %edi,%edi
lea    0xef1(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"p is true\00"
@.str.1 = [11 x i8] c"p is false\00"
define void @doit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"p is true\00"
@.str.1 = [11 x i8] c"p is false\00"
define void @doit(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}