xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ drv_Sample_send(char *, int);
int drv_Sample_GPO(const int num, const int val) {
  char cmd[4];
  cmd[0] = 0x42;
  cmd[1] = num;
  cmd[2] = (val > 0) ? 1 : 0;
  drv_Sample_send(cmd, 3);
  return 0;
}


x86 assembly (clang, -O0):
<drv_Sample_GPO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movb   $0x42,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
mov    %al,-0xa(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x3,%esi
call   1030 <drv_Sample_send@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_Sample_GPO>:
push   %rax
movb   $0x42,0x4(%rsp)
mov    %dil,0x5(%rsp)
test   %esi,%esi
setg   0x6(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x3,%esi
call   1030 <drv_Sample_send@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @drv_Sample_GPO(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
store i8 66, i8* %6
%7 = load i32, i32* %3
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 1
store i8 %8, i8* %9
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 2
store i8 %14, i8* %15
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%17 = call i32 @drv_Sample_send(i8* %16, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @drv_Sample_GPO(i32 %0, i32 %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 66, i8* %4
%5 = trunc i32 %0 to i8
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %5, i8* %6
%7 = icmp sgt i32 %1, 0
%8 = zext i1 %7 to i8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %8, i8* %9
%10 = call i32 @drv_Sample_send(i8* %4, i32 3)
ret i32 0
}
/* Variables and functions */
char *get_elog_filename_int(int);
int validate_eid_str(char const *);
char *get_elog_filename_str(const char *eid_str) {
  int eid = validate_eid_str(eid_str);
  if (eid == 0)
    return NULL;
  return get_elog_filename_int(eid);
}


x86 assembly (clang, -O0):
<get_elog_filename_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <validate_eid_str@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114f <get_elog_filename_str+0x2f>
movq   $0x0,-0x8(%rbp)
jmp    115b <get_elog_filename_str+0x3b>
mov    -0x14(%rbp),%edi
call   1040 <get_elog_filename_int@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_elog_filename_str>:
push   %rax
call   1030 <validate_eid_str@plt>
test   %eax,%eax
je     1132 <get_elog_filename_str+0x12>
mov    %eax,%edi
pop    %rax
jmp    1040 <get_elog_filename_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @get_elog_filename_str(i8* %0) {
%2 = tail call i32 @validate_eid_str(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @get_elog_filename_int(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ getpid();
pid_t Getpid(void) { return getpid(); }


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

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

LLVM IR (-O0):
define i32 @Getpid() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @Getpid() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ivory_serialize_unpack_prim_1_le(const uint8_t *src) {
  return ((uint8_t)src[0] << 0);
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_prim_1_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x0,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ivory_serialize_unpack_prim_1_le(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = shl i32 %5, 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @ivory_serialize_unpack_prim_1_le(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *strdup(char const *);
void update_input_filename(const char *input_filename) {
  char *input_filename_as_char = strdup(input_filename);
  char *base = basename(input_filename_as_char);
  printf("Converting %s\n", base);
  free(input_filename_as_char);
}


x86 assembly (clang, -O0):
<update_input_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <basename@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_input_filename>:
push   %rbx
call   1060 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <basename@plt>
lea    0xea8(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Converting %s\0A\00"
define void @update_input_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strdup(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @basename(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Converting %s\0A\00"
define void @update_input_filename(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i8* @basename(i8* %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("hello, world\c"); }


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 = [14 x i8] c"hello, worldc\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"hello, worldc\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_storeu_si16(void *, int /*<<< orphan*/);
void test_mm_storeu_si16(void *A, __m128i B) { _mm_storeu_si16(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_storeu_si16>:
jmp    1030 <_mm_storeu_si16@plt>

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

LLVM IR (-O2):
define void @test_mm_storeu_si16(i8* %0, i32 %1) {
%3 = tail call i32 @_mm_storeu_si16(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void indent(int n) {
  for (int i = 0; i < n * 2; i++)
    putchar(' ');
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    114b <indent+0x3b>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %rbx
test   %edi,%edi
jle    113f <indent+0x2f>
add    %edi,%edi
cmp    $0x2,%edi
mov    $0x1,%ebx
cmovge %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <indent+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = call i32 @llvm.smax.i32(i32 %4, i32 1)
br label %7
6: ; preds = %7, %1
ret void
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ 0, %3 ]
%9 = tail call i32 @putchar(i8 signext 32)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %5
br i1 %11, label %6, label %7
}
char *char_to_number(unsigned char c) {
  static char *fixed = "000";
  unsigned char huns, tens, ones;
  huns = c / 100;
  c = c - huns * 100;
  tens = c / 10;
  c = c - tens * 10;
  ones = c;
  fixed[0] = huns + '0';
  fixed[1] = tens + '0';
  fixed[2] = ones + '0';
  return fixed;
}


x86 assembly (clang, -O0):
<char_to_number>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x3(%rbp),%ecx
imul   $0xa,%ecx,%ecx
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x4(%rbp)
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    0x2ec2(%rip),%rax
mov    %cl,(%rax)
movzbl -0x3(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    0x2eb0(%rip),%rax
mov    %cl,0x1(%rax)
movzbl -0x4(%rbp),%eax
add    $0x30,%eax
mov    %al,%cl
mov    0x2e9d(%rip),%rax
mov    %cl,0x2(%rax)
mov    0x2e93(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@char_to_number.fixed = internal global i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0)
@.str = [4 x i8] c"000\00"
define i8* @char_to_number(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %2
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = sdiv i32 %7, 100
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = mul nsw i32 %13, 100
%15 = sub nsw i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = sdiv i32 %18, 10
%20 = trunc i32 %19 to i8
store i8 %20, i8* %4
%21 = load i8, i8* %2
%22 = zext i8 %21 to i32
%23 = load i8, i8* %4
%24 = zext i8 %23 to i32
%25 = mul nsw i32 %24, 10
%26 = sub nsw i32 %22, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %2
%28 = load i8, i8* %2
store i8 %28, i8* %5
%29 = load i8, i8* %3
%30 = zext i8 %29 to i32
%31 = add nsw i32 %30, 48
%32 = trunc i32 %31 to i8
%33 = load i8*, i8** @char_to_number.fixed
%34 = getelementptr inbounds i8, i8* %33, i64 0
store i8 %32, i8* %34
%35 = load i8, i8* %4
%36 = zext i8 %35 to i32
%37 = add nsw i32 %36, 48
%38 = trunc i32 %37 to i8
%39 = load i8*, i8** @char_to_number.fixed
%40 = getelementptr inbounds i8, i8* %39, i64 1
store i8 %38, i8* %40
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = add nsw i32 %42, 48
%44 = trunc i32 %43 to i8
%45 = load i8*, i8** @char_to_number.fixed
%46 = getelementptr inbounds i8, i8* %45, i64 2
store i8 %44, i8* %46
%47 = load i8*, i8** @char_to_number.fixed
ret i8* %47
}

LLVM IR (-O2):
@.str = [4 x i8] c"000\00"
define i8* @char_to_number(i8 zeroext %0) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct bigposint {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bigposint_to_string(struct bigposint *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
void print_bigposint(char *prefix, struct bigposint *bigptr) {
  char output[10000];
  bigposint_to_string(bigptr, output);
  printf("%s%s\n", prefix, output);
}


x86 assembly (clang, -O0):
<print_bigposint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2720,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x2720(%rbp),%rsi
call   1040 <bigposint_to_string@plt>
mov    -0x8(%rbp),%rsi
lea    -0x2720(%rbp),%rdx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
add    $0x2720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bigposint>:
push   %r14
push   %rbx
sub    $0x2718,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %rsi,%rdi
mov    %r14,%rsi
call   1040 <bigposint_to_string@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
add    $0x2718,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.bigposint = type { i32 }
@.str = [6 x i8] c"%s%s\0A\00"
define void @print_bigposint(i8* %0, %struct.bigposint* %1) {
%3 = alloca i8*
%4 = alloca %struct.bigposint*
%5 = alloca [10000 x i8]
store i8* %0, i8** %3
store %struct.bigposint* %1, %struct.bigposint** %4
%6 = load %struct.bigposint*, %struct.bigposint** %4
%7 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 0
%8 = call i32 @bigposint_to_string(%struct.bigposint* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [10000 x i8], [10000 x i8]* %5, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.bigposint = type { i32 }
@.str = [6 x i8] c"%s%s\0A\00"
define void @print_bigposint(i8* %0, %struct.bigposint* %1) {
%3 = alloca [10000 x i8]
%4 = getelementptr inbounds [10000 x i8], [10000 x i8]* %3, i64 0, i64 0
%5 = call i32 @bigposint_to_string(%struct.bigposint* %1, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret void
}
/* Variables and functions */
double __ocml_erf_f64(double);
double erf(double x) { return __ocml_erf_f64(x); }


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

x86 assembly (clang, -O2):
<erf>:
jmp    1030 <__ocml_erf_f64@plt>

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

LLVM IR (-O2):
define double @erf(double %0) {
%2 = tail call double @__ocml_erf_f64(double %0)
ret double %2
}
float signum_fun_float(float a) { return (a > 0) - (a < 0); }


x86 assembly (clang, -O0):
<signum_fun_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_fun_float>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @signum_fun_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = load float, float* %2
%7 = fcmp olt float %6, 0.000000e+00
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
%10 = sitofp i32 %9 to float
ret float %10
}

LLVM IR (-O2):
define float @signum_fun_float(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = fcmp olt float %0, 0.000000e+00
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %3
%7 = sitofp i32 %6 to float
ret float %7
}
unsigned int return_uint_0() { return 1073741823; }


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

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

LLVM IR (-O0):
define i32 @return_uint_0() {
ret i32 1073741823
}

LLVM IR (-O2):
define i32 @return_uint_0() {
ret i32 1073741823
}
/* Variables and functions */
int errno;
long long strtoll(char const *, int /*<<< orphan*/ *, int);
long long int atoll(const char *nptr) {
  int tmp;
  long long int res;
  tmp = errno;
  res = strtoll(nptr, NULL, 10);
  errno = tmp;
  return res;
}


x86 assembly (clang, -O0):
<atoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtoll@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2e98(%rip),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoll>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtoll@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i64 @atoll(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i32, i32* @errno
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = call i64 @strtoll(i8* %6, i32* null, i32 10)
store i64 %7, i64* %4
%8 = load i32, i32* %3
store i32 %8, i32* @errno
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
@errno = global i32 0
define i64 @atoll(i8* nocapture %0) {
%2 = load i32, i32* @errno
%3 = tail call i64 @strtoll(i8* nocapture %0, i32* null, i32 10)
store i32 %2, i32* @errno
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ implicit();
main() {
  int defined();
  defined(implicit());
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <implicit@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <defined@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <implicit@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <defined@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @implicit()
%2 = call i32 (i32, ...) bitcast (i32 (...)* @defined to i32 (i32, ...)*)(i32 %1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @implicit()
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @defined to i32 (i32, ...)*)(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errmsg(int, int /*<<< orphan*/, int, char *);
char *strdup(char const *);
char *xstrdup(const char *str) {
  char *ret;
  if (!str)
    return NULL;
  ret = strdup(str);
  if (!ret)
    errmsg(1, EXIT_FAILURE, 1, "cannot duplicate string");
  return ret;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1180 <xstrdup+0x60>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1178 <xstrdup+0x58>
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
lea    0xe8f(%rip),%rcx
mov    %edx,%edi
call   1030 <errmsg@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
test   %rdi,%rdi
je     1151 <xstrdup+0x31>
call   1040 <strdup@plt>
test   %rax,%rax
je     1132 <xstrdup+0x12>
pop    %rcx
ret
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
lea    0xebe(%rip),%rcx
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <errmsg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [24 x i8] c"cannot duplicate string\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* null, i8** %2
br label %18
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strdup(i8* %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %16, label %13
13: ; preds = %8
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @errmsg(i32 1, i32 %14, i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %13, %8
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %18
18: ; preds = %16, %7
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [24 x i8] c"cannot duplicate string\00"
define noalias i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @errmsg(i32 1, i32 %7, i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %3, %6, %1
%10 = phi i8* [ null, %1 ], [ null, %6 ], [ %4, %3 ]
ret i8* %10
}
void SSMR3PutS128(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3PutS128() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xsi_register_didat(char *, char *);
extern void work_a_3073701636_1075909370_init() {
  xsi_register_didat(
      "work_a_3073701636_1075909370",
      "isim/TopLevel_tb_isim_beh.exe.sim/work/a_3073701636_1075909370.didat");
}


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

x86 assembly (clang, -O2):
<work_a_3073701636_1075909370_init>:
lea    0xee9(%rip),%rdi
lea    0xeff(%rip),%rsi
jmp    1030 <xsi_register_didat@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"work_a_3073701636_1075909370\00"
@.str.1 = [69 x i8] c"isim/TopLevel_tb_isim_beh.exe.sim/work/a_3073701636_1075909370.didat\00"
define void @work_a_3073701636_1075909370_init() {
%1 = call i32 @xsi_register_didat(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"work_a_3073701636_1075909370\00"
@.str.1 = [69 x i8] c"isim/TopLevel_tb_isim_beh.exe.sim/work/a_3073701636_1075909370.didat\00"
define void @work_a_3073701636_1075909370_init() {
%1 = tail call i32 @xsi_register_didat(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
ret void
}
flip_image_array(the_image, rows, cols) long cols, rows;
short **the_image;
{}


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

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

LLVM IR (-O0):
define i32 @flip_image_array(i16** %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i16**
%6 = alloca i64
%7 = alloca i64
store i16** %0, i16*** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
define i32 @flip_image_array(i16** nocapture readnone %0, i64 %1, i64 %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x77() {
  Assert_real((ispunct(119) == 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",
              600, ("ispunct should be 0 for w"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x77>:
push   %rax
mov    $0x77,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x258,%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 w\00"
define void @t_ispunct_0x77() {
%1 = call i64 @ispunct(i32 119)
%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 600, 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 w\00"
define void @t_ispunct_0x77() {
%1 = tail call i64 @ispunct(i32 119)
%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 600, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
long get_num(char *, char *);
char *long2str(char *, int /*<<< orphan*/);
int /*<<< orphan*/ tt_ninternal(int, long);
char *macttNInternal(char *arg) {
  int tbl;
  long top;
  top = get_num("ttNInternal", arg);
  tbl = (int)get_num("ttNInternal", arg);
  return (long2str(arg, tt_ninternal(tbl, top)));
}


x86 assembly (clang, -O0):
<macttNInternal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <get_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <get_num@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1050 <tt_ninternal@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <long2str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macttNInternal>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xec1(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1050 <tt_ninternal@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <long2str@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"ttNInternal\00"
define i8* @macttNInternal(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @get_num(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = call i64 @get_num(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = load i64, i64* %4
%13 = call i32 @tt_ninternal(i32 %11, i64 %12)
%14 = call i8* @long2str(i8* %10, i32 %13)
ret i8* %14
}

LLVM IR (-O2):
@.str = [12 x i8] c"ttNInternal\00"
define i8* @macttNInternal(i8* %0) {
%2 = tail call i64 @get_num(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @get_num(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @tt_ninternal(i32 %4, i64 %2)
%6 = tail call i8* @long2str(i8* %0, i32 %5)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void kernel__Bool__output(short int self) {
  printf(self ? "true\n" : "false\n");
RET_LABEL:;
}


x86 assembly (clang, -O0):
<kernel__Bool__output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
lea    0xedc(%rip),%rdi
lea    0xecf(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel__Bool__output>:
test   %di,%di
lea    0xeec(%rip),%rax
lea    0xedf(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"true\0A\00"
@.str.1 = [7 x i8] c"false\0A\00"
define void @kernel__Bool__output(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%8 = call i32 @printf(i8* %7)
br label %9
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"true\0A\00"
@.str.1 = [7 x i8] c"false\0A\00"
define void @kernel__Bool__output(i16 signext %0) {
%2 = icmp eq i16 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aprint(int, int **);
main() {
  int i, j, inp[5][5];
  for (i = 0; i <= 5; ++i) {
    for (j = 0; j <= 5; ++j) {
      inp[i][j] = 0;
    }
  }
  aprint(5, inp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     117c <main+0x6c>
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jg     1169 <main+0x59>
movslq -0x8(%rbp),%rcx
lea    -0x70(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1137 <main+0x27>
jmp    116e <main+0x5e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
lea    -0x70(%rbp),%rsi
mov    $0x5,%edi
call   1030 <aprint@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x6c(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
call   1030 <aprint@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x [5 x i32]]
%2 = bitcast [5 x [5 x i32]]* %1 to i8*
%3 = bitcast [5 x [5 x i32]]* %1 to i32**
%4 = bitcast [5 x [5 x i32]]* %1 to i8*
%5 = call i32 @aprint(i32 5, i32** %3)
ret i32 0
}
/* Variables and functions */
bool isspecial(char c) {
  switch (c) {
  case '{':
  case '}':
  case '(':
  case ')':
  case '[':
  case ']':
  case ';':
  case ':':
  case ',':
  case '*':
  case '+':
  case '-':
  case '/':
  case '=':
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<isspecial>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffd8,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x55,%eax
ja     1140 <isspecial+0x40>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1147 <isspecial+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspecial>:
add    $0xffffffd8,%edi
cmp    $0x55,%edi
ja     111e <isspecial+0x1e>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isspecial(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 123, label %6
i32 125, label %6
i32 40, label %6
i32 41, label %6
i32 91, label %6
i32 93, label %6
i32 59, label %6
i32 58, label %6
i32 44, label %6
i32 42, label %6
i32 43, label %6
i32 45, label %6
i32 47, label %6
i32 61, label %6
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @isspecial(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 123, label %4
i32 125, label %4
i32 40, label %4
i32 41, label %4
i32 91, label %4
i32 93, label %4
i32 59, label %4
i32 58, label %4
i32 44, label %4
i32 42, label %4
i32 43, label %4
i32 45, label %4
i32 47, label %4
i32 61, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
void RTLockValidatorHoldsLocksInSubClass(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorHoldsLocksInSubClass() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MyFree(void *);
void SzBigFree(void *p, void *address) {
  (void)p;
  ;
  MyFree(address);
}


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

x86 assembly (clang, -O2):
<SzBigFree>:
mov    %rsi,%rdi
jmp    1030 <MyFree@plt>

LLVM IR (-O0):
define void @SzBigFree(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 = load i8*, i8** %4
%7 = call i32 @MyFree(i8* %6)
ret void
}

LLVM IR (-O2):
define void @SzBigFree(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @MyFree(i8* %1)
ret void
}
/* Type definitions */
struct nxtd_nxt_usb {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
ssize_t nxtd_usb_send(struct nxtd_nxt_usb *nxt, const void *data, size_t size) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.nxtd_nxt_usb = type { i32 }
define i32 @nxtd_usb_send(%struct.nxtd_nxt_usb* %0, i8* %1, i64 %2) {
%4 = alloca %struct.nxtd_nxt_usb*
%5 = alloca i8*
%6 = alloca i64
store %struct.nxtd_nxt_usb* %0, %struct.nxtd_nxt_usb** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
%struct.nxtd_nxt_usb = type { i32 }
define i32 @nxtd_usb_send(%struct.nxtd_nxt_usb* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int sub(int, int);
int main(int argc, char **argv) {
  int a;
  a = atoi(argv[1]);
  return sub(argc, a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <sub@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
mov    0x8(%rsi),%rdi
call   1030 <atoi@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <sub@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = call i32 @sub(i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @sub(i32 %0, i32 %5)
ret i32 %6
}
void tdefault_follow_exec(struct target_ops *self, struct inferior *arg1,
                          char *arg2) {}


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

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

LLVM IR (-O0):
%struct.target_ops = type opaque
%struct.inferior = type opaque
define void @tdefault_follow_exec(%struct.target_ops* %0, %struct.inferior* %1, i8* %2) {
%4 = alloca %struct.target_ops*
%5 = alloca %struct.inferior*
%6 = alloca i8*
store %struct.target_ops* %0, %struct.target_ops** %4
store %struct.inferior* %1, %struct.inferior** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
%struct.target_ops = type opaque
%struct.inferior = type opaque
define void @tdefault_follow_exec(%struct.target_ops* nocapture %0, %struct.inferior* nocapture %1, i8* nocapture %2) {
ret void
}
char *copy(from, to)
register char *from, *to;
{
  while (*to++ = *from++)
    ;
  return to - 1;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <copy+0x3b>
jmp    110c <copy+0xc>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
mov    %rsi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %cl,0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <copy+0x10>
ret

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

LLVM IR (-O2):
define i8* @copy(i8* nocapture %0, i8* writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %6, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %5
}
unsigned float_times64(unsigned uf) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @float_times64(i32 %0) {
ret i32 2
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
void eat_whitespace(char **s) {
  char *t;
  t = *s;
  while (*t && isspace((unsigned char)*t)) {
    t++;
  }
  *s = t;
}


x86 assembly (clang, -O0):
<eat_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1152 <eat_whitespace+0x42>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1162 <eat_whitespace+0x52>
jmp    1173 <eat_whitespace+0x63>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <eat_whitespace+0x17>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat_whitespace>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    (%rbx),%al
test   %al,%al
je     1139 <eat_whitespace+0x29>
movzbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <eat_whitespace+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <eat_whitespace+0x10>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @eat_whitespace(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %10
%6 = phi i8 [ %12, %10 ], [ %3, %1 ]
%7 = phi i8* [ %11, %10 ], [ %2, %1 ]
%8 = tail call i64 @isspace(i8 zeroext %6)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %1
%15 = phi i8* [ %2, %1 ], [ %11, %10 ], [ %7, %5 ]
store i8* %15, i8** %0
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int _eqStrings(char *str1, char *str2) { return (strcmp(str1, str2) == 0); }


x86 assembly (clang, -O0):
<_eqStrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_eqStrings(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 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_eqStrings(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
__attribute__((always_)) int calc_ysize(int rect_ysz, int padding) {
  return rect_ysz + 2 * padding + 2;
}


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

x86 assembly (clang, -O2):
<calc_ysize>:
lea    (%rdi,%rsi,2),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @calc_ysize(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 = mul nsw i32 2, %6
%8 = add nsw i32 %5, %7
%9 = add nsw i32 %8, 2
ret i32 %9
}

LLVM IR (-O2):
define i32 @calc_ysize(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = add i32 %0, 2
%5 = add i32 %4, %3
ret i32 %5
}