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

/* Variables and functions */
int largestRectangleArea(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int nums[] = {2, 1, 5, 6, 2, 3};
  int count = sizeof(nums) / sizeof(*nums);
  printf("%d\n", largestRectangleArea(nums, count));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x6,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <largestRectangleArea@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@__const.main.nums = [6 x i32] [i32 2, i32 1, i32 5, i32 6, i32 2, i32 3]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @largestRectangleArea(i32* %3, i32 6)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
char *mpfr_get_version();
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("%s\n", mpfr_get_version());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @mpfr_get_version()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_get_standard_solution(int idx, int verbose) {
  int fail;
  int pars[2];
  double *c;
  pars[0] = 0;
  pars[1] = idx;
  fail = _ada_use_c2phc4c(863, pars, &verbose, c, 0);
  if (pars[0] != 0)
    fail = pars[0];
  return fail;
}


x86 assembly (clang, -O0):
<padcon_get_standard_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x14(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x35f,%edi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1157 <padcon_get_standard_solution+0x47>
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_get_standard_solution>:
sub    $0x18,%rsp
mov    %esi,0x14(%rsp)
movl   $0x0,0xc(%rsp)
mov    %edi,0x10(%rsp)
lea    0xc(%rsp),%rsi
lea    0x14(%rsp),%rdx
mov    $0x35f,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
cmovne %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @padcon_get_standard_solution(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [2 x i32]
%7 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 0, i32* %8
%9 = load i32, i32* %3
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 %9, i32* %10
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%12 = load double*, double** %7
%13 = call i32 @_ada_use_c2phc4c(i32 863, i32* %11, i32* %4, double* %12, i32 0)
store i32 %13, i32* %5
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%15 = load i32, i32* %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%19 = load i32, i32* %18
store i32 %19, i32* %5
br label %20
20: ; preds = %17, %2
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @padcon_get_standard_solution(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %1, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 0, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %0, i32* %7
%8 = call i32 @_ada_use_c2phc4c(i32 863, i32* %6, i32* %3, double* undef, i32 0)
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i32 %8, i32 %9
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int main() {
  printf("Running ps with system\n");
  system("ps ax &");
  printf("Done.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <system@plt>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <system@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Running ps with system\0A\00"
@.str.1 = [8 x i8] c"ps ax &\00"
@.str.2 = [7 x i8] c"Done.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"ps ax &\00"
@str = [23 x i8] c"Running ps with system\00"
@str.3 = [6 x i8] c"Done.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int MI_return_error();
int MI2_return_error(void) { return MI_return_error(); }


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

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

LLVM IR (-O0):
define i32 @MI2_return_error() {
%1 = call i32 (...) @MI_return_error()
ret i32 %1
}

LLVM IR (-O2):
define i32 @MI2_return_error() {
%1 = tail call i32 (...) @MI_return_error()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_mbuffer(void *s) { free(s); }


x86 assembly (clang, -O0):
<free_mbuffer>:
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):
<free_mbuffer>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_mbuffer(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int svz_pipe_startup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @svz_pipe_startup() {
ret i32 0
}
int conditional(int x, int y, int z) {}


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

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

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

LLVM IR (-O2):
define i32 @conditional(i32 %0, i32 %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
unsigned int bit(int);
unsigned bit_set(unsigned w, int n) { return bit(n) | w; }


x86 assembly (clang, -O0):
<bit_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <bit@plt>
or     -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_set>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <bit@plt>
or     %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @bit_set(i32 %0, i32 %1) {
%3 = tail call i32 @bit(i32 %1)
%4 = or i32 %3, %0
ret i32 %4
}
long getGreatestCommonDenominator(long a, long b) {
  return (a == 0) ? b : getGreatestCommonDenominator(b % a, a);
}


x86 assembly (clang, -O0):
<getGreatestCommonDenominator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1138 <getGreatestCommonDenominator+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <getGreatestCommonDenominator+0x42>
mov    -0x10(%rbp),%rax
cqto
idivq  -0x8(%rbp)
mov    %rdx,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <getGreatestCommonDenominator@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getGreatestCommonDenominator>:
mov    %rsi,%rax
test   %rdi,%rdi
je     1135 <getGreatestCommonDenominator+0x35>
mov    %rdi,%rdx
jmp    111d <getGreatestCommonDenominator+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <getGreatestCommonDenominator+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <getGreatestCommonDenominator+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <getGreatestCommonDenominator+0x15>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @getGreatestCommonDenominator(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 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* %4
br label %15
9: ; preds = %2
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = srem i64 %10, %11
%13 = load i64, i64* %3
%14 = call i64 @getGreatestCommonDenominator(i64 %12, i64 %13)
br label %15
15: ; preds = %9, %7
%16 = phi i64 [ %8, %7 ], [ %14, %9 ]
ret i64 %16
}

LLVM IR (-O2):
define i64 @getGreatestCommonDenominator(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %1, %2 ]
%6 = phi i64 [ %7, %4 ], [ %0, %2 ]
%7 = srem i64 %5, %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %1, %2 ], [ %6, %4 ]
ret i64 %10
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int _asm_get_eflags();
int /*<<< orphan*/ _cli();
int /*<<< orphan*/ _sti();
int SetInts(int enabled) {
  uint64_t flags = _asm_get_eflags();
  if (enabled)
    _sti();
  else
    _cli();
  return (flags & 0x200) != 0;
}


x86 assembly (clang, -O0):
<SetInts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <_asm_get_eflags@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115b <SetInts+0x2b>
mov    $0x0,%al
call   1040 <_sti@plt>
jmp    1162 <SetInts+0x32>
mov    $0x0,%al
call   1050 <_cli@plt>
mov    -0x8(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetInts>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <_asm_get_eflags@plt>
mov    %eax,%ebx
xor    %eax,%eax
test   %ebp,%ebp
je     114b <SetInts+0x1b>
call   1040 <_sti@plt>
jmp    1150 <SetInts+0x20>
call   1050 <_cli@plt>
shr    $0x9,%ebx
and    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @SetInts(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @_asm_get_eflags()
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @_sti()
br label %11
9: ; preds = %1
%10 = call i32 (...) @_cli()
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %3
%13 = and i32 %12, 512
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @SetInts(i32 %0) {
%2 = tail call i32 (...) @_asm_get_eflags()
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @_sti()
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @_cli()
br label %8
8: ; preds = %6, %4
%9 = lshr i32 %2, 9
%10 = and i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int x;
  scanf("%d", &x);
  if (x == 0) {
    printf("Immediate exit.\n");
    exit(0);
  }
  printf("The number was not zero.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    116c <main+0x3c>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
lea    0xea1(%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
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
je     1159 <main+0x29>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [17 x i8] c"Immediate exit.\0A\00"
@.str.2 = [26 x i8] c"The number was not zero.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%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 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %0
%10 = 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 = [3 x i8] c"%d\00"
@str = [25 x i8] c"The number was not zero.\00"
@str.3 = [16 x i8] c"Immediate exit.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%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 eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.3, i64 0, i64 0))
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_store_booke_tsr();
void spr_write_booke_tsr(void *opaque, int sprn) { gen_op_store_booke_tsr(); }


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

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

LLVM IR (-O0):
define void @spr_write_booke_tsr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @gen_op_store_booke_tsr()
ret void
}

LLVM IR (-O2):
define void @spr_write_booke_tsr(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @gen_op_store_booke_tsr()
ret void
}
/* Variables and functions */
int comp_uni(char const *, char const *, int, int);
int comp_date(const char *a, const char *b) {
  return comp_uni(a, b, 100 + 12, 16);
}


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

x86 assembly (clang, -O2):
<comp_date>:
mov    $0x70,%edx
mov    $0x10,%ecx
jmp    1030 <comp_uni@plt>

LLVM IR (-O0):
define i32 @comp_date(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 @comp_uni(i8* %5, i8* %6, i32 112, i32 16)
ret i32 %7
}

LLVM IR (-O2):
define i32 @comp_date(i8* %0, i8* %1) {
%3 = tail call i32 @comp_uni(i8* %0, i8* %1, i32 112, i32 16)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_preparse_packet();
int main(void) {
  test_preparse_packet();
  return 0x00;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_preparse_packet()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_preparse_packet()
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int BMK_GetMilliStart(void) {
  struct timeval tv;
  int nCount;
  gettimeofday(&tv, NULL);
  nCount = (int)(tv.tv_usec / 1000 + (tv.tv_sec & 0xfffff) * 1000);
  return nCount;
}


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

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

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

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @BMK_GetMilliStart() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = and i32 %8, 1048575
%10 = mul nuw nsw i32 %9, 1000
%11 = add nsw i32 %10, %6
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t lfs2_fromle32(uint32_t a) {
  return (((uint8_t *)&a)[0] << 0) | (((uint8_t *)&a)[1] << 8) |
         (((uint8_t *)&a)[2] << 16) | (((uint8_t *)&a)[3] << 24);
}


x86 assembly (clang, -O0):
<lfs2_fromle32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x0,%eax
mov    0x0(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    0x4(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    0x8(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lfs2_fromle32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = getelementptr inbounds i32, i32* %2, i64 0
%4 = load i32, i32* %3
%5 = shl i32 %4, 0
%6 = getelementptr inbounds i32, i32* %2, i64 1
%7 = load i32, i32* %6
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = getelementptr inbounds i32, i32* %2, i64 2
%11 = load i32, i32* %10
%12 = shl i32 %11, 16
%13 = or i32 %9, %12
%14 = getelementptr inbounds i32, i32* %2, i64 3
%15 = load i32, i32* %14
%16 = shl i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @lfs2_fromle32(i32 %0) {
ret i32 poison
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int stat(char const *, struct stat *);
long get_num_records(const char *file, int size) {
  struct stat st;
  if (stat(file, &st) == -1)
    return 0;
  return (st.st_size / size);
}


x86 assembly (clang, -O0):
<get_num_records>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    1142 <get_num_records+0x32>
movq   $0x0,-0x8(%rbp)
jmp    114f <get_num_records+0x3f>
mov    -0x18(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_records>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1131 <get_num_records+0x21>
mov    0x8(%rsp),%eax
cltd
idiv   %ebx
cltq
jmp    1133 <get_num_records+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i64 @get_num_records(i8* %0, i32 %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.stat
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = call i32 @stat(i8* %7, %struct.stat* %6)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %2
store i64 0, i64* %3
br label %17
11: ; preds = %2
%12 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load i32, i32* %5
%15 = sdiv i32 %13, %14
%16 = sext i32 %15 to i64
store i64 %16, i64* %3
br label %17
17: ; preds = %11, %10
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i64 @get_num_records(i8* nocapture %0, i32 %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = call i32 @stat(i8* %0, %struct.stat* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%9 = load i32, i32* %8
%10 = sdiv i32 %9, %1
%11 = sext i32 %10 to i64
br label %12
12: ; preds = %2, %7
%13 = phi i64 [ %11, %7 ], [ 0, %2 ]
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ repeat(char *, int);
void spaces(int number) { repeat(" ", number); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @spaces(i32 %0) {
%2 = tail call i32 @repeat(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t ror64(uint64_t v, uint64_t s) { return (v >> s) | (v << (64 - s)); }


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

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

LLVM IR (-O0):
define i32 @ror64(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 = ashr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub nsw i32 64, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ror64(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
%4 = sub nsw i32 64, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
void yydestruct(const char *yymsg, int yytype, int64_t *yyvaluep) {
  ((void)(yyvaluep));
  if (!yymsg)
    yymsg = "Deleting";
  ;
  switch (yytype) {
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<yydestruct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1125 <yydestruct+0x25>
lea    0xedf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112a <yydestruct+0x2a>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @yydestruct(i8* nocapture %0, i32 %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(char *, char const *, int);
int strlen(char const *);
int starts_with(char *string, const char *start, char **arg) {
  if (arg)
    *arg = string + strlen(start);
  return !memcmp(string, start, strlen(start));
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <starts_with+0x40>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rcx
cltq
add    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
call   1040 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
test   %rdx,%rdx
je     1143 <starts_with+0x23>
mov    %rdx,%r15
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
add    %r14,%rax
mov    %rax,(%r15)
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @starts_with(i8* %0, i8* %1, i8** writeonly %2) {
%4 = icmp eq i8** %2, null
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = tail call i32 @strlen(i8* %1)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8* %8, i8** %2
br label %9
9: ; preds = %5, %3
%10 = tail call i32 @strlen(i8* %1)
%11 = tail call i32 @memcmp(i8* %0, i8* %1, i32 %10)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}
cvtimage(buffer) register int buffer[];
{
  cvtshorts(buffer, 12);
  cvtints(buffer + 3, 12);
  cvtints(buffer + 26, 4);
}


x86 assembly (clang, -O0):
<cvtimage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xc,%esi
mov    $0x0,%al
call   1040 <cvtshorts@plt>
mov    -0x10(%rbp),%rdi
add    $0xc,%rdi
mov    $0xc,%esi
mov    $0x0,%al
call   1030 <cvtints@plt>
mov    -0x10(%rbp),%rdi
add    $0x68,%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <cvtints@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvtimage>:
push   %rbx
mov    %rdi,%rbx
mov    $0xc,%esi
xor    %eax,%eax
call   1040 <cvtshorts@plt>
lea    0xc(%rbx),%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1030 <cvtints@plt>
add    $0x68,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <cvtints@plt>

LLVM IR (-O0):
define i32 @cvtimage(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @cvtshorts to i32 (i32*, i32, ...)*)(i32* %4, i32 12)
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 3
%8 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @cvtints to i32 (i32*, i32, ...)*)(i32* %7, i32 12)
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 26
%11 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @cvtints to i32 (i32*, i32, ...)*)(i32* %10, i32 4)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @cvtimage(i32* %0) {
%2 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @cvtshorts to i32 (i32*, i32, ...)*)(i32* %0, i32 12)
%3 = getelementptr inbounds i32, i32* %0, i64 3
%4 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @cvtints to i32 (i32*, i32, ...)*)(i32* %3, i32 12)
%5 = getelementptr inbounds i32, i32* %0, i64 26
%6 = tail call i32 (i32*, i32, ...) bitcast (i32 (...)* @cvtints to i32 (i32*, i32, ...)*)(i32* %5, i32 4)
ret i32 undef
}
char *role_select(void) {
  return "role,folder_count_yn,override_row_restrictions_yn";
}


x86 assembly (clang, -O0):
<role_select>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<role_select>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [50 x i8] c"role,folder_count_yn,override_row_restrictions_yn\00"
define i8* @role_select() {
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [50 x i8] c"role,folder_count_yn,override_row_restrictions_yn\00"
define i8* @role_select() {
ret i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0)
}
int h(int x) {
  x += 0x7fffffff;
  x += 1;
  return x;
}


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

x86 assembly (clang, -O2):
<h>:
mov    %edi,%eax
xor    $0x80000000,%eax
ret

LLVM IR (-O0):
define i32 @h(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2147483647
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @h(i32 %0) {
%2 = xor i32 %0, -2147483648
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ outstring_1char(char);
void outstring(int append_newline, const char *s) {
  char c;
  while ((c = *s) != '\0') {
    ++s;
    outstring_1char(c);
  }
  if (append_newline)
    outstring_1char('\n');
}


x86 assembly (clang, -O0):
<outstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     114e <outstring+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
movsbl -0x11(%rbp),%edi
call   1030 <outstring_1char@plt>
jmp    111f <outstring+0xf>
cmpl   $0x0,-0x4(%rbp)
je     1162 <outstring+0x52>
mov    $0xa,%edi
call   1030 <outstring_1char@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outstring>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    (%rsi),%al
test   %al,%al
je     1143 <outstring+0x33>
mov    %rsi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
call   1030 <outstring_1char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <outstring+0x20>
test   %ebp,%ebp
je     1157 <outstring+0x47>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outstring_1char@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @outstring(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %10, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i32 @outstring_1char(i8 signext %6)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = icmp eq i32 %0, 0
br i1 %13, label %16, label %14
14: ; preds = %12
%15 = tail call i32 @outstring_1char(i8 signext 10)
br label %16
16: ; preds = %14, %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void ckd_free_2d(void **ptr) {
  free(ptr[0]);
  free(ptr);
}


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

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

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

LLVM IR (-O2):
define void @ckd_free_2d(i8** nocapture %0) {
%2 = bitcast i8** %0 to i8***
%3 = load i8**, i8*** %2
%4 = tail call i32 @free(i8** %3)
%5 = tail call i32 @free(i8** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ crash();
char *strdup(char const *);
int /*<<< orphan*/ warnx(char *);
char *xstrdup(const char *str) {
  char *p;
  if ((p = strdup(str)) == NULL) {
    warnx("strdup failed");
    crash();
  }
  return (p);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1166 <xstrdup+0x36>
lea    0xea6(%rip),%rdi
call   1040 <warnx@plt>
mov    $0x0,%al
call   1030 <crash@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1050 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1151 <xstrdup+0x21>
lea    0xebb(%rip),%rdi
call   1040 <warnx@plt>
xor    %eax,%eax
call   1030 <crash@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"strdup failed\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @warnx(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @crash()
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"strdup failed\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @warnx(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @crash()
br label %7
7: ; preds = %4, %1
ret i8* %2
}
void nseel_asm_exec2_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_exec2_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Mali_WrReg(int, int, int, int);
int /*<<< orphan*/ printk(char *);
void Mali_clear_and_set_masks_for_job_irq(void) {
  printk("Clear the JOB IRQ flags\n");
  Mali_WrReg(0x20, 0x0, 0x1004, 0xFFFFFFFF);
  printk("Set the JOB IRQ Mask to all 1s\n");
  Mali_WrReg(0x20, 0x0, 0x1008, 0xFFFFFFFF);
}


x86 assembly (clang, -O0):
<Mali_clear_and_set_masks_for_job_irq>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printk@plt>
mov    $0x20,%edi
xor    %esi,%esi
mov    $0x1004,%edx
mov    $0xffffffff,%ecx
call   1040 <Mali_WrReg@plt>
lea    0xecc(%rip),%rdi
call   1030 <printk@plt>
mov    $0x20,%edi
xor    %esi,%esi
mov    $0x1008,%edx
mov    $0xffffffff,%ecx
call   1040 <Mali_WrReg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mali_clear_and_set_masks_for_job_irq>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printk@plt>
mov    $0x20,%edi
xor    %esi,%esi
mov    $0x1004,%edx
mov    $0xffffffff,%ecx
call   1040 <Mali_WrReg@plt>
lea    0xecf(%rip),%rdi
call   1030 <printk@plt>
mov    $0x20,%edi
xor    %esi,%esi
mov    $0x1008,%edx
mov    $0xffffffff,%ecx
pop    %rax
jmp    1040 <Mali_WrReg@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Clear the JOB IRQ flags\0A\00"
@.str.1 = [32 x i8] c"Set the JOB IRQ Mask to all 1s\0A\00"
define void @Mali_clear_and_set_masks_for_job_irq() {
%1 = call i32 @printk(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @Mali_WrReg(i32 32, i32 0, i32 4100, i32 -1)
%3 = call i32 @printk(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @Mali_WrReg(i32 32, i32 0, i32 4104, i32 -1)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Clear the JOB IRQ flags\0A\00"
@.str.1 = [32 x i8] c"Set the JOB IRQ Mask to all 1s\0A\00"
define void @Mali_clear_and_set_masks_for_job_irq() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @Mali_WrReg(i32 32, i32 0, i32 4100, i32 -1)
%3 = tail call i32 @printk(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @Mali_WrReg(i32 32, i32 0, i32 4104, i32 -1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void stop_motor(uint8_t number) {}


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

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

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

LLVM IR (-O2):
define void @stop_motor(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ write(int, char *, int);
void _Unwind_GetTextRelBase() {
  char msg[] = "Aborting: "
               "_Unwind_GetTextRelBase"
               " called "
               "(C++ exception handling is disabled)\n";
  write(2, msg, sizeof(msg) - 1);
  abort();
}


x86 assembly (clang, -O0):
<_Unwind_GetTextRelBase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x4e,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rsi
mov    $0x2,%edi
mov    $0x4d,%edx
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_Unwind_GetTextRelBase>:
sub    $0x58,%rsp
movups 0xf13(%rip),%xmm0
movups %xmm0,0x3e(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edi
mov    $0x4d,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const._Unwind_GetTextRelBase.msg = [78 x i8] c"Aborting: _Unwind_GetTextRelBase called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_GetTextRelBase() {
%1 = alloca [78 x i8]
%2 = bitcast [78 x i8]* %1 to i8*
%3 = getelementptr inbounds [78 x i8], [78 x i8]* %1, i64 0, i64 0
%4 = call i32 @write(i32 2, i8* %3, i32 77)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@__const._Unwind_GetTextRelBase.msg = [78 x i8] c"Aborting: _Unwind_GetTextRelBase called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_GetTextRelBase() {
%1 = alloca [78 x i8]
%2 = getelementptr inbounds [78 x i8], [78 x i8]* %1, i64 0, i64 0
%3 = call i32 @write(i32 2, i8* %2, i32 77)
%4 = tail call i32 (...) @abort()
unreachable
}
void __asan_report_load1() {}


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

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

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

LLVM IR (-O2):
define void @__asan_report_load1() {
ret void
}
/* Type definitions */
struct stat {
  long st_size;
};

/* Variables and functions */
int stat(char *, struct stat *);
long _GetFileSize(char *filename) {
  struct stat stat_buf;
  int ret;
  ret = stat(filename, &stat_buf);
  if (ret == -1)
    return -1;
  return stat_buf.st_size;
}


x86 assembly (clang, -O0):
<_GetFileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    1143 <_GetFileSize+0x33>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    114b <_GetFileSize+0x3b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_GetFileSize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %eax,%ecx
mov    $0xffffffffffffffff,%rax
cmp    $0xffffffff,%ecx
je     112b <_GetFileSize+0x1b>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @_GetFileSize(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %1
store i64 -1, i64* %2
br label %14
11: ; preds = %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%13 = load i64, i64* %12
store i64 %13, i64* %2
br label %14
14: ; preds = %11, %10
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @_GetFileSize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = select i1 %5, i64 -1, i64 %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ drawSquare(int, int);
int /*<<< orphan*/ glColor3f(int, int, int);
void drawYellowSquare(int posx, int posy) {
  glColor3f(1, 1, 0);
  drawSquare(posx, posy);
  glColor3f(1, 1, 1);
}


x86 assembly (clang, -O0):
<drawYellowSquare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1030 <glColor3f@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <drawSquare@plt>
mov    $0x1,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <glColor3f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawYellowSquare>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x1,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <glColor3f@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <drawSquare@plt>
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <glColor3f@plt>

LLVM IR (-O0):
define void @drawYellowSquare(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @glColor3f(i32 1, i32 1, i32 0)
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @drawSquare(i32 %6, i32 %7)
%9 = call i32 @glColor3f(i32 1, i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @drawYellowSquare(i32 %0, i32 %1) {
%3 = tail call i32 @glColor3f(i32 1, i32 1, i32 0)
%4 = tail call i32 @drawSquare(i32 %0, i32 %1)
%5 = tail call i32 @glColor3f(i32 1, i32 1, i32 1)
ret void
}