xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeLPC(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000002);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000066, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeLPC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x66,%edx
mov    $0x8,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeLPC>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x66,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeLPC(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @GPIODirModeSet(i32 %5, i32 %6, i32 2)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @GPIOPadConfigSet(i32 %8, i32 %9, i32 102, i32 8)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeLPC(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 102, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EOR_();
int /*<<< orphan*/ c64_memZeroX();
void EOR_zpx(void) {
  c64_memZeroX();
  EOR_();
}


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

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

LLVM IR (-O0):
define void @EOR_zpx() {
%1 = call i32 (...) @c64_memZeroX()
%2 = call i32 (...) @EOR_()
ret void
}

LLVM IR (-O2):
define void @EOR_zpx() {
%1 = tail call i32 (...) @c64_memZeroX()
%2 = tail call i32 (...) @EOR_()
ret void
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int stringcompare(const char *s1, const char *s2) { return strcasecmp(s1, s2); }


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

x86 assembly (clang, -O2):
<stringcompare>:
jmp    1030 <strcasecmp@plt>

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

LLVM IR (-O2):
define i32 @stringcompare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
void *Malloc(size_t size) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @Malloc(i64 %0) {
ret i8* undef
}
/* Variables and functions */
int SIGRTMAX;
int SIGRTMIN;
int rand();
int getRandomSignal() {
  int lo = SIGRTMIN + 1;
  int hi = SIGRTMAX - 1;
  int diff = hi - lo;
  int rnd = rand() % (diff + 1);
  int ret = lo + rnd;
  return ret;
}


x86 assembly (clang, -O0):
<getRandomSignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomSignal>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ebe(%rip),%rax
mov    (%rax),%ebx
mov    0x2ebd(%rip),%rax
mov    %ebx,%ebp
not    %ebp
add    (%rax),%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
lea    (%rbx,%rdx,1),%eax
add    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SIGRTMIN = global i32 0
@SIGRTMAX = global i32 0
define i32 @getRandomSignal() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = load i32, i32* @SIGRTMIN
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
%8 = load i32, i32* @SIGRTMAX
%9 = sub nsw i32 %8, 1
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* %1
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %3
%13 = call i32 (...) @rand()
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
%16 = srem i32 %13, %15
store i32 %16, i32* %4
%17 = load i32, i32* %1
%18 = load i32, i32* %4
%19 = add nsw i32 %17, %18
store i32 %19, i32* %5
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@SIGRTMIN = global i32 0
@SIGRTMAX = global i32 0
define i32 @getRandomSignal() {
%1 = load i32, i32* @SIGRTMIN
%2 = add nsw i32 %1, 1
%3 = load i32, i32* @SIGRTMAX
%4 = tail call i32 (...) @rand()
%5 = xor i32 %1, -1
%6 = add i32 %3, %5
%7 = srem i32 %4, %6
%8 = add nsw i32 %2, %7
ret i32 %8
}
void gtk_container_child_set() {}


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

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

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

LLVM IR (-O2):
define void @gtk_container_child_set() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xb7() {
  Assert_real((isupper(183) == 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_isupper.c",
              920, ("isupper should be 0 for 0xb7"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xb7>:
push   %rax
mov    $0xb7,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x398,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xb7\00"
define void @t_isupper_0xb7() {
%1 = call i64 @isupper(i32 183)
%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 920, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xb7\00"
define void @t_isupper_0xb7() {
%1 = tail call i64 @isupper(i32 183)
%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 920, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_0Cuint16_reg(unsigned short val) {
  return ((val) & (0x0C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Cuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 12
%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_0Cuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 12
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void DBGFR3RegNmQueryAllCount(void) {}


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

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

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

LLVM IR (-O2):
define void @DBGFR3RegNmQueryAllCount() {
ret void
}
void ggscan_(scan_no, feed_no, record, return_code) int *scan_no, *feed_no,
    *record, *return_code;
{}


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

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

LLVM IR (-O0):
define void @ggscan_(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
ret void
}

LLVM IR (-O2):
define void @ggscan_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n = 0;
  scanf("%d", &n);
  printf("%d\n", n >> 2 ? n - 2 : 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
sar    $0x2,%eax
cmp    $0x0,%eax
je     1163 <main+0x43>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1170 <main+0x50>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1170 <main+0x50>
mov    -0xc(%rbp),%esi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    -0x2(%rax),%ecx
cmp    $0x4,%eax
mov    $0x1,%esi
cmovae %ecx,%esi
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = ashr i32 %4, 2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 2
br label %11
10: ; preds = %0
br label %11
11: ; preds = %10, %7
%12 = phi i32 [ %9, %7 ], [ 1, %10 ]
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp ult i32 %4, 4
%6 = add nsw i32 %4, -2
%7 = select i1 %5, i32 1, i32 %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
float __ocml_exp10_f32(float);
float __exp10f(float x) { return __ocml_exp10_f32(x); }


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

x86 assembly (clang, -O2):
<__exp10f>:
jmp    1030 <__ocml_exp10_f32@plt>

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

LLVM IR (-O2):
define float @__exp10f(float %0) {
%2 = tail call float @__ocml_exp10_f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ gmx_densmap(int, char **);
int main(int argc, char *argv[]) {
  gmx_densmap(argc, argv);
  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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_densmap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @gmx_densmap(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_densmap(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int best_position(int *, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ read_file(char *);
int main(void) {
  read_file("input.txt");
  int x, y;
  int bestcount = best_position(&x, &y);
  printf("x: %d\n"
         "y: %d\n"
         "count:%d\n",
         x, y, bestcount);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <read_file@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <best_position@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <read_file@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1050 <best_position@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb2(%rip),%rdi
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [22 x i8] c"x: %d\0Ay: %d\0Acount:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @read_file(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @best_position(i32* %2, i32* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [22 x i8] c"x: %d\0Ay: %d\0Acount:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 @read_file(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = call i32 @best_position(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8, i32 %6)
ret i32 0
}
void gettypemsg(char *header, char *type) {
  int i = 0;
  while (header[i] != ' ' && i < 3000) {
    type[i] = header[i];
    i++;
  }
  type[i] = '\0';
}


x86 assembly (clang, -O0):
<gettypemsg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x15(%rbp)
je     113a <gettypemsg+0x3a>
cmpl   $0xbb8,-0x14(%rbp)
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114a <gettypemsg+0x4a>
jmp    116e <gettypemsg+0x6e>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <gettypemsg+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettypemsg>:
mov    (%rdi),%al
cmp    $0x20,%al
jne    110d <gettypemsg+0xd>
xor    %ecx,%ecx
movb   $0x0,(%rsi,%rcx,1)
ret
xor    %edx,%edx
nop
mov    %al,(%rsi,%rdx,1)
lea    0x1(%rdx),%rcx
movzbl 0x1(%rdi,%rdx,1),%eax
cmp    $0x20,%al
je     112c <gettypemsg+0x2c>
cmp    $0xbb7,%rdx
mov    %rcx,%rdx
jb     1110 <gettypemsg+0x10>
movb   $0x0,(%rsi,%rcx,1)
ret

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

LLVM IR (-O2):
define void @gettypemsg(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 32
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 32
%13 = icmp ult i64 %6, 2999
%14 = select i1 %12, i1 %13, i1 false
br i1 %14, label %5, label %15
15: ; preds = %5, %2
%16 = phi i64 [ 0, %2 ], [ %9, %5 ]
%17 = getelementptr inbounds i8, i8* %1, i64 %16
store i8 0, i8* %17
ret void
}
int testItemAddress(const void *item, void *data) { return item == data; }


x86 assembly (clang, -O0):
<testItemAddress>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testItemAddress>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @testItemAddress(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @testItemAddress(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned xrop3_30_0_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;
  stk2 = D | S;
  stk1 = T ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_30_0_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    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_30_0_0>:
shl    $0x8,%edi
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
lea    0xff(%rdi),%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_30_0_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
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
ret i32 %28
}

LLVM IR (-O2):
define i32 @xrop3_30_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %4, 255
%8 = xor i32 %6, %7
ret i32 %8
}
/* Variables and functions */
char *s_let(char *, char *);
char *maccbracket(char *arg) { return (s_let(")", arg)); }


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

x86 assembly (clang, -O2):
<maccbracket>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <s_let@plt>

LLVM IR (-O0):
@.str = [2 x i8] c")\00"
define i8* @maccbracket(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @s_let(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [2 x i8] c")\00"
define i8* @maccbracket(i8* %0) {
%2 = tail call i8* @s_let(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
void test_09(unsigned char *x, unsigned char *y) {
  x[1] = y[1];
  x[2] = y[2];
}


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

x86 assembly (clang, -O2):
<test_09>:
mov    0x1(%rsi),%al
mov    %al,0x1(%rdi)
mov    0x2(%rsi),%al
mov    %al,0x2(%rdi)
ret

LLVM IR (-O0):
define void @test_09(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %7, i8* %9
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 2
%12 = load i8, i8* %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 2
store i8 %12, i8* %14
ret void
}

LLVM IR (-O2):
define void @test_09(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %5
%6 = getelementptr inbounds i8, i8* %1, i64 2
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %8
ret void
}
/* Variables and functions */
float tanf(float const);
void glmTan3f(float out[3], const float angle[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = tanf(angle[i]);
}


x86 assembly (clang, -O0):
<glmTan3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    1163 <glmTan3f+0x53>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <tanf@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <glmTan3f+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmTan3f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
call   1030 <tanf@plt>
movss  %xmm0,(%r14)
movss  0x4(%rbx),%xmm0
call   1030 <tanf@plt>
movss  %xmm0,0x4(%r14)
movss  0x8(%rbx),%xmm0
call   1030 <tanf@plt>
movss  %xmm0,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @glmTan3f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i64
store float* %0, float** %3
store float* %1, float** %4
store i64 0, i64* %5
br label %6
6: ; preds = %18, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 3
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load float*, float** %4
%11 = load i64, i64* %5
%12 = getelementptr inbounds float, float* %10, i64 %11
%13 = load float, float* %12
%14 = call float @tanf(float %13)
%15 = load float*, float** %3
%16 = load i64, i64* %5
%17 = getelementptr inbounds float, float* %15, i64 %16
store float %14, float* %17
br label %18
18: ; preds = %9
%19 = load i64, i64* %5
%20 = add i64 %19, 1
store i64 %20, i64* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @glmTan3f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @tanf(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @tanf(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = tail call float @tanf(float %10)
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void testcode(void) { sleep(3); }


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

x86 assembly (clang, -O2):
<testcode>:
mov    $0x3,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @testcode() {
%1 = call i32 @sleep(i32 3)
ret void
}

LLVM IR (-O2):
define void @testcode() {
%1 = tail call i32 @sleep(i32 3)
ret void
}
/* Variables and functions */
void *malloc(unsigned int);
int /*<<< orphan*/ u_fatal(char *);
void *u_malloc(unsigned int size) {
  void *addr;
  if (!size)
    return 0;
  addr = malloc(size);
  if (!addr)
    u_fatal("memory allocation failure, aborting.");
  return addr;
}


x86 assembly (clang, -O0):
<u_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1142 <u_malloc+0x22>
movq   $0x0,-0x8(%rbp)
jmp    116d <u_malloc+0x4d>
mov    -0xc(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1165 <u_malloc+0x45>
lea    0xea0(%rip),%rdi
call   1040 <u_fatal@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_malloc>:
push   %rax
test   %edi,%edi
je     113d <u_malloc+0x1d>
call   1030 <malloc@plt>
test   %rax,%rax
je     1131 <u_malloc+0x11>
pop    %rcx
ret
lea    0xec8(%rip),%rdi
call   1040 <u_fatal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"memory allocation failure, aborting.\00"
define i8* @u_malloc(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* null, i8** %2
br label %17
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %15, label %13
13: ; preds = %8
%14 = call i32 @u_fatal(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %15, %7
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [37 x i8] c"memory allocation failure, aborting.\00"
define noalias i8* @u_malloc(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i32 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @u_fatal(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6, %1
%9 = phi i8* [ null, %1 ], [ null, %6 ], [ %4, %3 ]
ret i8* %9
}
void ff_hevc_put_hevc_pel_pixels64_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels64_10_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(unsigned char);
bool isonlyspace(char *str) {
  while (*str != '\0') {
    if (!isspace((unsigned char)*str)) {
      return false;
    }
    str++;
  }
  return true;
}


x86 assembly (clang, -O0):
<isonlyspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115e <isonlyspace+0x4e>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    114d <isonlyspace+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1165 <isonlyspace+0x55>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <isonlyspace+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isonlyspace>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <isonlyspace+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1149 <isonlyspace+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isonlyspace+0x20>
jmp    114b <isonlyspace+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isonlyspace(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %15, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call i32 @isspace(i8 zeroext %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %9
store i32 0, i32* %2
br label %19
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
br label %4
18: ; preds = %4
store i32 1, i32* %2
br label %19
19: ; preds = %18, %14
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @isonlyspace(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isspace(i8 zeroext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
char tolower(char);
char *lower(char *s) {
  char *c = s;
  for (c = s; *c; c++) {
    *c = tolower(*c);
  }
  return s;
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115e <lower+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <lower+0x1c>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <lower+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <lower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @lower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void imprime_vetor(int vetor[], int N) {
  int i;
  for (i = 0; i < N; i++)
    printf("%d\t", vetor[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<imprime_vetor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <imprime_vetor+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <imprime_vetor+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprime_vetor>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <imprime_vetor+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <imprime_vetor+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @imprime_vetor(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
struct groups_iter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct groups_iter *);
void groups_iter_free(struct groups_iter *it) { free(it); }


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

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

LLVM IR (-O0):
%struct.groups_iter = type { i32 }
define void @groups_iter_free(%struct.groups_iter* %0) {
%2 = alloca %struct.groups_iter*
store %struct.groups_iter* %0, %struct.groups_iter** %2
%3 = load %struct.groups_iter*, %struct.groups_iter** %2
%4 = call i32 @free(%struct.groups_iter* %3)
ret void
}

LLVM IR (-O2):
%struct.groups_iter = type { i32 }
define void @groups_iter_free(%struct.groups_iter* nocapture %0) {
%2 = tail call i32 @free(%struct.groups_iter* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ terminal_putchar(int /*<<< orphan*/);
void terminal_writestring(const char *data) {
  while (*data)
    terminal_putchar(*data++);
}


x86 assembly (clang, -O0):
<terminal_writestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <terminal_writestring+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <terminal_putchar@plt>
jmp    111c <terminal_writestring+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_writestring>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <terminal_writestring+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <terminal_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <terminal_writestring+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @terminal_writestring(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @terminal_putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dup2(int, int);
int open(char *, int, int /*<<< orphan*/);
int redirect_std_fds(char *filepath, int flags) {
  int fd = 0;
  int retval = -1;
  if ((fd = open(filepath, flags, 0)) != -1) {
    dup2(fd, 0);
    dup2(fd, 1);
    dup2(fd, 2);
    retval = 0;
  }
  return retval;
}


x86 assembly (clang, -O0):
<redirect_std_fds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
cmp    $0xffffffff,%eax
je     1182 <redirect_std_fds+0x62>
mov    -0x10(%rbp),%edi
xor    %esi,%esi
call   1030 <dup2@plt>
mov    -0x10(%rbp),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    -0x10(%rbp),%edi
mov    $0x2,%esi
call   1030 <dup2@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redirect_std_fds>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %edx,%edx
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     1156 <redirect_std_fds+0x36>
mov    %eax,%ebp
mov    %eax,%edi
xor    %esi,%esi
call   1030 <dup2@plt>
mov    %ebp,%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    %ebp,%edi
mov    $0x2,%esi
call   1030 <dup2@plt>
jmp    115b <redirect_std_fds+0x3b>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @redirect_std_fds(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @dup2(i32 %3, i32 0)
%7 = tail call i32 @dup2(i32 %3, i32 1)
%8 = tail call i32 @dup2(i32 %3, i32 2)
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
char *strchr(char *, char);
int remove_eol(char *string) {
  char *new_line_position = strchr(string, '\n');
  if (new_line_position != NULL) {
    *new_line_position = '\0';
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<remove_eol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <remove_eol+0x3c>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1153 <remove_eol+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_eol>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     112a <remove_eol+0x1a>
movb   $0x0,(%rax)
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @remove_eol(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %1, %4
%6 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %6
}
void EFlash_ErasePage(unsigned int waddr) {
  *(volatile unsigned int *)(0x40009000 + 0x028) = waddr;
  ;
  *(volatile unsigned int *)(0x40009000 + 0x014) = (1 << 2);
  ;
  while ((*(volatile unsigned int *)(0x40009000 + 0x018) & 1) == 1)
    ;
}


x86 assembly (clang, -O0):
<EFlash_ErasePage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x40009028,%eax
mov    %ecx,(%rax)
mov    $0x40009014,%eax
movl   $0x4,(%rax)
mov    $0x40009018,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1134 <EFlash_ErasePage+0x34>
jmp    111c <EFlash_ErasePage+0x1c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EFlash_ErasePage>:
mov    %edi,0x40009028
movl   $0x4,0x40009014
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x40009018,%eax
test   $0x1,%al
jne    1120 <EFlash_ErasePage+0x20>
ret

LLVM IR (-O0):
define void @EFlash_ErasePage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store volatile i32 %3, i32* inttoptr (i64 1073778728 to i32*)
store volatile i32 4, i32* inttoptr (i64 1073778708 to i32*)
br label %4
4: ; preds = %8, %1
%5 = load volatile i32, i32* inttoptr (i64 1073778712 to i32*)
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %4
br label %4
9: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @EFlash_ErasePage(i32 %0) {
store volatile i32 %0, i32* inttoptr (i64 1073778728 to i32*)
store volatile i32 4, i32* inttoptr (i64 1073778708 to i32*)
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 1073778712 to i32*)
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hash_rot(uint32_t x, int k) { return (x << k) | (x >> (32 - k)); }


x86 assembly (clang, -O0):
<hash_rot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_rot>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @hash_rot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 32, %9
%11 = ashr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @hash_rot(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub nsw i32 32, %1
%5 = ashr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int foo(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) { printf("%d\n", foo(argc)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <foo@plt>
mov    %eax,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}