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

/* Variables and functions */
int /*<<< orphan*/ getgid();
void test(void) {
  gid_t gid;
  gid = getgid();
}


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

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

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = call i32 (...) @getgid()
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 (...) @getgid()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ allot_float(int /*<<< orphan*/);
int /*<<< orphan*/ dpeek();
int /*<<< orphan*/ drepl(int /*<<< orphan*/);
int /*<<< orphan*/ fixnum_to_float(int /*<<< orphan*/);
void primitive_fixnum_to_float(void) {
  drepl(allot_float(fixnum_to_float(dpeek())));
}


x86 assembly (clang, -O0):
<primitive_fixnum_to_float>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1050 <fixnum_to_float@plt>
mov    %eax,%edi
call   1060 <allot_float@plt>
mov    %eax,%edi
call   1040 <drepl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_fixnum_to_float>:
push   %rax
xor    %eax,%eax
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1050 <fixnum_to_float@plt>
mov    %eax,%edi
call   1060 <allot_float@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <drepl@plt>

LLVM IR (-O0):
define void @primitive_fixnum_to_float() {
%1 = call i32 (...) @dpeek()
%2 = call i32 @fixnum_to_float(i32 %1)
%3 = call i32 @allot_float(i32 %2)
%4 = call i32 @drepl(i32 %3)
ret void
}

LLVM IR (-O2):
define void @primitive_fixnum_to_float() {
%1 = tail call i32 (...) @dpeek()
%2 = tail call i32 @fixnum_to_float(i32 %1)
%3 = tail call i32 @allot_float(i32 %2)
%4 = tail call i32 @drepl(i32 %3)
ret void
}
int willusgui_file_select_dialogw(short *buf, int maxlen, char *allowedfiles,
                                  char *prompt, char *defext, int for_writing) {
  return (0);
}


x86 assembly (clang, -O0):
<willusgui_file_select_dialogw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @willusgui_file_select_dialogw(i16* %0, i32 %1, i8* %2, i8* %3, i8* %4, i32 %5) {
%7 = alloca i16*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
store i16* %0, i16** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
ret i32 0
}

LLVM IR (-O2):
define i32 @willusgui_file_select_dialogw(i16* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i32 %5) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/ *, char const *,
                            int /*<<< orphan*/);
void at_send(FILE *fp, const char *fmt, va_list ap) {
  fprintf(fp, "AT");
  vfprintf(fp, fmt, ap);
  fprintf(fp, "\r\n");
}


x86 assembly (clang, -O0):
<at_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <vfprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_send>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xecc(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
call   1040 <fwrite@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <vfprintf@plt>
lea    0xea8(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"AT\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define void @at_send(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @vfprintf(i32* %9, i8* %10, i32 %11)
%13 = load i32*, i32** %4
%14 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"AT\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
define void @at_send(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 2, i64 1, i32* %0)
%5 = tail call i32 @vfprintf(i32* %0, i8* %1, i32 %2)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 2, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void le_n_numeros(int n, int vector[]) {
  int i;
  printf("A ler inteiros...\n");
  for (i = 0; i < n; ++i)
    scanf("%d", &vector[i]);
}


x86 assembly (clang, -O0):
<le_n_numeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1177 <le_n_numeros+0x57>
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeaf(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1142 <le_n_numeros+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<le_n_numeros>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
test   %ebp,%ebp
jle    1165 <le_n_numeros+0x45>
mov    %ebp,%ebp
lea    0xebe(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%rbp
jne    1150 <le_n_numeros+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [18 x i8] c"A ler inteiros...\00"
define void @le_n_numeros(i32 %0, i32* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fff(void) {
  int a = 1;
  a++;
  printf("WRAPPED:a is:%d\n", a);
}


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

x86 assembly (clang, -O2):
<fff>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"WRAPPED:a is:%d\0A\00"
define void @fff() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"WRAPPED:a is:%d\0A\00"
define void @fff() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
int mpx_os_support(void) {
  unsigned int eax, edx;
  unsigned int ecx = 0x0;
  __asm__("xgetbv" : "=a"(eax), "=d"(edx) : "c"(ecx));
  return (eax & 0x8) != 0;
}


x86 assembly (clang, -O0):
<mpx_os_support>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
xgetbv
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpx_os_support>:
xor    %ecx,%ecx
xgetbv
shr    $0x3,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mpx_os_support() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %3
%4 = load i32, i32* %3
%5 = call { i32, i32 } asm "xgetbv", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
%6 = extractvalue { i32, i32 } %5, 0
%7 = extractvalue { i32, i32 } %5, 1
store i32 %6, i32* %1
store i32 %7, i32* %2
%8 = load i32, i32* %1
%9 = and i32 %8, 8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @mpx_os_support() {
%1 = tail call { i32, i32 } asm "xgetbv", "={ax},={dx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 0)
%2 = extractvalue { i32, i32 } %1, 0
%3 = lshr i32 %2, 3
%4 = and i32 %3, 1
ret i32 %4
}
void glmGenerateTransposeMatrix2d(double t[4], const double m[4]) {
  t[0] = m[0];
  t[2] = m[1];
  t[1] = m[2];
  t[3] = m[3];
}


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

x86 assembly (clang, -O2):
<glmGenerateTransposeMatrix2d>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x10(%rdi)
movsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x18(%rsi),%xmm0
movsd  %xmm0,0x18(%rdi)
ret

LLVM IR (-O0):
define void @glmGenerateTransposeMatrix2d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 2
store double %12, double* %14
%15 = load double*, double** %4
%16 = getelementptr inbounds double, double* %15, i64 2
%17 = load double, double* %16
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 1
store double %17, double* %19
%20 = load double*, double** %4
%21 = getelementptr inbounds double, double* %20, i64 3
%22 = load double, double* %21
%23 = load double*, double** %3
%24 = getelementptr inbounds double, double* %23, i64 3
store double %22, double* %24
ret void
}

LLVM IR (-O2):
define void @glmGenerateTransposeMatrix2d(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %0, i64 2
store double %5, double* %6
%7 = getelementptr inbounds double, double* %1, i64 2
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %0, i64 1
store double %8, double* %9
%10 = getelementptr inbounds double, double* %1, i64 3
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %0, i64 3
store double %11, double* %12
ret void
}
/* Variables and functions */
int GetColor(int);
int /*<<< orphan*/ GetInstance(int *);
int /*<<< orphan*/ ReleaseInstance(int *);
int /*<<< orphan*/ SetColor(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int handle;
  GetInstance(&handle);
  SetColor(handle, 1);
  int color = GetColor(handle);
  printf("color = %d\n", color);
  ReleaseInstance(&handle);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <GetInstance@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1050 <SetColor@plt>
mov    -0x8(%rbp),%edi
call   1070 <GetColor@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1060 <ReleaseInstance@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <GetInstance@plt>
mov    0xc(%rsp),%edi
mov    $0x1,%esi
call   1050 <SetColor@plt>
mov    0xc(%rsp),%edi
call   1070 <GetColor@plt>
lea    0xe80(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1060 <ReleaseInstance@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"color = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @GetInstance(i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @SetColor(i32 %5, i32 1)
%7 = load i32, i32* %2
%8 = call i32 @GetColor(i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @ReleaseInstance(i32* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"color = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @GetInstance(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @SetColor(i32 %4, i32 1)
%6 = load i32, i32* %1
%7 = call i32 @GetColor(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @ReleaseInstance(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(unsigned long, unsigned char, int);
int /*<<< orphan*/ GPIOPadConfigSet(unsigned long, unsigned char, int, int);
void GPIOPinTypeGPIOOutputOD(unsigned long ulPort, unsigned char ucPins) {
  ;
  GPIODirModeSet(ulPort, ucPins, 0x00000001);
  GPIOPadConfigSet(ulPort, ucPins, 0x00000001, 0x00000009);
}


x86 assembly (clang, -O0):
<GPIOPinTypeGPIOOutputOD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
movzbl -0x9(%rbp),%esi
call   1040 <GPIODirModeSet@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    $0x9,%ecx
movzbl -0x9(%rbp),%esi
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeGPIOOutputOD>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x1,%edx
call   1040 <GPIODirModeSet@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0x9,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

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

LLVM IR (-O2):
define void @GPIOPinTypeGPIOOutputOD(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIODirModeSet(i64 %0, i8 zeroext %1, i32 1)
%4 = tail call i32 @GPIOPadConfigSet(i64 %0, i8 zeroext %1, i32 1, i32 9)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *get_input_source(int, char **);
int /*<<< orphan*/ *get_output_destination(int, char **);
int /*<<< orphan*/ init_code_generator(int /*<<< orphan*/ *);
int /*<<< orphan*/ init_scanner(int /*<<< orphan*/ *);
int /*<<< orphan*/ initsyms();
int /*<<< orphan*/ test_code_generator();
int main(int argc, char **argv) {
  FILE *input = get_input_source(argc, argv);
  FILE *output = get_output_destination(argc, argv);
  init_scanner(input);
  initsyms();
  init_code_generator(output);
  test_code_generator();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <get_input_source@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <get_output_destination@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <init_scanner@plt>
mov    $0x0,%al
call   1040 <initsyms@plt>
mov    -0x20(%rbp),%rdi
call   1060 <init_code_generator@plt>
mov    $0x0,%al
call   1080 <test_code_generator@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <get_input_source@plt>
mov    %rax,%r14
mov    %ebp,%edi
mov    %rbx,%rsi
call   1070 <get_output_destination@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1050 <init_scanner@plt>
xor    %eax,%eax
call   1040 <initsyms@plt>
mov    %rbx,%rdi
call   1060 <init_code_generator@plt>
xor    %eax,%eax
call   1080 <test_code_generator@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = call i32* @get_input_source(i32 %8, i8** %9)
store i32* %10, i32** %6
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32* @get_output_destination(i32 %11, i8** %12)
store i32* %13, i32** %7
%14 = load i32*, i32** %6
%15 = call i32 @init_scanner(i32* %14)
%16 = call i32 (...) @initsyms()
%17 = load i32*, i32** %7
%18 = call i32 @init_code_generator(i32* %17)
%19 = call i32 (...) @test_code_generator()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32* @get_input_source(i32 %0, i8** %1)
%4 = tail call i32* @get_output_destination(i32 %0, i8** %1)
%5 = tail call i32 @init_scanner(i32* %3)
%6 = tail call i32 (...) @initsyms()
%7 = tail call i32 @init_code_generator(i32* %4)
%8 = tail call i32 (...) @test_code_generator()
ret i32 0
}
/* Variables and functions */
void *reallocarray(void *, size_t, size_t);
void *xreallocarray(void *ptr, size_t nmemb, size_t size) {
  return reallocarray(ptr, nmemb, size);
}


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

x86 assembly (clang, -O2):
<xreallocarray>:
jmp    1030 <reallocarray@plt>

LLVM IR (-O0):
define i8* @xreallocarray(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i8* @reallocarray(i8* %7, i64 %8, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @xreallocarray(i8* %0, i64 %1, i64 %2) {
%4 = tail call i8* @reallocarray(i8* %0, i64 %1, i64 %2)
ret i8* %4
}
long summator(unsigned int const x, unsigned int const y) { return x + y; }


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

x86 assembly (clang, -O2):
<summator>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i64 @summator(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 = add i32 %5, %6
%8 = zext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @summator(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Type definitions */
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int NSS_STATUS_SUCCESS;
enum nss_status _nss_exfiles_endgrent(void) { return NSS_STATUS_SUCCESS; }


x86 assembly (clang, -O0):
<_nss_exfiles_endgrent>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_exfiles_endgrent>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_exfiles_endgrent() {
%1 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %1
}

LLVM IR (-O2):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_exfiles_endgrent() {
%1 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ put_attr(int /*<<< orphan*/);
void attrs_reset(void) { put_attr(0); }


x86 assembly (clang, -O0):
<attrs_reset>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <put_attr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<attrs_reset>:
xor    %edi,%edi
jmp    1030 <put_attr@plt>

LLVM IR (-O0):
define void @attrs_reset() {
%1 = call i32 @put_attr(i32 0)
ret void
}

LLVM IR (-O2):
define void @attrs_reset() {
%1 = tail call i32 @put_attr(i32 0)
ret void
}
/* Variables and functions */
int read_flag(char *);
int is_efi_secure_boot_setup_mode(void) { return read_flag("SetupMode"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"SetupMode\00"
define i32 @is_efi_secure_boot_setup_mode() {
%1 = call i32 @read_flag(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [10 x i8] c"SetupMode\00"
define i32 @is_efi_secure_boot_setup_mode() {
%1 = tail call i32 @read_flag(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ closefd(int);
int dup2(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void redirect(int oldfd, int newfd) {
  if (oldfd == newfd) {
    return;
  }
  if (dup2(oldfd, newfd) == -1) {
    perror("dup2");
    exit(1);
  }
  closefd(oldfd);
}


x86 assembly (clang, -O0):
<redirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    115f <redirect+0x1f>
jmp    1191 <redirect+0x51>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <dup2@plt>
cmp    $0xffffffff,%eax
jne    1189 <redirect+0x49>
lea    0xe86(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x4(%rbp),%edi
call   1030 <closefd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redirect>:
push   %rbx
cmp    %esi,%edi
jne    1147 <redirect+0x7>
pop    %rbx
ret
mov    %edi,%ebx
call   1040 <dup2@plt>
cmp    $0xffffffff,%eax
je     115b <redirect+0x1b>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <closefd@plt>
lea    0xe9e(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"dup2\00"
define void @redirect(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 = icmp eq i32 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %20
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @dup2(i32 %10, i32 %11)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %9
%18 = load i32, i32* %3
%19 = call i32 @closefd(i32 %18)
br label %20
20: ; preds = %17, %8
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"dup2\00"
define void @redirect(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = tail call i32 @dup2(i32 %0, i32 %1)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
%11 = tail call i32 @closefd(i32 %0)
br label %12
12: ; preds = %2, %10
ret void
}
/* Variables and functions */
int f(int, int);
int __attribute__((no)) foo(void) { return f(1, 2); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <f@plt>

LLVM IR (-O0):
define i32 @foo() {
%1 = call i32 @f(i32 1, i32 2)
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo() {
%1 = tail call i32 @f(i32 1, i32 2)
ret i32 %1
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ suite_health();
int /*<<< orphan*/ suite_reading();
int main() {
  suite_health();
  suite_reading();
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <suite_health@plt>
xor    %eax,%eax
call   1030 <suite_reading@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @suite_health()
%3 = call i32 (...) @suite_reading()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @suite_health()
%2 = tail call i32 (...) @suite_reading()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p384_selectznz(uintptr_t, uintptr_t, uintptr_t,
                                                uintptr_t);
void fiat_p384_selectznz(uint32_t out1[12], uint8_t arg1,
                         const uint32_t arg2[12], const uint32_t arg3[12]) {
  internal_fiat_p384_selectznz((uintptr_t)out1, (uintptr_t)arg1,
                               (uintptr_t)arg2, (uintptr_t)arg3);
}


x86 assembly (clang, -O0):
<fiat_p384_selectznz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <internal_fiat_p384_selectznz@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p384_selectznz>:
jmp    1030 <internal_fiat_p384_selectznz@plt>

LLVM IR (-O0):
define void @fiat_p384_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i64, i64* %6
%12 = load i32*, i32** %7
%13 = ptrtoint i32* %12 to i64
%14 = load i32*, i32** %8
%15 = ptrtoint i32* %14 to i64
%16 = call i32 @internal_fiat_p384_selectznz(i64 %10, i64 %11, i64 %13, i64 %15)
ret void
}

LLVM IR (-O2):
define void @fiat_p384_selectznz(i32* %0, i64 %1, i32* %2, i32* %3) {
%5 = ptrtoint i32* %0 to i64
%6 = ptrtoint i32* %2 to i64
%7 = ptrtoint i32* %3 to i64
%8 = tail call i32 @internal_fiat_p384_selectznz(i64 %5, i64 %1, i64 %6, i64 %7)
ret void
}
unsigned short AfMidOffAdj(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i16 @AfMidOffAdj() {
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @AfMidOffAdj() {
ret i16 0
}
/* Type definitions */
struct suggest_input {
  int dummy;
};
struct suffixtree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _suffixtree_insert(struct suffixtree *,
                                      struct suggest_input *,
                                      int /*<<< orphan*/);
void suffixtree_insert(struct suffixtree *root, struct suggest_input *data) {
  _suffixtree_insert(root, data, 0);
}


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

x86 assembly (clang, -O2):
<suffixtree_insert>:
xor    %edx,%edx
jmp    1030 <_suffixtree_insert@plt>

LLVM IR (-O0):
%struct.suffixtree = type { i32 }
%struct.suggest_input = type { i32 }
define void @suffixtree_insert(%struct.suffixtree* %0, %struct.suggest_input* %1) {
%3 = alloca %struct.suffixtree*
%4 = alloca %struct.suggest_input*
store %struct.suffixtree* %0, %struct.suffixtree** %3
store %struct.suggest_input* %1, %struct.suggest_input** %4
%5 = load %struct.suffixtree*, %struct.suffixtree** %3
%6 = load %struct.suggest_input*, %struct.suggest_input** %4
%7 = call i32 @_suffixtree_insert(%struct.suffixtree* %5, %struct.suggest_input* %6, i32 0)
ret void
}

LLVM IR (-O2):
%struct.suffixtree = type { i32 }
%struct.suggest_input = type { i32 }
define void @suffixtree_insert(%struct.suffixtree* %0, %struct.suggest_input* %1) {
%3 = tail call i32 @_suffixtree_insert(%struct.suffixtree* %0, %struct.suggest_input* %1, i32 0)
ret void
}
/* Type definitions */
struct request_queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __generic_unplug_device(struct request_queue *);
void generic_unplug_device(struct request_queue *q) {
  unsigned long temp;
  unsigned long temp___0;
  __generic_unplug_device(q);
  return;
}


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

x86 assembly (clang, -O2):
<generic_unplug_device>:
jmp    1030 <__generic_unplug_device@plt>

LLVM IR (-O0):
%struct.request_queue = type { i32 }
define void @generic_unplug_device(%struct.request_queue* %0) {
%2 = alloca %struct.request_queue*
%3 = alloca i64
%4 = alloca i64
store %struct.request_queue* %0, %struct.request_queue** %2
%5 = load %struct.request_queue*, %struct.request_queue** %2
%6 = call i32 @__generic_unplug_device(%struct.request_queue* %5)
ret void
}

LLVM IR (-O2):
%struct.request_queue = type { i32 }
define void @generic_unplug_device(%struct.request_queue* %0) {
%2 = tail call i32 @__generic_unplug_device(%struct.request_queue* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ x448_derive_public_key(int /*<<< orphan*/ *,
                                          int /*<<< orphan*/ const *);
void X448_public_from_private(uint8_t out_public_value[56],
                              const uint8_t private_key[56]) {
  x448_derive_public_key(out_public_value, private_key);
}


x86 assembly (clang, -O0):
<X448_public_from_private>:
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 <x448_derive_public_key@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X448_public_from_private>:
jmp    1030 <x448_derive_public_key@plt>

LLVM IR (-O0):
define void @X448_public_from_private(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 @x448_derive_public_key(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @X448_public_from_private(i32* %0, i32* %1) {
%3 = tail call i32 @x448_derive_public_key(i32* %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char, int /*<<< orphan*/);
void command(int file, char value) { send(file, value, 0); }


x86 assembly (clang, -O0):
<command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
xor    %edx,%edx
movsbl -0x5(%rbp),%esi
call   1030 <send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command>:
xor    %edx,%edx
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define void @command(i32 %0, i8 signext %1) {
%3 = tail call i32 @send(i32 %0, i8 signext %1, i32 0)
ret void
}
void f1(int v) {
  int a1[30];
  switch (v) {
  case 1:
    break;
  case 30:
    break;
  }
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x84(%rbp)
sub    $0x1,%eax
je     1136 <f1+0x36>
jmp    1122 <f1+0x22>
mov    -0x84(%rbp),%eax
sub    $0x1e,%eax
je     113b <f1+0x3b>
jmp    1140 <f1+0x40>
jmp    1140 <f1+0x40>
jmp    1140 <f1+0x40>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f1(i32 %0) {
%2 = alloca i32
%3 = alloca [30 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %7 [
i32 1, label %5
i32 30, label %6
]
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5
ret void
}

LLVM IR (-O2):
define void @f1(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put_msg(char *);
int /*<<< orphan*/ save_snapshot_file(char *);
char *spif_get_filename();
void save_snapshot(void) {
  char *name;
  put_msg("Enter name of snapshot file to save:");
  name = spif_get_filename();
  if (name == NULL)
    return;
  save_snapshot_file(name);
}


x86 assembly (clang, -O0):
<save_snapshot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <put_msg@plt>
mov    $0x0,%al
call   1030 <spif_get_filename@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115f <save_snapshot+0x2f>
jmp    1168 <save_snapshot+0x38>
mov    -0x8(%rbp),%rdi
call   1040 <save_snapshot_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_snapshot>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <put_msg@plt>
xor    %eax,%eax
call   1030 <spif_get_filename@plt>
test   %rax,%rax
je     1152 <save_snapshot+0x22>
mov    %rax,%rdi
pop    %rax
jmp    1040 <save_snapshot_file@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Enter name of snapshot file to save:\00"
define void @save_snapshot() {
%1 = alloca i8*
%2 = call i32 @put_msg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call i8* (...) @spif_get_filename()
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
br label %10
7: ; preds = %0
%8 = load i8*, i8** %1
%9 = call i32 @save_snapshot_file(i8* %8)
br label %10
10: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Enter name of snapshot file to save:\00"
define void @save_snapshot() {
%1 = tail call i32 @put_msg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* (...) @spif_get_filename()
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @save_snapshot_file(i8* %2)
br label %6
6: ; preds = %0, %4
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t max(uint32_t a, uint32_t b) {
  if (a > b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1127 <max+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <max+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int test_imm_61uint32_reg(unsigned int val) {
  return ((val) & (0x61 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_61uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x61,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_61uint32_reg(i32 %0) {
%2 = and i32 %0, 97
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int _gcd(int a, int b) {
  if (b == 0)
    return a;
  return _gcd(b, a % b);
}


x86 assembly (clang, -O0):
<_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <_gcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <_gcd+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <_gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <_gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <_gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
double calculate_something_else(double c, struct SomeObject *obj) {
  return 1.1;
}


x86 assembly (clang, -O0):
<calculate_something_else>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  0xeeb(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.SomeObject = type opaque
define double @calculate_something_else(double %0, %struct.SomeObject* %1) {
%3 = alloca double
%4 = alloca %struct.SomeObject*
store double %0, double* %3
store %struct.SomeObject* %1, %struct.SomeObject** %4
ret double 1.100000e+00
}

LLVM IR (-O2):
%struct.SomeObject = type opaque
define double @calculate_something_else(double %0, %struct.SomeObject* nocapture readnone %1) {
ret double 1.100000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void logger_test(char *show_what) {
  printf("\x1b[36m"
         "Logger Demo: "
         "\x1b[35m"
         "%s\n"
         "\x1b[0;0m",
         show_what);
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  printf("\x1b[36m"
         "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
         "-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"
         "\x1b[0;0m");
}


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

x86 assembly (clang, -O2):
<logger_test>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"\1B[36mLogger Demo: \1B[35m%s\0A\1B[0;0m\00"
@.str.1 = [110 x i8] c"\1B[36m=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\0A\1B[0;0m\00"
define void @logger_test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"\1B[36mLogger Demo: \1B[35m%s\0A\1B[0;0m\00"
@.str.1 = [110 x i8] c"\1B[36m=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\0A\1B[0;0m\00"
define void @logger_test(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([110 x i8], [110 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ our_free(char *);
char *our_malloc(int);
int /*<<< orphan*/ printf(char *);
int main() {
  char *x = our_malloc(64);
  if (!x) {
    printf("ALLOC FAILED\n");
    return -1;
  }
  x[-1] = 0;
  x[64] = 0;
  our_free(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x40,%edi
call   1050 <our_malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <main+0x40>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1190 <main+0x60>
mov    -0x10(%rbp),%rax
movb   $0x0,-0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x40(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <our_free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x40,%edi
call   1050 <our_malloc@plt>
test   %rax,%rax
je     1154 <main+0x24>
movb   $0x0,-0x1(%rax)
movb   $0x0,0x40(%rax)
mov    %rax,%rdi
call   1040 <our_free@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"ALLOC FAILED\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @our_malloc(i32 64)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %15
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 -1
store i8 0, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 64
store i8 0, i8* %12
%13 = load i8*, i8** %2
%14 = call i32 @our_free(i8* %13)
store i32 0, i32* %1
br label %15
15: ; preds = %8, %6
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@str = [13 x i8] c"ALLOC FAILED\00"
define i32 @main() {
%1 = tail call i8* @our_malloc(i32 64)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %9
5: ; preds = %0
%6 = getelementptr inbounds i8, i8* %1, i64 -1
store i8 0, i8* %6
%7 = getelementptr inbounds i8, i8* %1, i64 64
store i8 0, i8* %7
%8 = tail call i32 @our_free(i8* %1)
br label %9
9: ; preds = %5, %3
%10 = phi i32 [ 0, %5 ], [ -1, %3 ]
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ x;
};

/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int /*<<< orphan*/);
void incomplete() {
  struct tag1;
  struct tag2 {
    struct tag1 *p;
  };
  struct tag1 {
    int x;
  };
  struct tag1 v1 = {3};
  struct tag2 v2 = {&v1};
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c",
          198, 3, v2.p->x);
  ;
}


x86 assembly (clang, -O0):
<incomplete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
lea    0xece(%rip),%rdi
mov    $0xc6,%esi
mov    $0x3,%edx
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<incomplete>:
lea    0xee9(%rip),%rdi
mov    $0xc6,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
%struct.tag1 = type { i32 }
%struct.tag2 = type { %struct.tag1* }
@__const.incomplete.v1 = %struct.tag1 { i32 3 }
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @incomplete() {
%1 = alloca %struct.tag1
%2 = alloca %struct.tag2
%3 = bitcast %struct.tag1* %1 to i8*
%4 = getelementptr inbounds %struct.tag2, %struct.tag2* %2, i32 0, i32 0
store %struct.tag1* %1, %struct.tag1** %4
%5 = getelementptr inbounds %struct.tag2, %struct.tag2* %2, i32 0, i32 0
%6 = load %struct.tag1*, %struct.tag1** %5
%7 = getelementptr inbounds %struct.tag1, %struct.tag1* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @fexpect(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 198, i32 3, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.tag1 = type { i32 }
@.str = [129 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/struct.c\00"
define void @incomplete() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([129 x i8], [129 x i8]* @.str, i64 0, i64 0), i32 198, i32 3, i32 3)
ret void
}