xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void intro() {
  printf("Bombardment\n");
  printf("-----------\n");
  printf(
      "In this game you hide 4 platoons on your our 5×5 grid. Then you try\n"
      "to find where I have hid my 4 by dropping bombs on them as I rain "
      "bombs\n"
      "yours.\n\n"
      "The first one to bomb all 4 of their enemy's platoons is the winner.\n"
      "the playfield is numbered like so:\n");
}


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

x86 assembly (clang, -O2):
<intro>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Bombardment\0A\00"
@.str.1 = [13 x i8] c"-----------\0A\00"
@.str.2 = [254 x i8] c"In this game you hide 4 platoons on your our 5\C3\975 grid. Then you try\0Ato find where I have hid my 4 by dropping bombs on them as I rain bombs\0Ayours.\0A\0AThe first one to bomb all 4 of their enemy's platoons is the winner.\0Athe playfield is numbered like so:\0A\00"
define void @intro() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([254 x i8], [254 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"Bombardment\00"
@str.3 = [12 x i8] c"-----------\00"
@str.4 = [253 x i8] c"In this game you hide 4 platoons on your our 5\C3\975 grid. Then you try\0Ato find where I have hid my 4 by dropping bombs on them as I rain bombs\0Ayours.\0A\0AThe first one to bomb all 4 of their enemy's platoons is the winner.\0Athe playfield is numbered like so:\00"
define void @intro() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([253 x i8], [253 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int digit_to_val(char *);
unsigned char char_to_val(char *str) {
  return digit_to_val(&str[0]) << 4 | digit_to_val(&str[1]);
}


x86 assembly (clang, -O0):
<char_to_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <digit_to_val@plt>
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <digit_to_val@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_val>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <digit_to_val@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <digit_to_val@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @char_to_val(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = call i32 @digit_to_val(i8* %4)
%6 = shl i32 %5, 4
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = call i32 @digit_to_val(i8* %8)
%10 = or i32 %6, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @char_to_val(i8* %0) {
%2 = tail call i32 @digit_to_val(i8* %0)
%3 = shl i32 %2, 4
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = tail call i32 @digit_to_val(i8* %4)
%6 = or i32 %3, %5
%7 = trunc i32 %6 to i8
ret i8 %7
}
/* Type definitions */
struct terminal {
  int dummy;
};
struct parm_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cr(struct terminal *);
int /*<<< orphan*/ move_cursor(struct terminal *, int, int /*<<< orphan*/);
int sum(struct parm_t *);
void curs_pl(struct terminal *term, struct parm_t *parm) {
  int num = sum(parm);
  if (num <= 0)
    num = 1;
  move_cursor(term, -num, 0);
  cr(term);
}


x86 assembly (clang, -O0):
<curs_pl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <sum@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     115d <curs_pl+0x2d>
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
sub    -0x14(%rbp),%esi
xor    %edx,%edx
call   1050 <move_cursor@plt>
mov    -0x8(%rbp),%rdi
call   1030 <cr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curs_pl>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <sum@plt>
test   %eax,%eax
mov    $0x1,%esi
cmovg  %eax,%esi
neg    %esi
mov    %rbx,%rdi
xor    %edx,%edx
call   1050 <move_cursor@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <cr@plt>

LLVM IR (-O0):
%struct.terminal = type { i32 }
%struct.parm_t = type { i32 }
define void @curs_pl(%struct.terminal* %0, %struct.parm_t* %1) {
%3 = alloca %struct.terminal*
%4 = alloca %struct.parm_t*
%5 = alloca i32
store %struct.terminal* %0, %struct.terminal** %3
store %struct.parm_t* %1, %struct.parm_t** %4
%6 = load %struct.parm_t*, %struct.parm_t** %4
%7 = call i32 @sum(%struct.parm_t* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %5
br label %11
11: ; preds = %10, %2
%12 = load %struct.terminal*, %struct.terminal** %3
%13 = load i32, i32* %5
%14 = sub nsw i32 0, %13
%15 = call i32 @move_cursor(%struct.terminal* %12, i32 %14, i32 0)
%16 = load %struct.terminal*, %struct.terminal** %3
%17 = call i32 @cr(%struct.terminal* %16)
ret void
}

LLVM IR (-O2):
%struct.terminal = type { i32 }
%struct.parm_t = type { i32 }
define void @curs_pl(%struct.terminal* %0, %struct.parm_t* %1) {
%3 = tail call i32 @sum(%struct.parm_t* %1)
%4 = icmp sgt i32 %3, 1
%5 = select i1 %4, i32 %3, i32 1
%6 = sub nsw i32 0, %5
%7 = tail call i32 @move_cursor(%struct.terminal* %0, i32 %6, i32 0)
%8 = tail call i32 @cr(%struct.terminal* %0)
ret void
}
void strcatp(char *s, char *t) {
  while (*s != '\0') {
    s++;
  }
  while ((*s++ = *t++))
    ;
}


x86 assembly (clang, -O0):
<strcatp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112d <strcatp+0x2d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <strcatp+0xc>
jmp    1132 <strcatp+0x32>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1161 <strcatp+0x61>
jmp    1132 <strcatp+0x32>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @strcatp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pqr(void) { printf("v2 pqr\n"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"v2 pqr\0A\00"
define void @pqr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"v2 pqr\00"
define void @pqr() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_36uint8_mem(unsigned char *val) {
  return ((*val) & (0x36 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_36uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x36,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_36uint8_mem>:
testb  $0x36,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_36uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 54
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_36uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 54
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void my_task(int x) { printf("Hello, world! With x = %d\n", x); }


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

x86 assembly (clang, -O2):
<my_task>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Hello, world! With x = %d\0A\00"
define void @my_task(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Hello, world! With x = %d\0A\00"
define void @my_task(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int uint32_t;
struct tms {
  int dummy;
};
typedef scalar_t__ clock_t;

/* Variables and functions */
scalar_t__ times(struct tms *);
uint32_t rcpTic(void) {
  struct tms tm;
  clock_t systick = times(&tm);
  return (uint32_t)((uint32_t)systick / 100);
}


x86 assembly (clang, -O0):
<rcpTic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <times@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcpTic>:
push   %rax
mov    %rsp,%rdi
call   1030 <times@plt>
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tms = type { i32 }
define i32 @rcpTic() {
%1 = alloca %struct.tms
%2 = alloca i64
%3 = call i64 @times(%struct.tms* %1)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i32
%6 = sdiv i32 %5, 100
ret i32 %6
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @rcpTic() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i64 @times(%struct.tms* %1)
%4 = trunc i64 %3 to i32
%5 = sdiv i32 %4, 100
ret i32 %5
}
void QCI_apply(struct arguments *arguments) {}


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

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

LLVM IR (-O0):
%struct.arguments = type opaque
define void @QCI_apply(%struct.arguments* %0) {
%2 = alloca %struct.arguments*
store %struct.arguments* %0, %struct.arguments** %2
ret void
}

LLVM IR (-O2):
%struct.arguments = type opaque
define void @QCI_apply(%struct.arguments* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ llabs(int);
int main(void) {
  llabs(-10);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int is_legal_response_code(int status) {
  return (status >= 100 && status < 600) || (status >= 1000 && status < 5000);
}


x86 assembly (clang, -O0):
<is_legal_response_code>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jl     1123 <is_legal_response_code+0x23>
mov    $0x1,%al
cmpl   $0x258,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1148 <is_legal_response_code+0x48>
xor    %eax,%eax
cmpl   $0x3e8,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1142 <is_legal_response_code+0x42>
cmpl   $0x1388,-0x4(%rbp)
setl   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_legal_response_code>:
lea    -0x64(%rdi),%eax
cmp    $0x1f4,%eax
setb   %al
add    $0xfffffc18,%edi
cmp    $0xfa0,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_legal_response_code(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 100
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 600
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 1000
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 5000
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_legal_response_code(i32 %0) {
%2 = add i32 %0, -100
%3 = icmp ult i32 %2, 500
%4 = add i32 %0, -1000
%5 = icmp ult i32 %4, 4000
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
void fd271(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
a:
  goto a;
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd271>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd271+0x7>

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

LLVM IR (-O0):
define void @fd271(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
47: ; preds = %47
br label %47
}

LLVM IR (-O2):
define void @fd271(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ quickSort(int *, int /*<<< orphan*/, int);
int main() {
  int a[] = {7, 12, 1, -2, 0, 15, 4, 11, 9};
  quickSort(a, 0, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <quickSort@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <quickSort@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [9 x i32] [i32 7, i32 12, i32 1, i32 -2, i32 0, i32 15, i32 4, i32 11, i32 9]
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
store i32 0, i32* %1
%3 = bitcast [9 x i32]* %2 to i8*
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%5 = call i32 @quickSort(i32* %4, i32 0, i32 8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [9 x i32] [i32 7, i32 12, i32 1, i32 -2, i32 0, i32 15, i32 4, i32 11, i32 9]
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @quickSort(i32* %3, i32 0, i32 8)
ret i32 0
}
void snd_init(void) {}


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

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

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

LLVM IR (-O2):
define void @snd_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
scalar_t__ waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void sigchld_handler(int s) {
  while (waitpid(-1, NULL, WNOHANG) > 0)
    ;
}


x86 assembly (clang, -O0):
<sigchld_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <waitpid@plt>
cmp    $0x0,%rax
jle    1141 <sigchld_handler+0x31>
jmp    111b <sigchld_handler+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld_handler>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <waitpid@plt>
test   %rax,%rax
jg     1120 <sigchld_handler+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
define void @sigchld_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* @WNOHANG
%5 = call i64 @waitpid(i32 -1, i32* null, i32 %4)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
define void @sigchld_handler(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @WNOHANG
%4 = tail call i64 @waitpid(i32 -1, i32* null, i32 %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
int fib(int n) {
  int i;
  if (n > 1) {
    return fib(n - 1) + fib(n - 2);
  } else if (n == 1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    114d <fib+0x3d>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    116a <fib+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1163 <fib+0x53>
movl   $0x1,-0x4(%rbp)
jmp    116a <fib+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     1136 <fib+0x26>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1120 <fib+0x10>
jmp    1138 <fib+0x28>
mov    %ebx,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ugt i32 %4, 3
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = add nsw i32 %12, %15
ret i32 %16
}
double floor(double num) {
  if (num >= 0)
    return (double)(int)(num);
  else {
    if (num - (double)(int)num == 0.0)
      return (double)(int)num;
    else
      return (double)(int)(num - 1.0);
  }
}


x86 assembly (clang, -O0):
<floor>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112e <floor+0x2e>
cvttsd2si -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <floor+0x84>
movsd  -0x10(%rbp),%xmm0
cvttsd2si -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1166 <floor+0x66>
jp     1166 <floor+0x66>
cvttsd2si -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <floor+0x84>
movsd  -0x10(%rbp),%xmm0
movsd  0xe8d(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<floor>:
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm2
movapd %xmm0,%xmm3
movsd  0xeec(%rip),%xmm1
addsd  %xmm0,%xmm1
cvttpd2dq %xmm1,%xmm1
subsd  %xmm2,%xmm3
cvtdq2pd %xmm1,%xmm4
xorpd  %xmm1,%xmm1
cmpeqsd %xmm1,%xmm3
movapd %xmm3,%xmm5
andpd  %xmm2,%xmm5
andnpd %xmm4,%xmm3
orpd   %xmm5,%xmm3
cmplesd %xmm0,%xmm1
movapd %xmm1,%xmm0
andnpd %xmm3,%xmm0
andpd  %xmm2,%xmm1
orpd   %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @floor(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fptosi double %7 to i32
%9 = sitofp i32 %8 to double
store double %9, double* %2
br label %26
10: ; preds = %1
%11 = load double, double* %3
%12 = load double, double* %3
%13 = fptosi double %12 to i32
%14 = sitofp i32 %13 to double
%15 = fsub double %11, %14
%16 = fcmp oeq double %15, 0.000000e+00
br i1 %16, label %17, label %21
17: ; preds = %10
%18 = load double, double* %3
%19 = fptosi double %18 to i32
%20 = sitofp i32 %19 to double
store double %20, double* %2
br label %26
21: ; preds = %10
%22 = load double, double* %3
%23 = fsub double %22, 1.000000e+00
%24 = fptosi double %23 to i32
%25 = sitofp i32 %24 to double
store double %25, double* %2
br label %26
26: ; preds = %21, %17, %6
%27 = load double, double* %2
ret double %27
}

LLVM IR (-O2):
define double @floor(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = fptosi double %0 to i32
%4 = sitofp i32 %3 to double
%5 = fsub double %0, %4
%6 = fcmp oeq double %5, 0.000000e+00
%7 = select i1 %2, i1 true, i1 %6
%8 = fadd double %0, -1.000000e+00
%9 = fptosi double %8 to i32
%10 = sitofp i32 %9 to double
%11 = select i1 %7, double %4, double %10
ret double %11
}
int escape_type_name(char *name) {
  while (*name) {
    if (*name == '.')
      *name = '_';
    ++name;
  }
  return (0);
}


x86 assembly (clang, -O0):
<escape_type_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <escape_type_name+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    112c <escape_type_name+0x2c>
mov    -0x8(%rbp),%rax
movb   $0x5f,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <escape_type_name+0x8>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<escape_type_name>:
jmp    1117 <escape_type_name+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x5f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2e,%al
je     1110 <escape_type_name+0x10>
test   %al,%al
jne    1113 <escape_type_name+0x13>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @escape_type_name(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 46, label %5
]
5: ; preds = %2
store i8 95, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret i32 0
}
/* Variables and functions */
int dlink_append_last(void *);
int add(void *p) { return dlink_append_last(p); }


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

x86 assembly (clang, -O2):
<add>:
jmp    1030 <dlink_append_last@plt>

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

LLVM IR (-O2):
define i32 @add(i8* %0) {
%2 = tail call i32 @dlink_append_last(i8* %0)
ret i32 %2
}
const char *__attribute__((short_call)) __attribute__((section(".test.c")))
__attribute__((no)) strong_s3(void) {
  return "strong_s3";
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"strong_s3\00"
define i8* @strong_s3() section ".test.c" {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *x_realloc(void *ptr, size_t size) {
  void *mem = realloc(ptr, size);
  if (size > 0 && !mem) {
    fprintf(stderr, "Unable to allocate memory\n");
    exit(EXIT_FAILURE);
  }
  return mem;
}


x86 assembly (clang, -O0):
<x_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    118a <x_realloc+0x5a>
cmpq   $0x0,-0x18(%rbp)
jne    118a <x_realloc+0x5a>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_realloc>:
push   %rbx
mov    %rsi,%rbx
call   1040 <realloc@plt>
test   %rbx,%rbx
je     1143 <x_realloc+0x13>
test   %rax,%rax
je     1145 <x_realloc+0x15>
pop    %rbx
ret
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Unable to allocate memory\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @x_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i64, i64* %4
%10 = icmp ugt i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %19, label %14
14: ; preds = %11
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %11, %2
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Unable to allocate memory\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @x_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i64 %1, 0
%5 = icmp ne i8* %3, null
%6 = or i1 %4, %5
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = tail call i32 @exit(i32 %10)
unreachable
12: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void imprimirDivisores(int n) {
  int i;
  for (i = 1; i <= n; i++) {
    if (n % i == 0) {
      printf("%d\n", i);
    }
  }
}


x86 assembly (clang, -O0):
<imprimirDivisores>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1160 <imprimirDivisores+0x50>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    114d <imprimirDivisores+0x3d>
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    1152 <imprimirDivisores+0x42>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <imprimirDivisores+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimirDivisores>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1158 <imprimirDivisores+0x48>
mov    %edi,%r15d
mov    %edi,%ebp
neg    %ebp
mov    $0x1,%ebx
lea    0xed2(%rip),%r14
jmp    1142 <imprimirDivisores+0x32>
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
je     1158 <imprimirDivisores+0x48>
mov    %r15d,%eax
cltd
idiv   %ebx
test   %edx,%edx
jne    1130 <imprimirDivisores+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <imprimirDivisores+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @imprimirDivisores(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %17, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp sle i32 %5, %6
br i1 %7, label %8, label %20
8: ; preds = %4
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = srem i32 %9, %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %8
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %4
20: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @imprimirDivisores(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1, %9
%4 = phi i32 [ %10, %9 ], [ 1, %1 ]
%5 = srem i32 %0, %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %9
9: ; preds = %3, %7
%10 = add nuw i32 %4, 1
%11 = icmp eq i32 %4, %0
br i1 %11, label %12, label %3
12: ; preds = %9, %1
ret void
}
char sign(unsigned char value) { return (char)value; }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @sign(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @sign(i8 returned zeroext %0) {
ret i8 %0
}
int hexchar(char c) {
  if (c >= '0' && c <= '9')
    c = c - '0';
  else
    c = c - 'a' + 10;
  return c;
}


x86 assembly (clang, -O0):
<hexchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <hexchar+0x33>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <hexchar+0x33>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1140 <hexchar+0x40>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexchar>:
lea    -0x30(%rdi),%eax
add    $0xa9,%dil
cmp    $0xa,%al
movzbl %al,%eax
movzbl %dil,%ecx
cmovb  %eax,%ecx
movsbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @hexchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 48
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %21
15: ; preds = %6, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 97
%19 = add nsw i32 %18, 10
%20 = trunc i32 %19 to i8
store i8 %20, i8* %2
br label %21
21: ; preds = %15, %10
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @hexchar(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = add i8 %0, -87
%5 = select i1 %3, i8 %2, i8 %4
%6 = sext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ read(int, char *, int);
unsigned char sgetc(int f) {
  char ret;
  read(f, &ret, 1);
  return ret;
}


x86 assembly (clang, -O0):
<sgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movzbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgetc>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

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

LLVM IR (-O2):
define zeroext i8 @sgetc(i32 %0) {
%2 = alloca i8
%3 = call i32 @read(i32 %0, i8* %2, i32 1)
%4 = load i8, i8* %2
ret i8 %4
}
int _swap4(unsigned int src1) {
  unsigned char v0 = src1;
  unsigned char v1 = src1 >> 8;
  unsigned char v2 = src1 >> 16;
  unsigned char v3 = src1 >> 24;
  unsigned v = v0 << 8 | v1 | v2 << 24 | v3 << 16;
  return v;
}


x86 assembly (clang, -O0):
<_swap4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    %al,-0x7(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
mov    %al,-0x8(%rbp)
movzbl -0x5(%rbp),%eax
shl    $0x8,%eax
movzbl -0x6(%rbp),%ecx
or     %ecx,%eax
movzbl -0x7(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
movzbl -0x8(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_swap4>:
mov    %edi,%eax
rol    $0x8,%ax
movzwl %ax,%ecx
mov    %edi,%eax
shl    $0x8,%eax
and    $0xff000000,%eax
shr    $0x8,%edi
and    $0xff0000,%edi
or     %edi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_swap4(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
store i32 %0, i32* %2
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = load i32, i32* %2
%11 = lshr i32 %10, 8
%12 = trunc i32 %11 to i8
store i8 %12, i8* %4
%13 = load i32, i32* %2
%14 = lshr i32 %13, 16
%15 = trunc i32 %14 to i8
store i8 %15, i8* %5
%16 = load i32, i32* %2
%17 = lshr i32 %16, 24
%18 = trunc i32 %17 to i8
store i8 %18, i8* %6
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = shl i32 %20, 8
%22 = load i8, i8* %4
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%25 = load i8, i8* %5
%26 = zext i8 %25 to i32
%27 = shl i32 %26, 24
%28 = or i32 %24, %27
%29 = load i8, i8* %6
%30 = zext i8 %29 to i32
%31 = shl i32 %30, 16
%32 = or i32 %28, %31
store i32 %32, i32* %7
%33 = load i32, i32* %7
ret i32 %33
}

LLVM IR (-O2):
define i32 @_swap4(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
%5 = shl i32 %0, 8
%6 = and i32 %5, -16777216
%7 = lshr i32 %0, 8
%8 = and i32 %7, 16711680
%9 = or i32 %8, %6
%10 = or i32 %9, %4
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char p[] = "x";
  printf("%s\n", p);
  printf("%s\n", "n ## f");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0x6(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    0xebe(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x78,0xe(%rsp)
lea    0xedd(%rip),%rbx
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.p = [2 x i8] c"x\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"n ## f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8]
store i32 0, i32* %1
%3 = bitcast [2 x i8]* %2 to i8*
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"n ## f\00"
define i32 @main() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
store i16 120, i16* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct qcc_stream_data {
  int dummy;
};
struct qcc_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ qcc_list_init(struct qcc_list *);
void qcc_stream_data_init(struct qcc_stream_data *list) {
  qcc_list_init((struct qcc_list *)list);
}


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

x86 assembly (clang, -O2):
<qcc_stream_data_init>:
jmp    1030 <qcc_list_init@plt>

LLVM IR (-O0):
%struct.qcc_stream_data = type { i32 }
%struct.qcc_list = type { i32 }
define void @qcc_stream_data_init(%struct.qcc_stream_data* %0) {
%2 = alloca %struct.qcc_stream_data*
store %struct.qcc_stream_data* %0, %struct.qcc_stream_data** %2
%3 = load %struct.qcc_stream_data*, %struct.qcc_stream_data** %2
%4 = bitcast %struct.qcc_stream_data* %3 to %struct.qcc_list*
%5 = call i32 @qcc_list_init(%struct.qcc_list* %4)
ret void
}

LLVM IR (-O2):
%struct.qcc_stream_data = type { i32 }
%struct.qcc_list = type { i32 }
define void @qcc_stream_data_init(%struct.qcc_stream_data* %0) {
%2 = bitcast %struct.qcc_stream_data* %0 to %struct.qcc_list*
%3 = tail call i32 @qcc_list_init(%struct.qcc_list* %2)
ret void
}
int ft_isdigit(int c) {
  if (c >= '0' && c <= '9')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <ft_isdigit+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <ft_isdigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isdigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void pci_set_acpi_fwnode(struct pci_dev *dev) {}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define void @pci_set_acpi_fwnode(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_set_acpi_fwnode(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int EOF;
bool is_eof(int c) {
  if (c == EOF) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_eof>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed7(%rip),%rcx
cmp    (%rcx),%eax
jne    1125 <is_eof+0x25>
movl   $0x1,-0x4(%rbp)
jmp    112c <is_eof+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_eof>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
sete   %al
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @is_eof(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @is_eof(i32 %0) {
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_mutex_try_lock() {
  printf("NOT IMPLEMENTED:"
         "pa_mutex_try_lock"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"NOT IMPLEMENTED:pa_mutex_try_lock\0A\00"
define i32 @pa_mutex_try_lock() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_mutex_try_lock\00"
define i32 @pa_mutex_try_lock() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int stress_cache_set_flag(int);
int stress_cache_set_noaff(const char *opt) {
  (void)opt;
  return stress_cache_set_flag((0x10));
}


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

x86 assembly (clang, -O2):
<stress_cache_set_noaff>:
mov    $0x10,%edi
jmp    1030 <stress_cache_set_flag@plt>

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

LLVM IR (-O2):
define i32 @stress_cache_set_noaff(i8* nocapture readnone %0) {
%2 = tail call i32 @stress_cache_set_flag(i32 16)
ret i32 %2
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ Machine_Check(int, char *);
int32_t get_byte(int32_t id, int32_t addr) {
  Machine_Check(0x00000008 | 0x00000002, "Disk: illegal byte register access");
  return 0xFFFFFFFF;
}


x86 assembly (clang, -O0):
<get_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xa,%edi
lea    0xed6(%rip),%rsi
call   1030 <Machine_Check@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_byte>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0xa,%edi
call   1030 <Machine_Check@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Disk: illegal byte register access\00"
define i32 @get_byte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @Machine_Check(i32 10, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [35 x i8] c"Disk: illegal byte register access\00"
define i32 @get_byte(i32 %0, i32 %1) {
%3 = tail call i32 @Machine_Check(i32 10, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}