xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse_words(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char *s = (char *)malloc(16 * sizeof(char));
  strcpy(s, "Alice likes Bob");
  printf("%s\n", s);
  reverse_words(s);
  printf("%s\n", s);
  free(s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x10,%edi
call   1070 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe8f(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <reverse_words@plt>
mov    -0x8(%rbp),%rsi
lea    0xe76(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x10,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
lea    0xe98(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
lea    0xe99(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <reverse_words@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Alice likes Bob\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 16)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @reverse_words(i8* %8)
%10 = load i8*, i8** %1
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %1
%13 = call i32 @free(i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Alice likes Bob\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 16)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = tail call i32 @reverse_words(i8* %2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%7 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int function_three() {
  printf("This is function one\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"This is function one\00"
define i32 @function_three() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void doubletest(double d) {
  printf("%s with arg %g (%g)\n", __FUNCTION__, (float)d, 3.1f);
}


x86 assembly (clang, -O0):
<doubletest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed7(%rip),%rdi
lea    0xee5(%rip),%rsi
movsd  0xec0(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubletest>:
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xee9(%rip),%rdi
lea    0xef7(%rip),%rsi
movsd  0xed2(%rip),%xmm1
mov    $0x2,%al
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"%s with arg %g (%g)\0A\00"
@__FUNCTION__.doubletest = [11 x i8] c"doubletest\00"
define void @doubletest(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptrunc double %3 to float
%5 = fpext float %4 to double
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.doubletest, i64 0, i64 0), double %5, double 0x4008CCCCC0000000)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s with arg %g (%g)\0A\00"
@__FUNCTION__.doubletest = [11 x i8] c"doubletest\00"
define void @doubletest(double %0) {
%2 = fptrunc double %0 to float
%3 = fpext float %2 to double
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.doubletest, i64 0, i64 0), double %3, double 0x4008CCCCC0000000)
ret void
}
/* Variables and functions */
char *U_EMR_CORE5(int);
char *U_EMRWIDENPATH_set(void) { return (U_EMR_CORE5(66)); }


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

x86 assembly (clang, -O2):
<U_EMRWIDENPATH_set>:
mov    $0x42,%edi
jmp    1030 <U_EMR_CORE5@plt>

LLVM IR (-O0):
define i8* @U_EMRWIDENPATH_set() {
%1 = call i8* @U_EMR_CORE5(i32 66)
ret i8* %1
}

LLVM IR (-O2):
define i8* @U_EMRWIDENPATH_set() {
%1 = tail call i8* @U_EMR_CORE5(i32 66)
ret i8* %1
}
void Strcat(char *t, char *s) {
  while (*t++)
    ;
  t--;
  while (*t++ = *s++)
    ;
}


x86 assembly (clang, -O0):
<Strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1129 <Strcat+0x29>
jmp    110c <Strcat+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1164 <Strcat+0x64>
jmp    1135 <Strcat+0x35>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strcat>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <Strcat>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <Strcat+0x10>
ret

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

LLVM IR (-O2):
define void @Strcat(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
void UART1_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<UART1_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UART1_Handler+0x9>
jmp    1109 <UART1_Handler+0x9>

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

LLVM IR (-O0):
define void @UART1_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @UART1_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int nicrealtek_shutdown(void *data) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nicrealtek_shutdown(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ nasm_write(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *);
void fwriteint16_t(uint16_t data, FILE *fp) { nasm_write(&data, 2, fp); }


x86 assembly (clang, -O0):
<fwriteint16_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x4(%rbp),%rdi
mov    $0x2,%esi
call   1030 <nasm_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwriteint16_t>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x2,%esi
call   1030 <nasm_write@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @fwriteint16_t(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @nasm_write(i32* %3, i32 2, i32* %5)
ret void
}

LLVM IR (-O2):
define void @fwriteint16_t(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @nasm_write(i32* %3, i32 2, i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ string;

/* Variables and functions */
int /*<<< orphan*/ sys_exit_group(int /*<<< orphan*/);
int /*<<< orphan*/ sys_getpid();
int /*<<< orphan*/ sys_write(int, char const *, int);
void _start() {
  sys_getpid();
  static const char string[] = "In example_prog.c!\n";
  sys_write(1, string, sizeof(string) - 1);
  sys_exit_group(0);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sys_getpid@plt>
mov    $0x1,%edi
lea    0xeb9(%rip),%rsi
mov    $0x13,%edx
call   1040 <sys_write@plt>
xor    %edi,%edi
call   1050 <sys_exit_group@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rax
xor    %eax,%eax
call   1030 <sys_getpid@plt>
lea    0xec1(%rip),%rsi
mov    $0x1,%edi
mov    $0x13,%edx
call   1040 <sys_write@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <sys_exit_group@plt>

LLVM IR (-O0):
@_start.string = internal constant [20 x i8] c"In example_prog.c!\0A\00"
define void @_start() {
%1 = call i32 (...) @sys_getpid()
%2 = call i32 @sys_write(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @_start.string, i64 0, i64 0), i32 19)
%3 = call i32 @sys_exit_group(i32 0)
ret void
}

LLVM IR (-O2):
@_start.string = internal constant [20 x i8] c"In example_prog.c!\0A\00"
define void @_start() {
%1 = tail call i32 (...) @sys_getpid()
%2 = tail call i32 @sys_write(i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @_start.string, i64 0, i64 0), i32 19)
%3 = tail call i32 @sys_exit_group(i32 0)
ret void
}
unsigned xrop3_65_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T ^ S;
  stk1 = D | stk2;
  stk1 = ~stk1;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


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

x86 assembly (clang, -O2):
<xrop3_65_1_1>:
mov    %esi,%ecx
or     %edi,%esi
mov    %edi,%eax
shl    $0x8,%eax
shl    $0x8,%ecx
mov    %eax,%edx
xor    %ecx,%edx
xor    $0xffffff00,%edx
or     %esi,%eax
or     %ecx,%eax
not    %eax
and    %edx,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_65_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %4, %6
%8 = xor i32 %7, -256
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %4, %10
%12 = or i32 %11, %6
%13 = xor i32 %12, -1
%14 = and i32 %8, %13
%15 = or i32 %14, %10
ret i32 %15
}
/* Variables and functions */
int obj1func1(int);
int obj2func2(int a) { return obj1func1(a) + 10; }


x86 assembly (clang, -O0):
<obj2func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <obj1func1@plt>
add    $0xa,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<obj2func2>:
push   %rax
call   1030 <obj1func1@plt>
add    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @obj2func2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @obj1func1(i32 %3)
%5 = add nsw i32 %4, 10
ret i32 %5
}

LLVM IR (-O2):
define i32 @obj2func2(i32 %0) {
%2 = tail call i32 @obj1func1(i32 %0)
%3 = add nsw i32 %2, 10
ret i32 %3
}
int foo2() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @foo2() {
ret i32 1
}
/* Variables and functions */
int spi_send_command(int, char *);
int nrf_flush_rx(char *retstatus) { return spi_send_command(0xE2, retstatus); }


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

x86 assembly (clang, -O2):
<nrf_flush_rx>:
mov    %rdi,%rsi
mov    $0xe2,%edi
jmp    1030 <spi_send_command@plt>

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

LLVM IR (-O2):
define i32 @nrf_flush_rx(i8* %0) {
%2 = tail call i32 @spi_send_command(i32 226, i8* %0)
ret i32 %2
}
char *get_os(void) {
  return "Linux";
  return "unknown";
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"Linux\00"
define i8* @get_os() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"Linux\00"
define i8* @get_os() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_unlock(int /*<<< orphan*/ *);
int el_mutex_unlock(void *hmutex) {
  return pthread_mutex_unlock((pthread_mutex_t *)hmutex);
}


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

x86 assembly (clang, -O2):
<el_mutex_unlock>:
jmp    1030 <pthread_mutex_unlock@plt>

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

LLVM IR (-O2):
define i32 @el_mutex_unlock(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @pthread_mutex_unlock(i32* %2)
ret i32 %3
}
int cvmx_helper_ipd_and_packet_input_enable(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cvmx_helper_ipd_and_packet_input_enable() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ calc_squares();
void baseband_init(void) { calc_squares(); }


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

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

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

LLVM IR (-O2):
define void @baseband_init() {
%1 = tail call i32 (...) @calc_squares()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr, "Usage: %s [-c plmc.conf] [-s || -x]\n\n", prog);
  fprintf(stderr, "options are:\n"
                  "\t-c\t\tfull path to plmc.conf\n"
                  "\t-s\t\tOS is starting up, send EE_INSTANTIATING message\n"
                  "\t-x\t\tOS is shutting down, send EE_TERMINATED message\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"Usage: %s [-c plmc.conf] [-s || -x]\0A\0A\00"
@.str.1 = [149 x i8] c"options are:\0A\09-c\09\09full path to plmc.conf\0A\09-s\09\09OS is starting up, send EE_INSTANTIATING message\0A\09-x\09\09OS is shutting down, send EE_TERMINATED message\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"Usage: %s [-c plmc.conf] [-s || -x]\0A\0A\00"
@.str.1 = [149 x i8] c"options are:\0A\09-c\09\09full path to plmc.conf\0A\09-s\09\09OS is starting up, send EE_INSTANTIATING message\0A\09-x\09\09OS is shutting down, send EE_TERMINATED message\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t rdtsc(void) {
  uint64_t x;
  __asm__ volatile(".byte 0x0f, 0x31" : "=A"(x));
  return x;
}


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

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

LLVM IR (-O0):
define i8* @rdtsc() {
%1 = alloca i8*
%2 = call i8* asm sideeffect ".byte 0x0f, 0x31", "=A,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @rdtsc() {
%1 = tail call i8* asm sideeffect ".byte 0x0f, 0x31", "=A,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void and_reg32_imm32(int reg32, unsigned int imm32) {
  put8(0x81);
  put8(0xE0 + reg32);
  put32(imm32);
}


x86 assembly (clang, -O0):
<and_reg32_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x81,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0xe0,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<and_reg32_imm32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x81,%edi
call   1030 <put8@plt>
add    $0xe0,%ebp
mov    %ebp,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @and_reg32_imm32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @put8(i32 129)
%6 = load i32, i32* %3
%7 = add nsw i32 224, %6
%8 = call i32 @put8(i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @put32(i32 %9)
ret void
}

LLVM IR (-O2):
define void @and_reg32_imm32(i32 %0, i32 %1) {
%3 = tail call i32 @put8(i32 129)
%4 = add nsw i32 %0, 224
%5 = tail call i32 @put8(i32 %4)
%6 = tail call i32 @put32(i32 %1)
ret void
}
int sign_extend(unsigned u, int len) {
  if (len < 32 && u > 0)
    if (u >> (len - 1) & 1)
      u |= 0xFFFFFFFF << len;
  return (int)u;
}


x86 assembly (clang, -O0):
<sign_extend>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jge    114a <sign_extend+0x4a>
cmpl   $0x0,-0x4(%rbp)
jbe    114a <sign_extend+0x4a>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
shr    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1145 <sign_extend+0x45>
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <sign_extend+0x4a>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign_extend>:
mov    %edi,%eax
test   %edi,%edi
je     1121 <sign_extend+0x21>
cmp    $0x1f,%esi
jg     1121 <sign_extend+0x21>
lea    -0x1(%rsi),%ecx
movzbl %cl,%ecx
bt     %ecx,%eax
jae    1121 <sign_extend+0x21>
mov    $0xffffffff,%edx
mov    %esi,%ecx
shl    %cl,%edx
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @sign_extend(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 32
%4 = icmp ne i32 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = add nsw i32 %1, -1
%8 = shl nuw nsw i32 1, %7
%9 = and i32 %8, %0
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = shl nsw i32 -1, %1
%13 = or i32 %12, %0
br label %14
14: ; preds = %6, %11, %2
%15 = phi i32 [ %13, %11 ], [ %0, %6 ], [ %0, %2 ]
ret i32 %15
}
/* Variables and functions */
int fb_FilePutData(int, long, void *, unsigned int, int, int /*<<< orphan*/);
int fb_FilePut(int fnum, long pos, void *value, unsigned int valuelen) {
  return fb_FilePutData(fnum, pos, value, valuelen, 1, 0);
}


x86 assembly (clang, -O0):
<fb_FilePut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <fb_FilePutData@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_FilePut>:
mov    $0x1,%r8d
xor    %r9d,%r9d
jmp    1030 <fb_FilePutData@plt>

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

LLVM IR (-O2):
define i32 @fb_FilePut(i32 %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 @fb_FilePutData(i32 %0, i64 %1, i8* %2, i32 %3, i32 1, i32 0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ toup(char *);
char *strupper(char *strung) {
  char *strindx;
  for (strindx = strung; *strindx != 0; strindx++) {
    toup(strindx);
  }
  return strung;
}


x86 assembly (clang, -O0):
<strupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114e <strupper+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <toup@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strupper+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
cmpb   $0x0,(%rdi)
je     1132 <strupper+0x22>
mov    %r14,%rbx
nop
mov    %rbx,%rdi
call   1030 <toup@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <strupper+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strupper(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = tail call i32 @toup(i8* %5)
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret i8* %0
}
int color_offset_f2(int x, int y) {
  return ((y << 10) - (((x << 10) * 393) / 373) - (5 << 10)) >> 10;
}


x86 assembly (clang, -O0):
<color_offset_f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0x189,%eax,%eax
mov    $0x175,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
sub    $0x1400,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f2>:
shl    $0xa,%esi
imul   $0x62400,%edi,%eax
cltq
imul   $0xffffffffa8266f2f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x27,%rax
add    %ecx,%eax
add    %esi,%eax
add    $0xffffec00,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 393
%10 = sdiv i32 %9, 373
%11 = sub nsw i32 %6, %10
%12 = sub nsw i32 %11, 5120
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f2(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 402432
%5 = sdiv i32 %4, -373
%6 = add i32 %3, -5120
%7 = add i32 %6, %5
%8 = ashr i32 %7, 10
ret i32 %8
}
unsigned long addStrToHash(unsigned long hash, const char *key,
                           const char *val) {
  return 0;
}


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

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

LLVM IR (-O0):
define i64 @addStrToHash(i64 %0, i8* %1, i8* %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i8*
store i64 %0, i64* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret i64 0
}

LLVM IR (-O2):
define i64 @addStrToHash(i64 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x4c() {
  Assert_real((isodigit(76) == 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_isodigit.c",
              385, ("isodigit should be 0 for L"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for L\00"
define void @t_isodigit_0x4c() {
%1 = tail call i64 @isodigit(i32 76)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 385, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ascii_char(char c) {
  if (c < ' ')
    return 0;
  if (c == 127)
    return 0;
  if (c == 255)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<ascii_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jge    1123 <ascii_char+0x23>
movl   $0x0,-0x4(%rbp)
jmp    115e <ascii_char+0x5e>
movsbl -0x5(%rbp),%eax
cmp    $0x7f,%eax
jne    113c <ascii_char+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    115e <ascii_char+0x5e>
movsbl -0x5(%rbp),%eax
cmp    $0xff,%eax
jne    1157 <ascii_char+0x57>
movl   $0x0,-0x4(%rbp)
jmp    115e <ascii_char+0x5e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_char>:
add    $0xe0,%dil
xor    %eax,%eax
cmp    $0x5f,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @ascii_char(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 32
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %19
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 127
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %19
13: ; preds = %8
%14 = load i8, i8* %3
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 255
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 0, i32* %2
br label %19
18: ; preds = %13
store i32 1, i32* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @ascii_char(i8 signext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
char *GetArg(char *prompt) {
  static char input[500];
  printf("%s", prompt);
  fgets(input, 500, stdin);
  input[strlen(input) - 1] = '\0';
  return input;
}


x86 assembly (clang, -O0):
<GetArg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
lea    0x2ef4(%rip),%rdi
mov    $0x1f4,%esi
call   1050 <fgets@plt>
lea    0x2ee3(%rip),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
movslq %eax,%rcx
lea    0x2ed1(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2ec6(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetArg>:
push   %rbx
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
lea    0x2f00(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1f4,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@GetArg.input = internal global [500 x i8] zeroinitializer
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
define i8* @GetArg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* getelementptr inbounds ([500 x i8], [500 x i8]* @GetArg.input, i64 0, i64 0), i32 500, i32 %5)
%7 = call i32 @strlen(i8* getelementptr inbounds ([500 x i8], [500 x i8]* @GetArg.input, i64 0, i64 0))
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [500 x i8], [500 x i8]* @GetArg.input, i64 0, i64 %9
store i8 0, i8* %10
ret i8* getelementptr inbounds ([500 x i8], [500 x i8]* @GetArg.input, i64 0, i64 0)
}

LLVM IR (-O2):
@GetArg.input = internal global [500 x i8] zeroinitializer
@.str = [3 x i8] c"%s\00"
@stdin = global i32 0
define i8* @GetArg(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stdin
%4 = tail call i32 @fgets(i8* getelementptr inbounds ([500 x i8], [500 x i8]* @GetArg.input, i64 0, i64 0), i32 500, i32 %3)
%5 = tail call i32 @strlen(i8* getelementptr inbounds ([500 x i8], [500 x i8]* @GetArg.input, i64 0, i64 0))
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [500 x i8], [500 x i8]* @GetArg.input, i64 0, i64 %7
store i8 0, i8* %8
ret i8* getelementptr inbounds ([500 x i8], [500 x i8]* @GetArg.input, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __be32_to_cpu(int /*<<< orphan*/);
void LOAD_OP(int I, uint32_t *W, const uint8_t *input) {
  W[I] = __be32_to_cpu(((uint32_t *)(input))[I]);
}


x86 assembly (clang, -O0):
<LOAD_OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <__be32_to_cpu@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LOAD_OP>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
movslq %edi,%rbx
mov    (%rdx,%rbx,4),%edi
call   1030 <__be32_to_cpu@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @LOAD_OP(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %7, i64 %9
%11 = load i32, i32* %10
%12 = call i32 @__be32_to_cpu(i32 %11)
%13 = load i32*, i32** %5
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 %12, i32* %16
ret void
}

LLVM IR (-O2):
define void @LOAD_OP(i32 %0, i32* nocapture writeonly %1, i32* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %2, i64 %4
%6 = load i32, i32* %5
%7 = tail call i32 @__be32_to_cpu(i32 %6)
%8 = getelementptr inbounds i32, i32* %1, i64 %4
store i32 %7, i32* %8
ret void
}
float to_floating(float num) {
  while (num >= 1)
    num /= 10;
  return num;
}


x86 assembly (clang, -O0):
<to_floating>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     113a <to_floating+0x3a>
movss  -0x4(%rbp),%xmm0
movss  0xed8(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1109 <to_floating+0x9>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_floating>:
ucomiss 0xef9(%rip),%xmm0
jb     1129 <to_floating+0x29>
movss  0xef3(%rip),%xmm1
movss  0xee7(%rip),%xmm2
nopl   0x0(%rax)
divss  %xmm1,%xmm0
ucomiss %xmm2,%xmm0
jae    1120 <to_floating+0x20>
ret

LLVM IR (-O0):
define float @to_floating(float %0) {
%2 = alloca float
store float %0, float* %2
br label %3
3: ; preds = %6, %1
%4 = load float, float* %2
%5 = fcmp oge float %4, 1.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load float, float* %2
%8 = fdiv float %7, 1.000000e+01
store float %8, float* %2
br label %3
9: ; preds = %3
%10 = load float, float* %2
ret float %10
}

LLVM IR (-O2):
define float @to_floating(float %0) {
%2 = fcmp ult float %0, 1.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi float [ %5, %3 ], [ %0, %1 ]
%5 = fdiv float %4, 1.000000e+01
%6 = fcmp ult float %5, 1.000000e+00
br i1 %6, label %7, label %3
7: ; preds = %3, %1
%8 = phi float [ %0, %1 ], [ %5, %3 ]
ret float %8
}
void g_signal_handler_unblock() {}


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

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

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

LLVM IR (-O2):
define void @g_signal_handler_unblock() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int64_t OriginalLengthRead(FILE *message) {
  int64_t length;
  if (fread(&length, sizeof(int64_t), 1, message) != 1) {
    printf("error on input reading\n");
    return 0;
  }
  return length;
}


x86 assembly (clang, -O0):
<OriginalLengthRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     1164 <OriginalLengthRead+0x44>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116a <OriginalLengthRead+0x4a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OriginalLengthRead>:
push   %rax
mov    %rdi,%rcx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fread@plt>
cmp    $0x1,%eax
jne    1143 <OriginalLengthRead+0x23>
mov    0x4(%rsp),%eax
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [23 x i8] c"error on input reading\00"
define i32 @OriginalLengthRead(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fread(i32* %2, i32 4, i32 1, i32* %0)
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ 0, %6 ], [ %9, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ SetConfigReg(int, unsigned int);
void writeFpgaGrb(int addr, unsigned int value) {
  SetConfigReg(0xf9000000 + addr, value);
}


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

x86 assembly (clang, -O2):
<writeFpgaGrb>:
add    $0xf9000000,%edi
jmp    1030 <SetConfigReg@plt>

LLVM IR (-O0):
define void @writeFpgaGrb(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 = add i32 -117440512, %5
%7 = load i32, i32* %4
%8 = call i32 @SetConfigReg(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @writeFpgaGrb(i32 %0, i32 %1) {
%3 = add i32 %0, -117440512
%4 = tail call i32 @SetConfigReg(i32 %3, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
gid_t getgid() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getgid() {
ret i32 0
}
unsigned long get_syssts_reg(int port) { return port == 0 ? 0x04 : 0x06; }


x86 assembly (clang, -O0):
<get_syssts_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x6,%eax
mov    $0x4,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_syssts_reg>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
add    %rax,%rax
add    $0x4,%rax
ret

LLVM IR (-O0):
define i64 @get_syssts_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 4, i32 6
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @get_syssts_reg(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i64 4, i64 6
ret i64 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg16setBank0(int);
void m71_setParamsCXXX(uint16_t addr, uint8_t val) {
  (void)addr;
  prg16setBank0((val & 0xF) << 14);
}


x86 assembly (clang, -O0):
<m71_setParamsCXXX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0xf,%edi
shl    $0xe,%edi
call   1030 <prg16setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m71_setParamsCXXX>:
mov    %esi,%edi
and    $0xf,%edi
shl    $0xe,%edi
jmp    1030 <prg16setBank0@plt>

LLVM IR (-O0):
define void @m71_setParamsCXXX(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 = and i32 %6, 15
%8 = shl i32 %7, 14
%9 = call i32 @prg16setBank0(i32 %8)
ret void
}

LLVM IR (-O2):
define void @m71_setParamsCXXX(i32 %0, i32 %1) {
%3 = shl i32 %1, 14
%4 = and i32 %3, 245760
%5 = tail call i32 @prg16setBank0(i32 %4)
ret void
}
void amd64_set_fsbase(void *p) {}


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

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

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

LLVM IR (-O2):
define void @amd64_set_fsbase(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep_ms(int);
void loop() { sleep_ms((100)); }


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

x86 assembly (clang, -O2):
<loop>:
mov    $0x64,%edi
jmp    1030 <sleep_ms@plt>

LLVM IR (-O0):
define void @loop() {
%1 = call i32 @sleep_ms(i32 100)
ret void
}

LLVM IR (-O2):
define void @loop() {
%1 = tail call i32 @sleep_ms(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StartDiscount(int);
void dxl_hal_set_timeout(int NumRcvByte) { StartDiscount(NumRcvByte * 100); }


x86 assembly (clang, -O0):
<dxl_hal_set_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x64,-0x4(%rbp),%edi
call   1030 <StartDiscount@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dxl_hal_set_timeout>:
imul   $0x64,%edi,%edi
jmp    1030 <StartDiscount@plt>

LLVM IR (-O0):
define void @dxl_hal_set_timeout(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 100
%5 = call i32 @StartDiscount(i32 %4)
ret void
}

LLVM IR (-O2):
define void @dxl_hal_set_timeout(i32 %0) {
%2 = mul nsw i32 %0, 100
%3 = tail call i32 @StartDiscount(i32 %2)
ret void
}
unsigned int _uiGetKey(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @_uiGetKey() {
ret i32 0
}