xunge/DecIR huggingface dataset:
/* Variables and functions */
int strnlen(const char *src, int n) {
  int i = 0;
  while (i < n) {
    if (src[i] == 0)
      return i;
    i++;
  }
  return n;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114c <strnlen+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    113e <strnlen+0x3e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <strnlen+0x52>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <strnlen+0x12>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
mov    %esi,%eax
test   %esi,%esi
jle    111f <strnlen+0x1f>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rcx,1)
je     1120 <strnlen+0x20>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <strnlen+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strnlen(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 0, i32* %6
br label %7
7: ; preds = %21, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %11
%20 = load i32, i32* %6
store i32 %20, i32* %3
br label %26
21: ; preds = %11
%22 = load i32, i32* %6
%23 = add nsw i32 %22, 1
store i32 %23, i32* %6
br label %7
24: ; preds = %7
%25 = load i32, i32* %5
store i32 %25, i32* %3
br label %26
26: ; preds = %24, %19
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @strnlen(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %11
%7 = phi i64 [ 0, %4 ], [ %12, %11 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %16, label %6
14: ; preds = %6
%15 = trunc i64 %7 to i32
br label %16
16: ; preds = %11, %14, %2
%17 = phi i32 [ %1, %2 ], [ %15, %14 ], [ %1, %11 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
scalar_t__ validade(char *);
int main() {
  char S[40];
  fgets(S, 40, stdin);
  printf(validade(S) ? "Senha valida.\n" : "Senha invalida.\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
mov    $0x28,%esi
call   1050 <fgets@plt>
lea    -0x30(%rbp),%rdi
call   1030 <validade@plt>
mov    %rax,%rcx
lea    0xead(%rip),%rdi
lea    0xe97(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x28,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <validade@plt>
test   %rax,%rax
lea    0xeaf(%rip),%rax
lea    0xe99(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [15 x i8] c"Senha valida.\0A\00"
@.str.1 = [17 x i8] c"Senha invalida.\0A\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 40, i32 %3)
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%6 = call i64 @validade(i8* %5)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0)
%10 = call i32 @printf(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [15 x i8] c"Senha valida.\0A\00"
@.str.1 = [17 x i8] c"Senha invalida.\0A\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 40, i32 %3)
%5 = call i64 @validade(i8* %2)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert_equal_str(int /*<<< orphan*/ *, char *, char *,
                                    char *);
char *pl_slice(char *, int, int);
void test_slice_offset_oor() {
  char the_string[] = "spam, eggs, and ham";
  char *ret_val;
  ret_val = pl_slice(the_string, 99, 199);
  assert_equal_str(NULL, ret_val, "test_slice_offset_oor",
                   "The ret_val was not NULL");
}


x86 assembly (clang, -O0):
<test_slice_offset_oor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x63,%esi
mov    $0xc7,%edx
call   1040 <pl_slice@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
lea    0xea7(%rip),%rdx
lea    0xeb6(%rip),%rcx
call   1030 <assert_equal_str@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_slice_offset_oor>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x6d6168,0x10(%rsp)
mov    %rsp,%rdi
mov    $0x63,%esi
mov    $0xc7,%edx
call   1040 <pl_slice@plt>
lea    0xec4(%rip),%rdx
lea    0xed3(%rip),%rcx
xor    %edi,%edi
mov    %rax,%rsi
call   1030 <assert_equal_str@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_slice_offset_oor.the_string = [20 x i8] c"spam, eggs, and ham\00"
@.str = [22 x i8] c"test_slice_offset_oor\00"
@.str.1 = [25 x i8] c"The ret_val was not NULL\00"
define void @test_slice_offset_oor() {
%1 = alloca [20 x i8]
%2 = alloca i8*
%3 = bitcast [20 x i8]* %1 to i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i8* @pl_slice(i8* %4, i32 99, i32 199)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @assert_equal_str(i32* null, i8* %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.test_slice_offset_oor.the_string = [20 x i8] c"spam, eggs, and ham\00"
@.str = [22 x i8] c"test_slice_offset_oor\00"
@.str.1 = [25 x i8] c"The ret_val was not NULL\00"
define void @test_slice_offset_oor() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i8* @pl_slice(i8* %2, i32 99, i32 199)
%4 = call i32 @assert_equal_str(i32* null, i8* %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void chipcon_open(void) {}


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

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

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

LLVM IR (-O2):
define void @chipcon_open() {
ret void
}
int Ginitgraphics(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Ginitgraphics() {
ret i32 0
}
/* Variables and functions */
int getFilaConflictoEnColumna(int **, int, int);
int tieneConflictoEnEstaColumna(int sudoku[9][9], int jj, int candidato) {
  if (getFilaConflictoEnColumna(sudoku, jj, candidato) != -1) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tieneConflictoEnEstaColumna>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <getFilaConflictoEnColumna@plt>
cmp    $0xffffffff,%eax
je     1146 <tieneConflictoEnEstaColumna+0x36>
movl   $0x1,-0x4(%rbp)
jmp    114d <tieneConflictoEnEstaColumna+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tieneConflictoEnEstaColumna>:
push   %rax
call   1030 <getFilaConflictoEnColumna@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @tieneConflictoEnEstaColumna([9 x i32]* %0, i32 %1, i32 %2) {
%4 = bitcast [9 x i32]* %0 to i32**
%5 = tail call i32 @getFilaConflictoEnColumna(i32** %4, i32 %1, i32 %2)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
ret i32 %7
}
void foo515(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo515(i32 %0) {
ret void
}
/* Variables and functions */
int clock();
int time(void) { return (clock() >> 10); }


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
sar    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @time() {
%1 = call i32 (...) @clock()
%2 = ashr i32 %1, 10
ret i32 %2
}

LLVM IR (-O2):
define i32 @time() {
%1 = tail call i32 (...) @clock()
%2 = ashr i32 %1, 10
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/, int);
void test_parentheses(int a, int b) {
  __emit_expression_range(0, (a + b));
  __emit_expression_range(0, (a + b) * (a - b));
  __emit_expression_range(0, !(a && b));
}


x86 assembly (clang, -O0):
<test_parentheses>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
imul   %eax,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     115a <test_parentheses+0x4a>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_parentheses>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebx
lea    (%r14,%rbx,1),%ebp
xor    %edi,%edi
mov    %ebp,%esi
call   1030 <__emit_expression_range@plt>
mov    %ebx,%esi
sub    %r14d,%esi
imul   %ebp,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
test   %ebx,%ebx
sete   %al
test   %r14d,%r14d
sete   %cl
or     %al,%cl
movzbl %cl,%esi
xor    %edi,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_parentheses(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = call i32 @__emit_expression_range(i32 0, i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = sub nsw i32 %12, %13
%15 = mul nsw i32 %11, %14
%16 = call i32 @__emit_expression_range(i32 0, i32 %15)
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %2
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 0
br label %22
22: ; preds = %19, %2
%23 = phi i1 [ false, %2 ], [ %21, %19 ]
%24 = xor i1 %23, true
%25 = zext i1 %24 to i32
%26 = call i32 @__emit_expression_range(i32 0, i32 %25)
ret void
}

LLVM IR (-O2):
define void @test_parentheses(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @__emit_expression_range(i32 0, i32 %3)
%5 = sub nsw i32 %0, %1
%6 = mul nsw i32 %3, %5
%7 = tail call i32 @__emit_expression_range(i32 0, i32 %6)
%8 = icmp eq i32 %0, 0
%9 = icmp eq i32 %1, 0
%10 = or i1 %8, %9
%11 = zext i1 %10 to i32
%12 = tail call i32 @__emit_expression_range(i32 0, i32 %11)
ret void
}
unsigned xrop3_125_1_0(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;
  stk2 = ~stk2;
  stk1 = D & stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_125_1_0>:
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    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
and    -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    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_125_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
xor    %edi,%esi
lea    -0x100(%rsi),%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_125_1_0(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* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %5
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = xor i32 %30, -1
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = and i32 %36, %37
%39 = or i32 %35, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @xrop3_125_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i8 %1, %0
%6 = zext i8 %5 to i32
%7 = or i32 %6, -256
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = or i32 %9, %3
ret i32 %10
}
int Hex2Dec(c) {
  c = toupper(c);
  if (c > '9')
    return c - 'A' + 10;
  return c - '0';
}


x86 assembly (clang, -O0):
<Hex2Dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x39,-0x8(%rbp)
jle    1141 <Hex2Dec+0x31>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    114a <Hex2Dec+0x3a>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hex2Dec>:
push   %rax
call   1030 <toupper@plt>
lea    -0x30(%rax),%edx
lea    -0x37(%rax),%ecx
cmp    $0x3a,%eax
cmovl  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Hex2Dec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @toupper(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 57
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 65
%11 = add nsw i32 %10, 10
store i32 %11, i32* %2
br label %15
12: ; preds = %1
%13 = load i32, i32* %3
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @Hex2Dec(i32 %0) {
%2 = tail call i32 @toupper(i32 %0)
%3 = icmp sgt i32 %2, 57
%4 = select i1 %3, i32 -55, i32 -48
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x32() {
  Assert_real((ispunct(50) == 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_ispunct.c",
              255, ("ispunct should be 0 for 2"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x32>:
push   %rax
mov    $0x32,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xff,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for 2\00"
define void @t_ispunct_0x32() {
%1 = call i64 @ispunct(i32 50)
%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 255, i8* getelementptr inbounds ([26 x i8], [26 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for 2\00"
define void @t_ispunct_0x32() {
%1 = tail call i64 @ispunct(i32 50)
%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 255, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EPOLLET;
int EPOLLIN;
int /*<<< orphan*/ kore_platform_event_schedule(int, int, int /*<<< orphan*/,
                                                void *);
void kore_platform_schedule_read(int fd, void *data) {
  kore_platform_event_schedule(fd, EPOLLIN | EPOLLET, 0, data);
}


x86 assembly (clang, -O0):
<kore_platform_schedule_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    0x2ea6(%rip),%rax
or     (%rax),%esi
mov    -0x10(%rbp),%rcx
xor    %edx,%edx
call   1030 <kore_platform_event_schedule@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kore_platform_schedule_read>:
mov    %rsi,%rcx
mov    0x2ece(%rip),%rax
mov    0x2eb7(%rip),%rdx
mov    (%rdx),%esi
or     (%rax),%esi
xor    %edx,%edx
jmp    1030 <kore_platform_event_schedule@plt>

LLVM IR (-O0):
@EPOLLIN = global i32 0
@EPOLLET = global i32 0
define void @kore_platform_schedule_read(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @EPOLLIN
%7 = load i32, i32* @EPOLLET
%8 = or i32 %6, %7
%9 = load i8*, i8** %4
%10 = call i32 @kore_platform_event_schedule(i32 %5, i32 %8, i32 0, i8* %9)
ret void
}

LLVM IR (-O2):
@EPOLLIN = global i32 0
@EPOLLET = global i32 0
define void @kore_platform_schedule_read(i32 %0, i8* %1) {
%3 = load i32, i32* @EPOLLIN
%4 = load i32, i32* @EPOLLET
%5 = or i32 %4, %3
%6 = tail call i32 @kore_platform_event_schedule(i32 %0, i32 %5, i32 0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rc_findvar(char *);
char *rc_getstr_n(int /*<<< orphan*/);
char *rc_getstr(char *name) { return rc_getstr_n(rc_findvar(name)); }


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

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

LLVM IR (-O0):
define i8* @rc_getstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @rc_findvar(i8* %3)
%5 = call i8* @rc_getstr_n(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
define i8* @rc_getstr(i8* %0) {
%2 = tail call i32 @rc_findvar(i8* %0)
%3 = tail call i8* @rc_getstr_n(i32 %2)
ret i8* %3
}
/* Variables and functions */
scalar_t__ eal_malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *eal_strdup(const char *str) {
  size_t length = strlen(str) + 1;
  char *rv = (char *)eal_malloc(length);
  memcpy(rv, str, length);
  return rv;
}


x86 assembly (clang, -O0):
<eal_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <eal_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eal_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1030 <eal_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @eal_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i64 @eal_malloc(i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = load i8*, i8** %2
%14 = load i64, i64* %3
%15 = call i32 @memcpy(i8* %12, i8* %13, i64 %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @eal_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @eal_malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
ret i8* %6
}
void vscan_new(int sz) {}


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

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

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

LLVM IR (-O2):
define void @vscan_new(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version(void) {
  printf("Shelldon"
         " v"
         "0.11a"
         " aka \""
         "Ocean's"
         "\" "
         "(built on "
         "Mar 16 2022"
         ", "
         "17:24:23"
         ")\n");
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"Shelldon v0.11a aka \22Ocean's\22 (built on Mar 16 2022, 17:24:23)\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [63 x i8] c"Shelldon v0.11a aka \22Ocean's\22 (built on Mar 16 2022, 17:24:23)\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xor_decode(unsigned char *, unsigned char const *, size_t,
                              unsigned char *, int);
void caesar_decode(unsigned char *dec, const unsigned char *enc, size_t len,
                   unsigned char key) {
  xor_decode(dec, enc, len, &key, 1);
}


x86 assembly (clang, -O0):
<caesar_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x19(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <xor_decode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caesar_decode>:
push   %rax
mov    %cl,0x7(%rsp)
lea    0x7(%rsp),%rcx
mov    $0x1,%r8d
call   1030 <xor_decode@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @caesar_decode(i8* %0, i8* %1, i64 %2, i8 zeroext %3) {
%5 = alloca i8
store i8 %3, i8* %5
%6 = call i32 @xor_decode(i8* %0, i8* %1, i64 %2, i8* %5, i32 1)
ret void
}
void gtk_tool_item_get_icon_size() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tool_item_get_icon_size() {
ret void
}
void SobelXYRow_C() {}


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

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

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

LLVM IR (-O2):
define void @SobelXYRow_C() {
ret void
}
unsigned short lib$len(const struct dsc$descriptor_s *input_descriptor) {
  short word_integer_length;
  char *data_address;
  lib$analyze_sdesc(input_descriptor, &word_integer_length, &data_address);
  return word_integer_length;
}


x86 assembly (clang, -O0):
<lib$len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xa(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <lib$analyze_sdesc@plt>
movzwl -0xa(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib$len>:
sub    $0x18,%rsp
lea    0xe(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1030 <lib$analyze_sdesc@plt>
movzwl 0xe(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%"struct.dsc$descriptor_s" = type opaque
define zeroext i16 @"lib$len"(%"struct.dsc$descriptor_s"* %0) {
%2 = alloca %"struct.dsc$descriptor_s"*
%3 = alloca i16
%4 = alloca i8*
store %"struct.dsc$descriptor_s"* %0, %"struct.dsc$descriptor_s"** %2
%5 = load %"struct.dsc$descriptor_s"*, %"struct.dsc$descriptor_s"** %2
%6 = call i32 (%"struct.dsc$descriptor_s"*, i16*, i8**, ...) bitcast (i32 (...)* @"lib$analyze_sdesc" to i32 (%"struct.dsc$descriptor_s"*, i16*, i8**, ...)*)(%"struct.dsc$descriptor_s"* %5, i16* %3, i8** %4)
%7 = load i16, i16* %3
ret i16 %7
}

LLVM IR (-O2):
%"struct.dsc$descriptor_s" = type opaque
define zeroext i16 @"lib$len"(%"struct.dsc$descriptor_s"* %0) {
%2 = alloca i16
%3 = alloca i8*
%4 = bitcast i16* %2 to i8*
%5 = bitcast i8** %3 to i8*
%6 = call i32 (%"struct.dsc$descriptor_s"*, i16*, i8**, ...) bitcast (i32 (...)* @"lib$analyze_sdesc" to i32 (%"struct.dsc$descriptor_s"*, i16*, i8**, ...)*)(%"struct.dsc$descriptor_s"* %0, i16* %2, i8** %3)
%7 = load i16, i16* %2
ret i16 %7
}
/* Variables and functions */
double atan2(double, int /*<<< orphan*/);
int /*<<< orphan*/ sqrt(int);
double asin(double x) { return atan2(x, sqrt((1 + x) * (1 - x))); }


x86 assembly (clang, -O0):
<asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec1(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xeb4(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
movsd  -0x10(%rbp),%xmm0
mov    %eax,%edi
call   1030 <atan2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asin>:
push   %rax
movsd  %xmm0,(%rsp)
movsd  0xed2(%rip),%xmm2
movapd %xmm0,%xmm1
addsd  %xmm2,%xmm1
subsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
cvttsd2si %xmm2,%edi
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @asin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double 1.000000e+00, %4
%6 = load double, double* %2
%7 = fsub double 1.000000e+00, %6
%8 = fmul double %5, %7
%9 = fptosi double %8 to i32
%10 = call i32 @sqrt(i32 %9)
%11 = call double @atan2(double %3, i32 %10)
ret double %11
}

LLVM IR (-O2):
define double @asin(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fsub double 1.000000e+00, %0
%4 = fmul double %2, %3
%5 = fptosi double %4 to i32
%6 = tail call i32 @sqrt(i32 %5)
%7 = tail call double @atan2(double %0, i32 %6)
ret double %7
}
int main(int n) { scanf("%d", &n), f(n); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0xed4(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 %4)
ret i32 0
}
int main() {
  int arg1 = 0x12345;
  int arg2 = 0x74;
  int quot = 0;
  int rem = 0;
  __asm__("xorl %%edx, %%edx; idivl %%ebx;"
          : "=a"(quot), "=d"(rem)
          : "a"(arg1), "b"(arg2));
  return (quot * arg2 + rem) == arg1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movl   $0x0,-0xc(%rbp)
movl   $0x12345,-0x10(%rbp)
movl   $0x74,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ebx
xor    %edx,%edx
idiv   %ebx
mov    %eax,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp),%eax
add    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x12345,%eax
mov    $0x74,%ebx
xor    %edx,%edx
idiv   %ebx
imul   $0x74,%eax,%ecx
add    %edx,%ecx
xor    %eax,%eax
cmp    $0x12345,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 74565, i32* %2
store i32 116, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call { i32, i32 } asm "xorl %edx, %edx; idivl %ebx;", "={ax},={dx},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 %6, i32 %7)
%9 = extractvalue { i32, i32 } %8, 0
%10 = extractvalue { i32, i32 } %8, 1
store i32 %9, i32* %4
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* %5
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %2
%17 = icmp eq i32 %15, %16
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call { i32, i32 } asm "xorl %edx, %edx; idivl %ebx;", "={ax},={dx},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 74565, i32 116)
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = mul nsw i32 %2, 116
%5 = add nsw i32 %4, %3
%6 = icmp eq i32 %5, 74565
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int _start_main_crystal(void) {
  uint32_t current_value = *((volatile uint32_t *)(((0x400e0400) + 0x20)));
  current_value &= ~(0xff << 8);
  *((volatile uint32_t *)(((0x400e0400) + 0x20))) =
      ((current_value | (0x37 << 16) | (1 << 0) | (62 << 8)));
  while (!(*((volatile uint32_t *)((((0x400e0400) + 0x68)))) & (1 << 0)))
    ;
  return 0;
}


x86 assembly (clang, -O0):
<_start_main_crystal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400e0420,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff00ff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
or     $0x370000,%ecx
or     $0x1,%ecx
or     $0x3e00,%ecx
mov    $0x400e0420,%eax
mov    %ecx,(%rax)
mov    $0x400e0468,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1151 <_start_main_crystal+0x51>
jmp    1156 <_start_main_crystal+0x56>
jmp    1132 <_start_main_crystal+0x32>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start_main_crystal>:
mov    $0xffc800fe,%eax
and    0x400e0420,%eax
or     $0x373e01,%eax
mov    %eax,0x400e0420
nopl   0x0(%rax,%rax,1)
testl  $0x1,0x400e0468
je     1120 <_start_main_crystal+0x20>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_start_main_crystal() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1074660384 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -65281
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = or i32 %5, 3604480
%7 = or i32 %6, 1
%8 = or i32 %7, 15872
store volatile i32 %8, i32* inttoptr (i64 1074660384 to i32*)
br label %9
9: ; preds = %14, %0
%10 = load volatile i32, i32* inttoptr (i64 1074660456 to i32*)
%11 = and i32 %10, 1
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br i1 %13, label %14, label %15
14: ; preds = %9
br label %9
15: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @_start_main_crystal() {
%1 = load volatile i32, i32* inttoptr (i64 1074660384 to i32*)
%2 = and i32 %1, -3669762
%3 = or i32 %2, 3620353
store volatile i32 %3, i32* inttoptr (i64 1074660384 to i32*)
br label %4
4: ; preds = %4, %0
%5 = load volatile i32, i32* inttoptr (i64 1074660456 to i32*)
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ minor_code;
};
typedef TYPE_1__ XGraphicsExposeEvent;

/* Variables and functions */
int get_XGraphicsExposeEvent_minor_code(void *_p) {
  return (int)((XGraphicsExposeEvent *)_p)->minor_code;
}


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

x86 assembly (clang, -O2):
<get_XGraphicsExposeEvent_minor_code>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XGraphicsExposeEvent_minor_code(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned int readl(void *);
unsigned int ioread32(void *addr) { return readl(addr); }


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

x86 assembly (clang, -O2):
<ioread32>:
jmp    1030 <readl@plt>

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

LLVM IR (-O2):
define i32 @ioread32(i8* %0) {
%2 = tail call i32 @readl(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ left_motor_forward(int);
int /*<<< orphan*/ right_motor_backward(int);
void spin() {
  right_motor_backward(90);
  right_motor_backward(90);
  delay(300);
  left_motor_forward(90);
  right_motor_backward(90);
  delay(150);
}


x86 assembly (clang, -O0):
<spin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5a,%edi
call   1030 <right_motor_backward@plt>
mov    $0x5a,%edi
call   1030 <right_motor_backward@plt>
mov    $0x12c,%edi
call   1050 <delay@plt>
mov    $0x5a,%edi
call   1040 <left_motor_forward@plt>
mov    $0x5a,%edi
call   1030 <right_motor_backward@plt>
mov    $0x96,%edi
call   1050 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spin>:
push   %rax
mov    $0x5a,%edi
call   1030 <right_motor_backward@plt>
mov    $0x5a,%edi
call   1030 <right_motor_backward@plt>
mov    $0x12c,%edi
call   1050 <delay@plt>
mov    $0x5a,%edi
call   1040 <left_motor_forward@plt>
mov    $0x5a,%edi
call   1030 <right_motor_backward@plt>
mov    $0x96,%edi
pop    %rax
jmp    1050 <delay@plt>

LLVM IR (-O0):
define void @spin() {
%1 = call i32 @right_motor_backward(i32 90)
%2 = call i32 @right_motor_backward(i32 90)
%3 = call i32 @delay(i32 300)
%4 = call i32 @left_motor_forward(i32 90)
%5 = call i32 @right_motor_backward(i32 90)
%6 = call i32 @delay(i32 150)
ret void
}

LLVM IR (-O2):
define void @spin() {
%1 = tail call i32 @right_motor_backward(i32 90)
%2 = tail call i32 @right_motor_backward(i32 90)
%3 = tail call i32 @delay(i32 300)
%4 = tail call i32 @left_motor_forward(i32 90)
%5 = tail call i32 @right_motor_backward(i32 90)
%6 = tail call i32 @delay(i32 150)
ret void
}
/* Variables and functions */
int putchar(int);
int PBOUT(int c) { return putchar(c); }


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

x86 assembly (clang, -O2):
<PBOUT>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define i32 @PBOUT(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret i32 %2
}
/* Type definitions */
struct tcpsacq_workspace {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int start_acq(struct tcpsacq_workspace *ws) {
  printf("tcps_start_acq\n");
  return 1;
}


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

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

LLVM IR (-O0):
%struct.tcpsacq_workspace = type { i32 }
@.str = [16 x i8] c"tcps_start_acq\0A\00"
define i32 @start_acq(%struct.tcpsacq_workspace* %0) {
%2 = alloca %struct.tcpsacq_workspace*
store %struct.tcpsacq_workspace* %0, %struct.tcpsacq_workspace** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.tcpsacq_workspace = type { i32 }
@str = [15 x i8] c"tcps_start_acq\00"
define i32 @start_acq(%struct.tcpsacq_workspace* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ serial_flush();
extern void gps_flush(void) { serial_flush(); }


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

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

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

LLVM IR (-O2):
define void @gps_flush() {
%1 = tail call i32 (...) @serial_flush()
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int main(int argc, char **argv) {
  int *a = (int *)malloc(sizeof(int) * 8);
  memset(a, 0, sizeof(int) * 8);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i64 @malloc(i32 32)
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = call i32 @memset(i32* %8, i32 0, i32 32)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 32)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @memset(i32* %4, i32 0, i32 32)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("C\nis the greastest\nLanguage"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"C\0Ais the greastest\0ALanguage\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"C\0Ais the greastest\0ALanguage\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double RAND_MAX;
double rand();
double my_rand() { return 1.0 * rand() / RAND_MAX; }


x86 assembly (clang, -O0):
<my_rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    0x2eb7(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @my_rand() {
%1 = call double (...) @rand()
%2 = fmul double 1.000000e+00, %1
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @my_rand() {
%1 = tail call double (...) @rand()
%2 = load double, double* @RAND_MAX
%3 = fdiv double %1, %2
ret double %3
}
/* Variables and functions */
double pow(double, int);
double f(double x) { return pow(x, 2) - 2; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0xecc(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    $0x2,%edi
call   1030 <pow@plt>
addsd  0xedd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, i32 2)
%5 = fsub double %4, 2.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @pow(double %0, i32 2)
%3 = fadd double %2, -2.000000e+00
ret double %3
}
signed int fstat(signed int __fd, struct stat *__statbuf) {
  signed int return_value___fxstat$1;
  return_value___fxstat$1 = __fxstat(1, __fd, __statbuf);
  return return_value___fxstat$1;
}


x86 assembly (clang, -O0):
<fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <__fxstat@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstat>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <__fxstat@plt>

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
%5 = alloca i32
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%6 = load i32, i32* %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = call i32 (i32, i32, %struct.stat*, ...) bitcast (i32 (...)* @__fxstat to i32 (i32, i32, %struct.stat*, ...)*)(i32 1, i32 %6, %struct.stat* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = tail call i32 (i32, i32, %struct.stat*, ...) bitcast (i32 (...)* @__fxstat to i32 (i32, i32, %struct.stat*, ...)*)(i32 1, i32 %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int abs(int);
int adirompare(const void *a, const void *b) {
  return (abs(*(int *)a) - abs(*(int *)b));
}


x86 assembly (clang, -O0):
<adirompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <abs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adirompare>:
mov    (%rdi),%eax
mov    %eax,%ecx
neg    %ecx
cmovs  %eax,%ecx
mov    (%rsi),%edx
mov    %edx,%eax
neg    %eax
cmovns %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @adirompare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @abs(i32 %7)
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = call i32 @abs(i32 %11)
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @adirompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @llvm.abs.i32(i32 %4, i1 true)
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %6
%8 = tail call i32 @llvm.abs.i32(i32 %7, i1 true)
%9 = sub nsw i32 %5, %8
ret i32 %9
}