xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int printUsage(char *exe) {
  printf("Usage:\n"
         "%s <filename> <mode>\n"
         "where mode can be as follows:\n"
         "  1 - YM2203\n"
         "  2 - YM2608/2610\n"
         "",
         exe);
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [90 x i8] c"Usage:\0A%s <filename> <mode>\0Awhere mode can be as follows:\0A 1 - YM2203\0A 2 - YM2608/2610\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}

LLVM IR (-O2):
@.str = [90 x i8] c"Usage:\0A%s <filename> <mode>\0Awhere mode can be as follows:\0A 1 - YM2203\0A 2 - YM2608/2610\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ clean_and_exit_minishell();
int /*<<< orphan*/ init_minishell(char **);
int /*<<< orphan*/ main_loop();
int main(__attribute__((unused)) int argc, __attribute__((unused)) char **argv,
         char **env) {
  init_minishell(env);
  main_loop();
  clean_and_exit_minishell();
  return (EXIT_SUCCESS);
}


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    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <init_minishell@plt>
mov    $0x0,%al
call   1040 <main_loop@plt>
mov    $0x0,%al
call   1050 <clean_and_exit_minishell@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rdx,%rdi
call   1030 <init_minishell@plt>
xor    %eax,%eax
call   1040 <main_loop@plt>
xor    %eax,%eax
call   1050 <clean_and_exit_minishell@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i8**, i8*** %7
%9 = call i32 @init_minishell(i8** %8)
%10 = call i32 (...) @main_loop()
%11 = call i32 (...) @clean_and_exit_minishell()
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** %2) {
%4 = tail call i32 @init_minishell(i8** %2)
%5 = tail call i32 (...) @main_loop()
%6 = tail call i32 (...) @clean_and_exit_minishell()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("pkttype options:\n"
         "--pkttype-type    [!] type: class the packet belongs to\n"
         "Possible values: broadcast, multicast, host, otherhost, or any other "
         "byte value (which would be pretty useless).\n");
}


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

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

LLVM IR (-O0):
@.str = [187 x i8] c"pkttype options:\0A--pkttype-type [!] type: class the packet belongs to\0APossible values: broadcast, multicast, host, otherhost, or any other byte value (which would be pretty useless).\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [186 x i8] c"pkttype options:\0A--pkttype-type [!] type: class the packet belongs to\0APossible values: broadcast, multicast, host, otherhost, or any other byte value (which would be pretty useless).\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([186 x i8], [186 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int scanf(char *, ...);
int main() {
  int i, reti, reta;
  char a[30];
  reti = scanf("%d", &i);
  reta = scanf("%s", a);
  printf("\nreti=%d\treta=%d\n", reti, reta);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    %eax,-0xc(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %eax,%ebx
lea    0xec2(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeb2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [18 x i8] c"\0Areti=%d\09reta=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [30 x i8]
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 %6, i32* %3
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [18 x i8] c"\0Areti=%d\09reta=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(void *, int, int, int /*<<< orphan*/ *);
void GF1_SetMap(void *data, int len) {
  FILE *ini = fopen("ULTRAMID.INI", "wb");
  if (ini) {
    fwrite(data, 1, len, ini);
    fclose(ini);
  }
}


x86 assembly (clang, -O0):
<GF1_SetMap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeba(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117f <GF1_SetMap+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1050 <fwrite@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GF1_SetMap>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1174 <GF1_SetMap+0x44>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fclose@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"ULTRAMID.INI\00"
@.str.1 = [3 x i8] c"wb\00"
define void @GF1_SetMap(i8* nocapture %0, i32 %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fwrite(i8* %0, i32 1, i32 %1, i32* %3)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testPatternHelpers();
void testPattern() { testPatternHelpers(); }


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

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

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

LLVM IR (-O2):
define void @testPattern() {
%1 = tail call i32 (...) @testPatternHelpers()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ var(int, int, int, int, int, int /*<<< orphan*/);
void main() { var(5, 4, 3, 2, 1, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <var@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
jmp    1030 <var@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @var(i32 5, i32 4, i32 3, i32 2, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @var(i32 5, i32 4, i32 3, i32 2, i32 1, i32 0)
ret void
}
void row_stride_smul_1x1(const double *scalar, double *a, int a_row_stride) {
  a[(0) * a_row_stride + 0] = a[(0) * a_row_stride + 0] * *scalar;
}


x86 assembly (clang, -O0):
<row_stride_smul_1x1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x0,-0x14(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
imul   $0x0,-0x14(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<row_stride_smul_1x1>:
movsd  (%rsi),%xmm0
mulsd  (%rdi),%xmm0
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @row_stride_smul_1x1(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%7 = load double*, double** %5
%8 = load i32, i32* %6
%9 = mul nsw i32 0, %8
%10 = add nsw i32 %9, 0
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds double, double* %7, i64 %11
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = load double, double* %14
%16 = fmul double %13, %15
%17 = load double*, double** %5
%18 = load i32, i32* %6
%19 = mul nsw i32 0, %18
%20 = add nsw i32 %19, 0
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %17, i64 %21
store double %16, double* %22
ret void
}

LLVM IR (-O2):
define void @row_stride_smul_1x1(double* nocapture %0, double* nocapture %1, i32 %2) {
%4 = load double, double* %1
%5 = load double, double* %0
%6 = fmul double %4, %5
store double %6, double* %1
ret void
}
/* Variables and functions */
int lifenumber(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  printf("input your birthday(typr.DDMMYYYY).\n");
  scanf("%d", &a);
  printf("your life number is%2d.", lifenumber(a));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <lifenumber@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <lifenumber@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"input your birthday(typr.DDMMYYYY).\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"your life number is%2d.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @lifenumber(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [24 x i8] c"your life number is%2d.\00"
@str = [36 x i8] c"input your birthday(typr.DDMMYYYY).\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @lifenumber(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int cbmarch_get_eoi(int f) { return ioctl(f, _IO(0xcb, 7)); }


x86 assembly (clang, -O0):
<cbmarch_get_eoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xcb,%edi
mov    $0x7,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbmarch_get_eoi>:
push   %rbx
mov    %edi,%ebx
mov    $0xcb,%edi
mov    $0x7,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @cbmarch_get_eoi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i32 203, i32 7)
%5 = call i32 @ioctl(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @cbmarch_get_eoi(i32 %0) {
%2 = tail call i32 @_IO(i32 203, i32 7)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
size_t snprintf(char *, size_t, char *, char const *);
size_t strncpy_s(char *strDest, size_t numberOfElements, const char *strSource,
                 size_t count) {
  return snprintf(strDest, count, "%s", strSource);
}


x86 assembly (clang, -O0):
<strncpy_s>:
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    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xec5(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_s>:
mov    %rdx,%rax
lea    0xee6(%rip),%rdx
mov    %rcx,%rsi
mov    %rax,%rcx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i64 @strncpy_s(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %8
%11 = load i8*, i8** %7
%12 = call i64 @snprintf(i8* %9, i64 %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
ret i64 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i64 @strncpy_s(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = tail call i64 @snprintf(i8* %0, i64 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i64 %5
}
/* Type definitions */
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_head(struct genlist const *);
void *genlist_link_data(int /*<<< orphan*/);
void *genlist_front(const struct genlist *pgenlist) {
  return genlist_link_data(genlist_head(pgenlist));
}


x86 assembly (clang, -O0):
<genlist_front>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <genlist_head@plt>
mov    %eax,%edi
call   1040 <genlist_link_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genlist_front>:
push   %rax
call   1030 <genlist_head@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <genlist_link_data@plt>

LLVM IR (-O0):
%struct.genlist = type { i32 }
define i8* @genlist_front(%struct.genlist* %0) {
%2 = alloca %struct.genlist*
store %struct.genlist* %0, %struct.genlist** %2
%3 = load %struct.genlist*, %struct.genlist** %2
%4 = call i32 @genlist_head(%struct.genlist* %3)
%5 = call i8* @genlist_link_data(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.genlist = type { i32 }
define i8* @genlist_front(%struct.genlist* %0) {
%2 = tail call i32 @genlist_head(%struct.genlist* %0)
%3 = tail call i8* @genlist_link_data(i32 %2)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ MYSQL;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/ *);
scalar_t__ mysql_query(int /*<<< orphan*/ *, char *);
int mysql_transaction(MYSQL *mysql) {
  assert(mysql);
  if (mysql_query(mysql, "START TRANSACTION")) {
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<mysql_transaction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1030 <mysql_query@plt>
cmp    $0x0,%rax
je     115b <mysql_transaction+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <mysql_transaction+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysql_transaction>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
call   1030 <mysql_query@plt>
neg    %rax
sbb    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"START TRANSACTION\00"
define i32 @mysql_transaction(i32* %0) {
%2 = tail call i32 @assert(i32* %0)
%3 = tail call i64 @mysql_query(i32* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
double av_clipd_sse2(double a, double amin, double amax) {
  __asm__("minsd %2, %0 \n\t"
          "maxsd %1, %0 \n\t"
          : "+&x"(a)
          : "xm"(amin), "xm"(amax));
  return a;
}


x86 assembly (clang, -O0):
<av_clipd_sse2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
minsd  -0x28(%rbp),%xmm0
maxsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_clipd_sse2>:
movsd  %xmm2,-0x10(%rsp)
movsd  %xmm1,-0x8(%rsp)
minsd  -0x10(%rsp),%xmm0
maxsd  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @av_clipd_sse2(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double asm "minsd $2, $0 \0A\09maxsd $1, $0 \0A\09", "=&x,xm,xm,0,~{dirflag},~{fpsr},~{flags}"(double %8, double %9, double %7)
store double %10, double* %4
%11 = load double, double* %4
ret double %11
}

LLVM IR (-O2):
define double @av_clipd_sse2(double %0, double %1, double %2) {
%4 = tail call double asm "minsd $2, $0 \0A\09maxsd $1, $0 \0A\09", "=&x,xm,xm,0,~{dirflag},~{fpsr},~{flags}"(double %1, double %2, double %0)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("This is Saketh"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"This is Saketh\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"This is Saketh\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _doatexits();
int /*<<< orphan*/ _exit(int);
void exit(int status) {
  _doatexits();
  _exit(status);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <_doatexits@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <_doatexits@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @_doatexits()
%4 = load i32, i32* %2
%5 = call i32 @_exit(i32 %4)
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 (...) @_doatexits()
%3 = tail call i32 @_exit(i32 %0)
unreachable
}
int vis_f2(int k) {
  int vis_comm(int j);
  return vis_comm(k) * vis_comm(k);
}


x86 assembly (clang, -O0):
<vis_f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <vis_comm@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <vis_comm@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vis_f2>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <vis_comm@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <vis_comm@plt>
imul   %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @vis_f2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @vis_comm(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @vis_comm(i32 %5)
%7 = mul nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @vis_f2(i32 %0) {
%2 = tail call i32 @vis_comm(i32 %0)
%3 = tail call i32 @vis_comm(i32 %0)
%4 = mul nsw i32 %3, %2
ret i32 %4
}
void v4s_(vec) short vec[4];
{
  float v[4];
  v[0] = vec[0];
  v[1] = vec[1];
  v[2] = vec[2];
  v[3] = vec[3];
  vcall(v, 4);
}


x86 assembly (clang, -O0):
<v4s_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movswl 0x2(%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movswl 0x4(%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movswl 0x6(%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <vcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4s_>:
sub    $0x18,%rsp
movq   (%rdi),%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x10,%xmm0
cvtdq2ps %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1030 <vcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @v4s_(i16* %0) {
%2 = alloca i16*
%3 = alloca [4 x float]
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = getelementptr inbounds i16, i16* %4, i64 0
%6 = load i16, i16* %5
%7 = sitofp i16 %6 to float
%8 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
store float %7, float* %8
%9 = load i16*, i16** %2
%10 = getelementptr inbounds i16, i16* %9, i64 1
%11 = load i16, i16* %10
%12 = sitofp i16 %11 to float
%13 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 1
store float %12, float* %13
%14 = load i16*, i16** %2
%15 = getelementptr inbounds i16, i16* %14, i64 2
%16 = load i16, i16* %15
%17 = sitofp i16 %16 to float
%18 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 2
store float %17, float* %18
%19 = load i16*, i16** %2
%20 = getelementptr inbounds i16, i16* %19, i64 3
%21 = load i16, i16* %20
%22 = sitofp i16 %21 to float
%23 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 3
store float %22, float* %23
%24 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%25 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %24, i32 4)
ret void
}

LLVM IR (-O2):
define void @v4s_(i16* nocapture %0) {
%2 = alloca <4 x float>
%3 = bitcast <4 x float>* %2 to i8*
%4 = getelementptr inbounds <4 x float>, <4 x float>* %2, i64 0, i64 0
%5 = bitcast i16* %0 to <4 x i16>*
%6 = load <4 x i16>, <4 x i16>* %5
%7 = sitofp <4 x i16> %6 to <4 x float>
store <4 x float> %7, <4 x float>* %2
%8 = call i32 (float*, i32, ...) bitcast (i32 (...)* @vcall to i32 (float*, i32, ...)*)(float* %4, i32 4)
ret void
}
void ic_init(void) {
  (*(volatile unsigned *)0x1e00008) = 0x0;
  (*(volatile unsigned *)0x1e00000) = 0x7;
  (*(volatile unsigned *)0x1e0000c) = ~(0x0);
}


x86 assembly (clang, -O0):
<ic_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e00008,%eax
movl   $0x0,(%rax)
mov    $0x1e00000,%eax
movl   $0x7,(%rax)
mov    $0x1e0000c,%eax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ic_init>:
movl   $0x0,0x1e00008
movl   $0x7,0x1e00000
movl   $0xffffffff,0x1e0000c
ff ff ff ff
ret

LLVM IR (-O0):
define void @ic_init() {
store volatile i32 0, i32* inttoptr (i64 31457288 to i32*)
store volatile i32 7, i32* inttoptr (i64 31457280 to i32*)
store volatile i32 -1, i32* inttoptr (i64 31457292 to i32*)
ret void
}

LLVM IR (-O2):
define void @ic_init() {
store volatile i32 0, i32* inttoptr (i64 31457288 to i32*)
store volatile i32 7, i32* inttoptr (i64 31457280 to i32*)
store volatile i32 -1, i32* inttoptr (i64 31457292 to i32*)
ret void
}
int fib(int param1, int param2) {
  int g1;
  int i4;
  int local19;
  int o0;
  int o0_1;
  int o4;
  i4 = param2;
  if (param1 <= 1) {
    g1 = param1;
    local19 = param1;
  } else {
    o0 = fib(param1 - 1, param2);
    o0_1 = fib(param1 - 2, o4);
    i4 = o0;
    local19 = o0 + o0_1;
  }
  return local19;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jg     113f <fib+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1170 <fib+0x60>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1030 <fib@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
mov    -0x20(%rbp),%esi
call   1030 <fib@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1121 <fib+0x11>
mov    %ebx,%ecx
jmp    1147 <fib+0x37>
mov    %esi,%r14d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rbx),%edi
mov    %r14d,%esi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %0, %2 ]
%6 = phi i32 [ %10, %4 ], [ 0, %2 ]
%7 = add nsw i32 %5, -1
%8 = tail call i32 @fib(i32 %7, i32 %1)
%9 = add nsw i32 %5, -2
%10 = add nsw i32 %8, %6
%11 = icmp ult i32 %5, 4
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ 0, %2 ], [ %10, %4 ]
%14 = phi i32 [ %0, %2 ], [ %9, %4 ]
%15 = add nsw i32 %14, %13
ret i32 %15
}
__attribute__((always_)) void purge_logs(void) {
  ((void (*)(const char *, int))0x1192ACF4)("/logs", 0);
}


x86 assembly (clang, -O0):
<purge_logs>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rdi
xor    %esi,%esi
mov    $0x1192acf4,%eax
call   *%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<purge_logs>:
lea    0xef9(%rip),%rdi
mov    $0x1192acf4,%eax
xor    %esi,%esi
jmp    *%rax

LLVM IR (-O0):
@.str = [6 x i8] c"/logs\00"
define void @purge_logs() {
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"/logs\00"
define void @purge_logs() {
tail call void inttoptr (i64 294825204 to void (i8*, i32)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
ret void
}
void gtk_window_set_mnemonic_modifier() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_set_mnemonic_modifier() {
ret void
}
/* Variables and functions */
char Mod1_xx();
char rcombine(char, char);
char Mod1_StdControl_init(void) {
  char result1;
  char result2;
  result1 = rcombine(2, 1);
  result2 = Mod1_xx();
  result1 = rcombine(result1, result2);
  return result1;
}


x86 assembly (clang, -O0):
<Mod1_StdControl_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <rcombine@plt>
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <Mod1_xx@plt>
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
movsbl %al,%edi
movsbl -0x2(%rbp),%esi
call   1040 <rcombine@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mod1_StdControl_init>:
push   %rbx
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <rcombine@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <Mod1_xx@plt>
movsbl %bl,%edi
movsbl %al,%esi
pop    %rbx
jmp    1040 <rcombine@plt>

LLVM IR (-O0):
define signext i8 @Mod1_StdControl_init() {
%1 = alloca i8
%2 = alloca i8
%3 = call signext i8 @rcombine(i8 signext 2, i8 signext 1)
store i8 %3, i8* %1
%4 = call signext i8 (...) @Mod1_xx()
store i8 %4, i8* %2
%5 = load i8, i8* %1
%6 = load i8, i8* %2
%7 = call signext i8 @rcombine(i8 signext %5, i8 signext %6)
store i8 %7, i8* %1
%8 = load i8, i8* %1
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @Mod1_StdControl_init() {
%1 = tail call signext i8 @rcombine(i8 signext 2, i8 signext 1)
%2 = tail call signext i8 (...) @Mod1_xx()
%3 = tail call signext i8 @rcombine(i8 signext %1, i8 signext %2)
ret i8 %3
}
/* Variables and functions */
char *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int strlen(char *);
int getLine(char *str, int max) {
  char *temp;
  if ((temp = fgets(str, max, stdin)) != NULL) {
    int len = strlen(str);
    str[len - 1] = '\0';
    return len - 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<getLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     117d <getLine+0x5d>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <getLine+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLine>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
call   1040 <fgets@plt>
test   %rax,%rax
je     114c <getLine+0x2c>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rbx,%rax,1)
add    $0xffffffffffffffff,%rax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@stdin = global i32 0
define i32 @getLine(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i8* @fgets(i8* %0, i32 %1, i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = tail call i32 @strlen(i8* %0)
%8 = add nsw i32 %7, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %8, %6 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xbb() {
  Assert_real((isprint(187) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              940, ("isprint should be 0 for 0xbb"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xbb>:
push   %rax
mov    $0xbb,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3ac,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xbb\00"
define void @t_isprint_0xbb() {
%1 = call i64 @isprint(i32 187)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 940, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xbb\00"
define void @t_isprint_0xbb() {
%1 = tail call i64 @isprint(i32 187)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 940, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *newstr(char *src) {
  char *result = malloc(strlen(src) + 1);
  strcpy(result, src);
  return result;
}


x86 assembly (clang, -O0):
<newstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @newstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @newstr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 1337;
  printf("a = %i", a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"a = %i\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1337)
ret i32 0
}
int dosquit() { return 1; }


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

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

LLVM IR (-O0):
define i32 @dosquit() {
ret i32 1
}

LLVM IR (-O2):
define i32 @dosquit() {
ret i32 1
}
void reduce_sum_long(long *array, long n) { long *temp; }


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

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

LLVM IR (-O0):
define void @reduce_sum_long(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64*
store i64* %0, i64** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @reduce_sum_long(i64* nocapture %0, i64 %1) {
ret void
}
void jac_chain_nm5_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @jac_chain_nm5_decref() {
ret void
}
/* Variables and functions */
int utf8_mbtowc(int *, char const *, size_t);
int mbtowc_utf8(void *map, int *pwc, const char *s, size_t n) {
  return utf8_mbtowc(pwc, s, n);
}


x86 assembly (clang, -O0):
<mbtowc_utf8>:
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    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <utf8_mbtowc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbtowc_utf8>:
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <utf8_mbtowc@plt>

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

LLVM IR (-O2):
define i32 @mbtowc_utf8(i8* nocapture readnone %0, i32* %1, i8* %2, i64 %3) {
%5 = tail call i32 @utf8_mbtowc(i32* %1, i8* %2, i64 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void nez_PrintErrorInfo(const char *errmsg) {
  fprintf(stderr, "%s\n", errmsg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<nez_PrintErrorInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<nez_PrintErrorInfo>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @nez_PrintErrorInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @nez_PrintErrorInfo(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int some() { return 6; }


x86 assembly (clang, -O0):
<some>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @some() {
ret i32 6
}

LLVM IR (-O2):
define i32 @some() {
ret i32 6
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t prv_decode_imm(int32_t val) {
  int32_t shift;
  if ((val & 0xf00) == 0)
    return val;
  shift = (val & 0xf00) >> 7;
  val &= 0xff;
  return val >> shift | val << (32 - shift);
}


x86 assembly (clang, -O0):
<prv_decode_imm>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf00,%eax
cmp    $0x0,%eax
jne    1123 <prv_decode_imm+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <prv_decode_imm+0x58>
mov    -0x8(%rbp),%eax
and    $0xf00,%eax
sar    $0x7,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    -0x8(%rbp),%edx
mov    $0x20,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_decode_imm>:
mov    %edi,%edx
and    $0xf00,%edx
mov    %edx,%ecx
shr    $0x7,%ecx
movzbl %dil,%eax
ror    %cl,%eax
test   %edx,%edx
cmove  %edi,%eax
ret

LLVM IR (-O0):
define i32 @prv_decode_imm(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, 3840
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
store i32 %9, i32* %2
br label %24
10: ; preds = %1
%11 = load i32, i32* %3
%12 = and i32 %11, 3840
%13 = ashr i32 %12, 7
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = and i32 %14, 255
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = ashr i32 %16, %17
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = sub nsw i32 32, %20
%22 = shl i32 %19, %21
%23 = or i32 %18, %22
store i32 %23, i32* %2
br label %24
24: ; preds = %10, %8
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @prv_decode_imm(i32 %0) {
%2 = and i32 %0, 3840
%3 = icmp eq i32 %2, 0
%4 = lshr exact i32 %2, 7
%5 = and i32 %0, 255
%6 = tail call i32 @llvm.fshr.i32(i32 %5, i32 %5, i32 %4)
%7 = select i1 %3, i32 %0, i32 %6
ret i32 %7
}
unsigned genetare01n0m(int n, int m) {
  unsigned ret = (1 << (n + m)) - 1;
  unsigned mask = ~((1 << m) - 1);
  return ret & mask;
}


x86 assembly (clang, -O0):
<genetare01n0m>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<genetare01n0m>:
lea    (%rdi,%rsi,1),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %esi,%ecx
shr    %cl,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @genetare01n0m(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = shl i32 1, %9
%11 = sub nsw i32 %10, 1
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = shl i32 1, %12
%14 = sub nsw i32 %13, 1
%15 = xor i32 %14, -1
store i32 %15, i32* %6
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = and i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @genetare01n0m(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = shl nsw i32 -1, %3
%5 = xor i32 %4, -1
%6 = shl nsw i32 -1, %1
%7 = and i32 %6, %5
ret i32 %7
}