xunge/DecIR huggingface dataset:
/* Variables and functions */
int execute_command2(char, char *, char, char, int /*<<< orphan*/);
int execute_command(char cmd, char cmd2, char type) {
  return execute_command2(cmd, ".", type, cmd2, 0);
}


x86 assembly (clang, -O0):
<execute_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x3(%rbp),%al
lea    0xeca(%rip),%rsi
xor    %r8d,%r8d
movsbl %cl,%edi
movsbl %al,%edx
movsbl -0x2(%rbp),%ecx
call   1030 <execute_command2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_command>:
mov    %esi,%ecx
lea    0xee7(%rip),%rsi
xor    %r8d,%r8d
jmp    1030 <execute_command2@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i32 @execute_command(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = load i8, i8* %6
%9 = load i8, i8* %5
%10 = call i32 @execute_command2(i8 signext %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8 signext %8, i8 signext %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @execute_command(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @execute_command2(i8 signext %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8 signext %2, i8 signext %1, i32 0)
ret i32 %4
}
/* Variables and functions */
char *strstr(char *, char *);
int stable_locus_id(char *txtline, char *what2search) {
  char *search_string;
  int gotit;
  search_string = strstr(txtline, what2search);
  if (search_string == NULL) {
    gotit = 0;
  } else {
    gotit = 1;
  }
  return gotit;
}


x86 assembly (clang, -O0):
<stable_locus_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1148 <stable_locus_id+0x38>
movl   $0x0,-0x1c(%rbp)
jmp    114f <stable_locus_id+0x3f>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stable_locus_id>:
push   %rax
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @stable_locus_id(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
void emit_let(struct processor_explicatory_state *process_state,
              struct modern_stream *stream, void *stream_state,
              struct modern_vfile *vfile, void *vfile_state) {}


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

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_let(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_let(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_16(int /*<<< orphan*/);
uint16_t big16(uint16_t n) { return bswap_16(n); }


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

x86 assembly (clang, -O2):
<big16>:
jmp    1030 <bswap_16@plt>

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

LLVM IR (-O2):
define i32 @big16(i32 %0) {
%2 = tail call i32 @bswap_16(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ mexErrMsgTxt(char *);
void ftnstop(char *msg) {
  if (msg != NULL)
    mexErrMsgTxt("exiting Ranlib with error");
  exit(0);
}


x86 assembly (clang, -O0):
<ftnstop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1143 <ftnstop+0x23>
lea    0xec2(%rip),%rdi
call   1030 <mexErrMsgTxt@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ftnstop>:
push   %rax
test   %rdi,%rdi
je     1132 <ftnstop+0x12>
lea    0xed3(%rip),%rdi
call   1030 <mexErrMsgTxt@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"exiting Ranlib with error\00"
define void @ftnstop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @mexErrMsgTxt(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"exiting Ranlib with error\00"
define void @ftnstop(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @mexErrMsgTxt(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test_basic();
int /*<<< orphan*/ test_trr();
int /*<<< orphan*/ test_xtc();
int main(int argc, char *argv[]) {
  test_basic();
  test_xtc();
  test_trr();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <test_basic@plt>
mov    $0x0,%al
call   1030 <test_xtc@plt>
mov    $0x0,%al
call   1040 <test_trr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_basic()
%7 = call i32 (...) @test_xtc()
%8 = call i32 (...) @test_trr()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_basic()
%4 = tail call i32 (...) @test_xtc()
%5 = tail call i32 (...) @test_trr()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ internal();
int /*<<< orphan*/ invalid();
int /*<<< orphan*/ null();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ resize();
int /*<<< orphan*/ simple();
int /*<<< orphan*/ sizing();
int main(void) {
  simple();
  init();
  resize();
  sizing();
  null();
  invalid();
  internal();
  puts("\noverall testing success!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <simple@plt>
mov    $0x0,%al
call   1080 <init@plt>
mov    $0x0,%al
call   1050 <resize@plt>
mov    $0x0,%al
call   1030 <sizing@plt>
mov    $0x0,%al
call   1070 <null@plt>
mov    $0x0,%al
call   10a0 <invalid@plt>
mov    $0x0,%al
call   1090 <internal@plt>
lea    0xe39(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <simple@plt>
xor    %eax,%eax
call   1080 <init@plt>
xor    %eax,%eax
call   1050 <resize@plt>
xor    %eax,%eax
call   1030 <sizing@plt>
xor    %eax,%eax
call   1070 <null@plt>
xor    %eax,%eax
call   10a0 <invalid@plt>
xor    %eax,%eax
call   1090 <internal@plt>
lea    0xe47(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"\0Aoverall testing success!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @simple()
%3 = call i32 (...) @init()
%4 = call i32 (...) @resize()
%5 = call i32 (...) @sizing()
%6 = call i32 (...) @null()
%7 = call i32 (...) @invalid()
%8 = call i32 (...) @internal()
%9 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0Aoverall testing success!\00"
define i32 @main() {
%1 = tail call i32 (...) @simple()
%2 = tail call i32 (...) @init()
%3 = tail call i32 (...) @resize()
%4 = tail call i32 (...) @sizing()
%5 = tail call i32 (...) @null()
%6 = tail call i32 (...) @invalid()
%7 = tail call i32 (...) @internal()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double strtod(char const *, char **);
size_t strToDouble(const char *str, double *val) {
  char *endptr;
  *val = strtod(str, &endptr);
  return endptr - str;
}


x86 assembly (clang, -O0):
<strToDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <strtod@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strToDouble>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
call   1030 <strtod@plt>
movsd  %xmm0,(%r14)
mov    (%rsp),%rax
sub    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @strToDouble(i8* %0, double* %1) {
%3 = alloca i8*
%4 = alloca double*
%5 = alloca i8*
store i8* %0, i8** %3
store double* %1, double** %4
%6 = load i8*, i8** %3
%7 = call double @strtod(i8* %6, i8** %5)
%8 = load double*, double** %4
store double %7, double* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = ptrtoint i8* %9 to i64
%12 = ptrtoint i8* %10 to i64
%13 = sub i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @strToDouble(i8* %0, double* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call double @strtod(i8* %0, i8** %3)
store double %5, double* %1
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %7, %8
ret i64 %9
}
/* Variables and functions */
scalar_t__ divideA(unsigned long long, unsigned long long);
scalar_t__ sqrt(unsigned long long);
bool esPrimo(unsigned long long numero) {
  unsigned long long i;
  for (i = 2; (unsigned long long)(sqrt(numero)) >= i; ++i) {
    if (divideA(numero, i)) {
      return false;
    }
  }
  return true;
}


x86 assembly (clang, -O0):
<esPrimo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <sqrt@plt>
cmp    -0x18(%rbp),%rax
jb     1180 <esPrimo+0x60>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <divideA@plt>
cmp    $0x0,%rax
je     116a <esPrimo+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1187 <esPrimo+0x67>
jmp    116f <esPrimo+0x4f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <esPrimo+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esPrimo>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1040 <sqrt@plt>
mov    $0x1,%r14d
cmp    $0x2,%rax
jb     1166 <esPrimo+0x46>
mov    $0x2,%ebp
nopl   (%rax)
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <divideA@plt>
test   %rax,%rax
jne    1163 <esPrimo+0x43>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1040 <sqrt@plt>
cmp    %rbp,%rax
jae    1140 <esPrimo+0x20>
jmp    1166 <esPrimo+0x46>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @esPrimo(i64 %0) {
%2 = tail call i64 @sqrt(i64 %0)
%3 = icmp ult i64 %2, 2
br i1 %3, label %12, label %7
4: ; preds = %7
%5 = tail call i64 @sqrt(i64 %0)
%6 = icmp ult i64 %5, %11
br i1 %6, label %12, label %7
7: ; preds = %1, %4
%8 = phi i64 [ %11, %4 ], [ 2, %1 ]
%9 = tail call i64 @divideA(i64 %0, i64 %8)
%10 = icmp eq i64 %9, 0
%11 = add i64 %8, 1
br i1 %10, label %4, label %12
12: ; preds = %7, %4, %1
%13 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ matrica(int **, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  int niz[10][10];
  printf("Unesite n: ");
  scanf("%d", &n);
  matrica(niz, n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x1a8,%rsp
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0x10(%rsp),%rdi
call   1030 <matrica@plt>
xor    %eax,%eax
add    $0x1a8,%rsp
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"Unesite n: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [10 x i32]]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [10 x [10 x i32]]* %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = bitcast [10 x [10 x i32]]* %2 to i32**
%8 = load i32, i32* %1
%9 = call i32 @matrica(i32** %7, i32 %8)
ret i32 0
}
void DMA2_Stream3_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @DMA2_Stream3_IRQHandler() {
ret void
}
int SomeFunction(x, c)
int x;
char c;
{
  printf("x = %d\n", x);
  printf("c = %s\n", &c);
  return 0;
}


x86 assembly (clang, -O0):
<SomeFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SomeFunction>:
push   %rax
mov    %edi,%eax
mov    %sil,0x7(%rsp)
lea    0xee1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0x7(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"x = %d\0A\00"
@.str.1 = [8 x i8] c"c = %s\0A\00"
define i32 @SomeFunction(i32 %0, i32 %1) {
%3 = alloca i8
%4 = trunc i32 %1 to i8
store i8 %4, i8* %3
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
float rand_uniform(float min, float max) {
  if (max < min) {
    float swap = min;
    min = max;
    max = swap;
  }
  return ((float)rand() / RAND_MAX * (max - min)) + min;
}


x86 assembly (clang, -O0):
<rand_uniform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1153 <rand_uniform+0x43>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2e82(%rip),%rax
divss  (%rax),%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_uniform>:
push   %rax
movaps %xmm0,%xmm2
maxss  %xmm1,%xmm2
movss  %xmm2,0x4(%rsp)
minss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
mov    0x2eab(%rip),%rax
divss  (%rax),%xmm1
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm2
subss  %xmm2,%xmm0
mulss  %xmm1,%xmm0
addss  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @rand_uniform(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %4
%7 = load float, float* %3
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load float, float* %3
store float %10, float* %5
%11 = load float, float* %4
store float %11, float* %3
%12 = load float, float* %5
store float %12, float* %4
br label %13
13: ; preds = %9, %2
%14 = call i64 (...) @rand()
%15 = sitofp i64 %14 to float
%16 = load float, float* @RAND_MAX
%17 = fdiv float %15, %16
%18 = load float, float* %4
%19 = load float, float* %3
%20 = fsub float %18, %19
%21 = load float, float* %3
%22 = call float @llvm.fmuladd.f32(float %17, float %20, float %21)
ret float %22
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @rand_uniform(float %0, float %1) {
%3 = fcmp olt float %1, %0
%4 = select i1 %3, float %0, float %1
%5 = select i1 %3, float %1, float %0
%6 = tail call i64 (...) @rand()
%7 = sitofp i64 %6 to float
%8 = load float, float* @RAND_MAX
%9 = fdiv float %7, %8
%10 = fsub float %4, %5
%11 = tail call float @llvm.fmuladd.f32(float %9, float %10, float %5)
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xb8() {
  Assert_real((isdigit(184) == 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_isdigit.c",
              925, ("isdigit should be 0 for 0xb8"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xb8>:
push   %rax
mov    $0xb8,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x39d,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xb8\00"
define void @t_isdigit_0xb8() {
%1 = call i64 @isdigit(i32 184)
%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 925, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xb8\00"
define void @t_isdigit_0xb8() {
%1 = tail call i64 @isdigit(i32 184)
%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 925, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int NumberPairs(int n) {
  if (n < 1)
    return -1;
  return (((n - 1) * n) / 2);
}


x86 assembly (clang, -O0):
<NumberPairs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    111d <NumberPairs+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1132 <NumberPairs+0x32>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
imul   -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumberPairs>:
test   %edi,%edi
jle    1114 <NumberPairs+0x14>
lea    -0x1(%rdi),%ecx
imul   %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @NumberPairs(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = mul nsw i32 %4, %0
%6 = sdiv i32 %5, 2
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -1, %1 ]
ret i32 %8
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XMappingEvent;

/* Variables and functions */
void set_XMappingEvent_serial(void *_p, unsigned long _v) {
  ((XMappingEvent *)_p)->serial = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XMappingEvent_serial>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XMappingEvent_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XMappingEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_clear_standard_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(27, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_clear_standard_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1b,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_clear_standard_system>:
mov    $0x1b,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syscon_clear_standard_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 27, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_clear_standard_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 27, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
unsigned bit_clear(unsigned w, int n) { return ~bit(n) & w; }


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

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

LLVM IR (-O0):
define i32 @bit_clear(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 (i32, ...) bitcast (i32 (...)* @bit to i32 (i32, ...)*)(i32 %5)
%7 = xor i32 %6, -1
%8 = load i32, i32* %3
%9 = and i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @bit_clear(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @bit to i32 (i32, ...)*)(i32 %1)
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
double my_sqrt(double);
float vector_size(float x, float y) {
  double result = my_sqrt((double)x * x + (double)y * y);
  return (float)result;
}


x86 assembly (clang, -O0):
<vector_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x8(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <my_sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_size>:
push   %rax
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
call   1030 <my_sqrt@plt>
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @vector_size(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca double
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = fmul double %11, %13
%15 = call double @llvm.fmuladd.f64(double %7, double %9, double %14)
%16 = call double @my_sqrt(double %15)
store double %16, double* %5
%17 = load double, double* %5
%18 = fptrunc double %17 to float
ret float %18
}

LLVM IR (-O2):
define float @vector_size(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fpext float %1 to double
%5 = fmul double %4, %4
%6 = tail call double @llvm.fmuladd.f64(double %3, double %3, double %5)
%7 = tail call double @my_sqrt(double %6)
%8 = fptrunc double %7 to float
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ dropTrSuite();
int /*<<< orphan*/ initVar(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void newVar(char *S) {
  char Lib[24 + 1];
  strncpy(Lib, S, 24);
  Lib[24] = '\0';
  initVar(Lib);
  dropTrSuite();
}


x86 assembly (clang, -O0):
<newVar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x18,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <initVar@plt>
mov    $0x0,%al
call   1050 <dropTrSuite@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newVar>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x18,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x18(%rsp)
mov    %rbx,%rdi
call   1040 <initVar@plt>
xor    %eax,%eax
call   1050 <dropTrSuite@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @newVar(i8* %0) {
%2 = alloca i8*
%3 = alloca [25 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 24)
%7 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 24
store i8 0, i8* %7
%8 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%9 = call i32 @initVar(i8* %8)
%10 = call i32 (...) @dropTrSuite()
ret void
}

LLVM IR (-O2):
define void @newVar(i8* %0) {
%2 = alloca [25 x i8]
%3 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 24)
%5 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 24
store i8 0, i8* %5
%6 = call i32 @initVar(i8* %3)
%7 = call i32 (...) @dropTrSuite()
ret void
}
void nseel_asm_stack_push(void) {
  __asm__("movl $0xfefefefe, %edi\n"
          "movl (%eax), %ecx\n"
          "movl 4(%eax), %edx\n"
          "movl (%edi), %eax\n"
          "addl $8, %eax\n"
          "andl $0xfefefefe, %eax\n"
          "orl $0xfefefefe, %eax\n"
          "movl %ecx, (%eax)\n"
          "movl %edx, 4(%eax)\n"
          "movl %eax, (%edi)\n");
}


x86 assembly (clang, -O0):
<nseel_asm_stack_push>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfefefefe,%edi
mov    (%eax),%ecx
mov    0x4(%eax),%edx
mov    (%edi),%eax
add    $0x8,%eax
and    $0xfefefefe,%eax
or     $0xfefefefe,%eax
mov    %ecx,(%eax)
mov    %edx,0x4(%eax)
mov    %eax,(%edi)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_stack_push>:
mov    $0xfefefefe,%edi
mov    (%eax),%ecx
mov    0x4(%eax),%edx
mov    (%edi),%eax
add    $0x8,%eax
and    $0xfefefefe,%eax
or     $0xfefefefe,%eax
mov    %ecx,(%eax)
mov    %edx,0x4(%eax)
mov    %eax,(%edi)
ret

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

LLVM IR (-O2):
define void @nseel_asm_stack_push() {
tail call void asm sideeffect "movl $$0xfefefefe, %edi\0Amovl (%eax), %ecx\0Amovl 4(%eax), %edx\0Amovl (%edi), %eax\0Aaddl $$8, %eax\0Aandl $$0xfefefefe, %eax\0Aorl $$0xfefefefe, %eax\0Amovl %ecx, (%eax)\0Amovl %edx, 4(%eax)\0Amovl %eax, (%edi)\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
IR0I1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((*p0) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<IR0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzwl (%rax),%eax
cmp    $0x21,%eax
jg     113b <IR0I1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <IR0I1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0I1>:
xor    %eax,%eax
cmpw   $0x22,(%r8)
setb   %al
ret

LLVM IR (-O0):
define i32 @IR0I1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = load i16, i16* %16
%18 = zext i16 %17 to i32
%19 = icmp sle i32 %18, 33
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @IR0I1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = load i16, i16* %4
%8 = icmp ult i16 %7, 34
%9 = zext i1 %8 to i32
ret i32 %9
}
int divpwr2(int x, int n) { return 2; }


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

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

LLVM IR (-O0):
define i32 @divpwr2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 2
}

LLVM IR (-O2):
define i32 @divpwr2(i32 %0, i32 %1) {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, int);
void cbm_iec_release(int f, int line) { ioctl(f, _IO(0xcb, 14), line); }


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

x86 assembly (clang, -O2):
<cbm_iec_release>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xcb,%edi
mov    $0xe,%esi
call   1030 <_IO@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define void @cbm_iec_release(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 = call i32 @_IO(i32 203, i32 14)
%7 = load i32, i32* %4
%8 = call i32 @ioctl(i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @cbm_iec_release(i32 %0, i32 %1) {
%3 = tail call i32 @_IO(i32 203, i32 14)
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
ret void
}
/* Variables and functions */
int setresgid(int, int, int);
int main(void) { return setresgid(-1, -1, -1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <setresgid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
jmp    1030 <setresgid@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @setresgid(i32 -1, i32 -1, i32 -1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ custom_logger(char *);
void int_handler(int signum) { custom_logger("got signal"); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"got signal\00"
define void @int_handler(i32 %0) {
%2 = tail call i32 @custom_logger(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
void swr_free() {}


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

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

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

LLVM IR (-O2):
define void @swr_free() {
ret void
}
int strlen(string)
register char *string;
{
  register char *ret = string;
  while (*string++)
    ;
  return string - 1 - ret;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     112d <strlen+0x2d>
jmp    1110 <strlen+0x10>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i32 @strlen(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 = %10, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%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** %2
%13 = getelementptr inbounds i8, i8* %12, i64 -1
%14 = load i8*, i8** %3
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, ...);
void C_Ret(void) {
  Inst_Printf("addq", "$%d,%%rsp", 32 * 8);
  Inst_Printf("popq", "%%rbx");
  Inst_Printf("ret", "");
}


x86 assembly (clang, -O0):
<C_Ret>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee3(%rip),%rsi
mov    $0x100,%edx
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
lea    0xeda(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
lea    0xed0(%rip),%rdi
lea    0xebd(%rip),%rsi
mov    $0x0,%al
call   1030 <Inst_Printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_Ret>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee6(%rip),%rsi
mov    $0x100,%edx
xor    %eax,%eax
call   1030 <Inst_Printf@plt>
lea    0xedd(%rip),%rdi
lea    0xedb(%rip),%rsi
xor    %eax,%eax
call   1030 <Inst_Printf@plt>
lea    0xed3(%rip),%rdi
lea    0xec0(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"addq\00"
@.str.1 = [10 x i8] c"$%d,%%rsp\00"
@.str.2 = [5 x i8] c"popq\00"
@.str.3 = [6 x i8] c"%%rbx\00"
@.str.4 = [4 x i8] c"ret\00"
@.str.5 = [1 x i8] zeroinitializer
define void @C_Ret() {
%1 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 256)
%2 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"addq\00"
@.str.1 = [10 x i8] c"$%d,%%rsp\00"
@.str.2 = [5 x i8] c"popq\00"
@.str.3 = [6 x i8] c"%%rbx\00"
@.str.4 = [4 x i8] c"ret\00"
@.str.5 = [1 x i8] zeroinitializer
define void @C_Ret() {
%1 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 256)
%2 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, i8*, ...) @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
ret void
}
const char *mg_version(void) { return "3.4"; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
void put32(long w, FILE *fh) {
  putc((char)(w), fh);
  putc((char)(w >> 8l), fh);
  putc((char)(w >> 16l), fh);
  putc((char)(w >> 24l), fh);
}


x86 assembly (clang, -O0):
<put32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rax
sar    $0x8,%rax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rax
sar    $0x10,%rax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rax
sar    $0x18,%rax
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsbl %bl,%edi
call   1030 <putc@plt>
mov    %ebx,%eax
shr    $0x8,%eax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
sar    $0x18,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @put32(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i8
%7 = load i32*, i32** %4
%8 = call i32 @putc(i8 signext %6, i32* %7)
%9 = load i64, i64* %3
%10 = ashr i64 %9, 8
%11 = trunc i64 %10 to i8
%12 = load i32*, i32** %4
%13 = call i32 @putc(i8 signext %11, i32* %12)
%14 = load i64, i64* %3
%15 = ashr i64 %14, 16
%16 = trunc i64 %15 to i8
%17 = load i32*, i32** %4
%18 = call i32 @putc(i8 signext %16, i32* %17)
%19 = load i64, i64* %3
%20 = ashr i64 %19, 24
%21 = trunc i64 %20 to i8
%22 = load i32*, i32** %4
%23 = call i32 @putc(i8 signext %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @put32(i64 %0, i32* nocapture %1) {
%3 = trunc i64 %0 to i8
%4 = tail call i32 @putc(i8 signext %3, i32* %1)
%5 = lshr i64 %0, 8
%6 = trunc i64 %5 to i8
%7 = tail call i32 @putc(i8 signext %6, i32* %1)
%8 = lshr i64 %0, 16
%9 = trunc i64 %8 to i8
%10 = tail call i32 @putc(i8 signext %9, i32* %1)
%11 = lshr i64 %0, 24
%12 = trunc i64 %11 to i8
%13 = tail call i32 @putc(i8 signext %12, i32* %1)
ret void
}
/* Variables and functions */
#define ECONNREFUSED 138
#define ECONNRESET 137
#define EHOSTDOWN 136
#define EHOSTUNREACH 135
#define ENETDOWN 134
#define ENETUNREACH 133
#define ENONET 132
#define ENOPROTOOPT 131
#define EOPNOTSUPP 130
#define EPROTO 129
#define ETIMEDOUT 128
bool is_network_error(int err) {
  switch (err) {
  case ENETDOWN:
  case EPROTO:
  case ENOPROTOOPT:
  case EHOSTDOWN:
  case ENONET:
  case EHOSTUNREACH:
  case EOPNOTSUPP:
  case ECONNREFUSED:
  case ENETUNREACH:
  case ECONNRESET:
  case ETIMEDOUT:
    return true;
  default:
    return false;
  }
}


x86 assembly (clang, -O0):
<is_network_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
sub    $0xa,%eax
ja     1127 <is_network_error+0x27>
jmp    111b <is_network_error+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    112e <is_network_error+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_network_error>:
add    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0xb,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_network_error(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 134, label %5
i32 129, label %5
i32 131, label %5
i32 136, label %5
i32 132, label %5
i32 135, label %5
i32 130, label %5
i32 138, label %5
i32 133, label %5
i32 137, label %5
i32 128, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_network_error(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 11
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void removeQuicksave(void) { remove("/sdcard/elementworks/quicksave.txt"); }


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"/sdcard/elementworks/quicksave.txt\00"
define void @removeQuicksave() {
%1 = call i32 @remove(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"/sdcard/elementworks/quicksave.txt\00"
define void @removeQuicksave() {
%1 = tail call i32 @remove(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}