xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void show_version() { fprintf(stdout, "rer v%s\n", "_RER_VERSION"); }


x86 assembly (clang, -O0):
<show_version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xede(%rip),%rdx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xee2(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"rer v%s\0A\00"
@.str.1 = [13 x i8] c"_RER_VERSION\00"
define void @show_version() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"rer v%s\0A\00"
@.str.1 = [13 x i8] c"_RER_VERSION\00"
define void @show_version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hkgc_wash();
int /*<<< orphan*/ sleep(int);
void *hkgc_boot(void *opid) {
  while (1) {
    switch (*(int *)opid) {
    case 0x0001:
      sleep(20);
      break;
    case 0x0002:
      hkgc_wash();
      break;
    default:
      break;
    }
  }
  return NULL;
}


x86 assembly (clang, -O0):
<hkgc_boot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1154 <hkgc_boot+0x34>
jmp    1143 <hkgc_boot+0x23>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1163 <hkgc_boot+0x43>
jmp    116f <hkgc_boot+0x4f>
mov    $0x14,%edi
call   1040 <sleep@plt>
jmp    1174 <hkgc_boot+0x54>
mov    $0x0,%al
call   1030 <hkgc_wash@plt>
jmp    1174 <hkgc_boot+0x54>
jmp    1174 <hkgc_boot+0x54>
jmp    112c <hkgc_boot+0xc>

x86 assembly (clang, -O2):
<hkgc_boot>:
push   %rbx
mov    %rdi,%rbx
jmp    1137 <hkgc_boot+0x17>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <hkgc_wash@plt>
mov    (%rbx),%eax
cmp    $0x2,%eax
je     1130 <hkgc_boot+0x10>
cmp    $0x1,%eax
jne    1137 <hkgc_boot+0x17>
mov    $0x14,%edi
call   1040 <sleep@plt>
jmp    1137 <hkgc_boot+0x17>

LLVM IR (-O0):
define i8* @hkgc_boot(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %12
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
switch i32 %6, label %11 [
i32 1, label %7
i32 2, label %9
]
7: ; preds = %3
%8 = call i32 @sleep(i32 20)
br label %12
9: ; preds = %3
%10 = call i32 (...) @hkgc_wash()
br label %12
11: ; preds = %3
br label %12
12: ; preds = %11, %9, %7
br label %3
}

LLVM IR (-O2):
define noalias i8* @hkgc_boot(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
br label %3
3: ; preds = %5, %1
%4 = load i32, i32* %2
switch i32 %4, label %5 [
i32 1, label %6
i32 2, label %8
]
5: ; preds = %3, %8, %6
br label %3
6: ; preds = %3
%7 = tail call i32 @sleep(i32 20)
br label %5
8: ; preds = %3
%9 = tail call i32 (...) @hkgc_wash()
br label %5
}
void ClearInput(void) {}


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

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

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

LLVM IR (-O2):
define void @ClearInput() {
ret void
}
/* Variables and functions */
scalar_t__ frexp(double, int *);
float frexpf(float x, int *_exp) { return (float)frexp((double)x, _exp); }


x86 assembly (clang, -O0):
<frexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <frexp@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frexpf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <frexp@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @frexpf(float %0, i32* %1) {
%3 = alloca float
%4 = alloca i32*
store float %0, float* %3
store i32* %1, i32** %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = load i32*, i32** %4
%8 = call i64 @frexp(double %6, i32* %7)
%9 = sitofp i64 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @frexpf(float %0, i32* nocapture %1) {
%3 = fpext float %0 to double
%4 = tail call i64 @frexp(double %3, i32* %1)
%5 = sitofp i64 %4 to float
ret float %5
}
/* Variables and functions */
#define GLUT_KEY_DOWN 129
#define GLUT_KEY_UP 128
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ leveldown();
int /*<<< orphan*/ levelup();
void special(int key, int x, int y) {
  switch (key) {
  case GLUT_KEY_UP:
    levelup();
    break;
  case GLUT_KEY_DOWN:
    leveldown();
    break;
  }
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<special>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x80,%eax
je     116a <special+0x3a>
jmp    1157 <special+0x27>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
je     1176 <special+0x46>
jmp    117d <special+0x4d>
mov    $0x0,%al
call   1030 <levelup@plt>
jmp    117d <special+0x4d>
mov    $0x0,%al
call   1050 <leveldown@plt>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<special>:
push   %rax
cmp    $0x81,%edi
je     114a <special+0x1a>
cmp    $0x80,%edi
jne    1151 <special+0x21>
xor    %eax,%eax
call   1030 <levelup@plt>
jmp    1151 <special+0x21>
xor    %eax,%eax
call   1050 <leveldown@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutPostRedisplay@plt>

LLVM IR (-O0):
define void @special(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
switch i32 %7, label %12 [
i32 128, label %8
i32 129, label %10
]
8: ; preds = %3
%9 = call i32 (...) @levelup()
br label %12
10: ; preds = %3
%11 = call i32 (...) @leveldown()
br label %12
12: ; preds = %3, %10, %8
%13 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
define void @special(i32 %0, i32 %1, i32 %2) {
switch i32 %0, label %8 [
i32 128, label %4
i32 129, label %6
]
4: ; preds = %3
%5 = tail call i32 (...) @levelup()
br label %8
6: ; preds = %3
%7 = tail call i32 (...) @leveldown()
br label %8
8: ; preds = %3, %6, %4
%9 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xa7() {
  Assert_real((iscntrl(167) == 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_iscntrl.c",
              840, ("iscntrl should be 0 for 0xa7"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xa7>:
push   %rax
mov    $0xa7,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x348,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xa7\00"
define void @t_iscntrl_0xa7() {
%1 = call i64 @iscntrl(i32 167)
%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 840, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xa7\00"
define void @t_iscntrl_0xa7() {
%1 = tail call i64 @iscntrl(i32 167)
%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 840, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void watchdog_reset() {}


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

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

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

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

/* Variables and functions */
void targa_image_decode(FILE *inf) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void ttl_error_print_string(FILE *f, char *s) { fprintf(f, "%s", s); }


x86 assembly (clang, -O0):
<ttl_error_print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttl_error_print_string>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
define void @ttl_error_print_string(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @fputs(i8* %1, i32* %0)
ret void
}
void RTLockValidatorHoldsLocksInClass(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLockValidatorHoldsLocksInClass() {
ret void
}
/* Variables and functions */
char *_agstrcanon(char *, char *);
char *agcanonhtmlstr(char *, char *);
scalar_t__ aghtmlstr(char *);
char *agstrcanon(char *arg, char *buf) {
  if (aghtmlstr(arg))
    return agcanonhtmlstr(arg, buf);
  else
    return _agstrcanon(arg, buf);
}


x86 assembly (clang, -O0):
<agstrcanon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <aghtmlstr@plt>
cmp    $0x0,%rax
je     1169 <agstrcanon+0x39>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <agcanonhtmlstr@plt>
mov    %rax,-0x8(%rbp)
jmp    117a <agstrcanon+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <_agstrcanon@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agstrcanon>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <aghtmlstr@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
test   %rax,%rax
je     1156 <agstrcanon+0x26>
pop    %rbx
pop    %r14
jmp    1050 <agcanonhtmlstr@plt>
pop    %rbx
pop    %r14
jmp    1030 <_agstrcanon@plt>

LLVM IR (-O0):
define i8* @agstrcanon(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = call i64 @aghtmlstr(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = call i8* @agcanonhtmlstr(i8* %10, i8* %11)
store i8* %12, i8** %3
br label %17
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = call i8* @_agstrcanon(i8* %14, i8* %15)
store i8* %16, i8** %3
br label %17
17: ; preds = %13, %9
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @agstrcanon(i8* %0, i8* %1) {
%3 = tail call i64 @aghtmlstr(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @agcanonhtmlstr(i8* %0, i8* %1)
br label %9
7: ; preds = %2
%8 = tail call i8* @_agstrcanon(i8* %0, i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %6, %5 ], [ %8, %7 ]
ret i8* %10
}
/* Variables and functions */
scalar_t__ gsm_hex2int(char *, int);
char *pdu_get_smsc_toa(char *body, char *smsc_toa) {
  char *pBegin, *pEnd;
  pBegin = body;
  pEnd = pBegin + 2;
  *smsc_toa = (char)gsm_hex2int(pBegin, 2);
  return pEnd;
}


x86 assembly (clang, -O0):
<pdu_get_smsc_toa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1030 <gsm_hex2int@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdu_get_smsc_toa>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0x2(%rdi),%rbx
mov    $0x2,%esi
call   1030 <gsm_hex2int@plt>
mov    %al,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @pdu_get_smsc_toa(i8* %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = tail call i64 @gsm_hex2int(i8* %0, i32 2)
%5 = trunc i64 %4 to i8
store i8 %5, i8* %1
ret i8* %3
}
/* Variables and functions */
scalar_t__ isspace(char const);
size_t skip_space(const char *text) {
  size_t i = 0;
  while (isspace(text[i]) && text[i] != '\n') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     115c <skip_space+0x4c>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116c <skip_space+0x5c>
jmp    117d <skip_space+0x6d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <skip_space+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1030 <isspace@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     114b <skip_space+0x3b>
cs nopw 0x0(%rax,%rax,1)
cmpb   $0xa,(%r14,%rbx,1)
je     114b <skip_space+0x3b>
movsbl 0x1(%r14,%rbx,1),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1130 <skip_space+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @skip_space(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isspace(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %1, %10
%6 = phi i8* [ %12, %10 ], [ %0, %1 ]
%7 = phi i64 [ %11, %10 ], [ 0, %1 ]
%8 = load i8, i8* %6
%9 = icmp eq i8 %8, 10
br i1 %9, label %16, label %10
10: ; preds = %5
%11 = add i64 %7, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = tail call i64 @isspace(i8 signext %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %10, %1
%17 = phi i64 [ 0, %1 ], [ %11, %10 ], [ %7, %5 ]
ret i64 %17
}
void tty_diag_channel_close(struct usb_diag_ch *diag_ch) {}


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

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

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

LLVM IR (-O2):
%struct.usb_diag_ch = type opaque
define void @tty_diag_channel_close(%struct.usb_diag_ch* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ xprintf(char *);
int main(int argc, char **argv) {
  if (argc) {
    printf("argc is nonzero\n");
    return 0;
  };
  xprintf(argv[3]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1158 <main+0x38>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1040 <xprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
test   %edi,%edi
je     1133 <main+0x13>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
jmp    113c <main+0x1c>
mov    0x18(%rsi),%rdi
call   1040 <xprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"argc is nonzero\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 3
%13 = load i8*, i8** %12
%14 = call i32 @xprintf(i8* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@str = [16 x i8] c"argc is nonzero\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 3
%8 = load i8*, i8** %7
%9 = tail call i32 @xprintf(i8* %8)
br label %10
10: ; preds = %6, %4
ret i32 0
}
int CLZ(int mask) { return mask ? __builtin_clz(mask) : 32; }


x86 assembly (clang, -O0):
<CLZ>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1122 <CLZ+0x22>
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <CLZ+0x2f>
mov    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <CLZ+0x2f>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CLZ>:
test   %edi,%edi
je     110b <CLZ+0xb>
bsr    %edi,%eax
xor    $0x1f,%eax
ret
mov    $0x20,%eax
ret

LLVM IR (-O0):
define i32 @CLZ(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @llvm.ctlz.i32(i32 %6, i1 true)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 32, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @CLZ(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 false)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ done(int);
void sigDone(int signum) { done(100); }


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

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

LLVM IR (-O0):
define void @sigDone(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @done(i32 100)
ret void
}

LLVM IR (-O2):
define void @sigDone(i32 %0) {
%2 = tail call i32 @done(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PreConnection(char *, char, int /*<<< orphan*/);
void Stor(char *param) { PreConnection(param, 'w', 0); }


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

x86 assembly (clang, -O2):
<Stor>:
mov    $0x77,%esi
xor    %edx,%edx
jmp    1030 <PreConnection@plt>

LLVM IR (-O0):
define void @Stor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @PreConnection(i8* %3, i8 signext 119, i32 0)
ret void
}

LLVM IR (-O2):
define void @Stor(i8* %0) {
%2 = tail call i32 @PreConnection(i8* %0, i8 signext 119, i32 0)
ret void
}
/* Variables and functions */
int vrna_aln_mpi(char **, int, int, int *);
int get_mpi(char *Alseq[], int n_seq, int length, int *mini) {
  return vrna_aln_mpi(Alseq, n_seq, length, mini);
}


x86 assembly (clang, -O0):
<get_mpi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <vrna_aln_mpi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mpi>:
jmp    1030 <vrna_aln_mpi@plt>

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

LLVM IR (-O2):
define i32 @get_mpi(i8** %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32 @vrna_aln_mpi(i8** %0, i32 %1, i32 %2, i32* %3)
ret i32 %5
}
parent1(childpid) int childpid;
{
  int func(), n;
  for (n = 0; n < 5000; n++)
    ;
  while (kill(childpid, 2) < 0)
    ;
  wait(&n);
}


x86 assembly (clang, -O0):
<parent1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1388,-0xc(%rbp)
jge    1152 <parent1+0x32>
jmp    1144 <parent1+0x24>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <parent1+0x12>
jmp    1157 <parent1+0x37>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <kill@plt>
cmp    $0x0,%eax
jge    1174 <parent1+0x54>
jmp    1157 <parent1+0x37>
lea    -0xc(%rbp),%rdi
mov    $0x0,%al
call   1040 <wait@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent1>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x1388,0xc(%rsp)
nop
mov    %ebx,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <kill@plt>
test   %eax,%eax
js     1130 <parent1+0x10>
lea    0xc(%rsp),%rdi
xor    %eax,%eax
call   1040 <wait@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @parent1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 5000
br i1 %7, label %8, label %12
8: ; preds = %5
br label %9
9: ; preds = %8
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
br label %5
12: ; preds = %5
br label %13
13: ; preds = %17, %12
%14 = load i32, i32* %3
%15 = call i32 (i32, i32, ...) bitcast (i32 (...)* @kill to i32 (i32, i32, ...)*)(i32 %14, i32 2)
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
br label %13
18: ; preds = %13
%19 = call i32 (i32*, ...) bitcast (i32 (...)* @wait to i32 (i32*, ...)*)(i32* %4)
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @parent1(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 5000, i32* %2
br label %4
4: ; preds = %1, %4
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @kill to i32 (i32, i32, ...)*)(i32 %0, i32 2)
%6 = icmp slt i32 %5, 0
br i1 %6, label %4, label %7
7: ; preds = %4
%8 = call i32 (i32*, ...) bitcast (i32 (...)* @wait to i32 (i32*, ...)*)(i32* %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *);
int rmdir(char *);
int executeRmdirCommand(char *arg) {
  int ret = 0;
  ret = rmdir(arg);
  if (!ret) {
    printf("Directory %s deleted\n", arg);
  } else {
    perror("Delete Error");
  }
  return ret;
}


x86 assembly (clang, -O0):
<executeRmdirCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rmdir@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    116e <executeRmdirCommand+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
jmp    117a <executeRmdirCommand+0x4a>
lea    0xea1(%rip),%rdi
call   1050 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<executeRmdirCommand>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <rmdir@plt>
mov    %eax,%ebp
test   %eax,%eax
jne    1159 <executeRmdirCommand+0x29>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xeb6(%rip),%rdi
call   1050 <perror@plt>
jmp    1150 <executeRmdirCommand+0x20>

LLVM IR (-O0):
@.str = [22 x i8] c"Directory %s deleted\0A\00"
@.str.1 = [13 x i8] c"Delete Error\00"
define i32 @executeRmdirCommand(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 @rmdir(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %13
11: ; preds = %1
%12 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [22 x i8] c"Directory %s deleted\0A\00"
@.str.1 = [13 x i8] c"Delete Error\00"
define i32 @executeRmdirCommand(i8* %0) {
%2 = tail call i32 @rmdir(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printErrors(char message[], int amount) {
  for (int i = 0; i < amount; i++)
    printf("ERROR! %s\n", message);
}


x86 assembly (clang, -O0):
<printErrors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <printErrors+0x40>
mov    -0x8(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printErrors+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printErrors>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1140 <printErrors+0x30>
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xedb(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <printErrors+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"ERROR! %s\0A\00"
define void @printErrors(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %4, label %5
}
int my_power_rec(int nb, int power) {
  if (power == 0)
    return (1);
  if (power < 0)
    return (0);
  if (power >= 1)
    return (nb * my_power_rec(nb, power - 1));
  return (nb);
}


x86 assembly (clang, -O0):
<my_power_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <my_power_rec+0x24>
movl   $0x1,-0x4(%rbp)
jmp    117e <my_power_rec+0x6e>
cmpl   $0x0,-0xc(%rbp)
jge    114a <my_power_rec+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    117e <my_power_rec+0x6e>
cmpl   $0x1,-0xc(%rbp)
jl     1178 <my_power_rec+0x68>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <my_power_rec@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    117e <my_power_rec+0x6e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_power_rec>:
mov    $0x1,%eax
test   %esi,%esi
je     1128 <my_power_rec+0x28>
nopl   0x0(%rax)
test   %esi,%esi
js     1123 <my_power_rec+0x23>
imul   %edi,%eax
add    $0xffffffff,%esi
jne    1110 <my_power_rec+0x10>
mov    $0x1,%ecx
jmp    1125 <my_power_rec+0x25>
xor    %ecx,%ecx
imul   %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @my_power_rec(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %16, label %4
4: ; preds = %2, %8
%5 = phi i32 [ %9, %8 ], [ %1, %2 ]
%6 = phi i32 [ %10, %8 ], [ 1, %2 ]
%7 = icmp slt i32 %5, 0
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = add nsw i32 %5, -1
%10 = mul nsw i32 %6, %0
%11 = icmp eq i32 %9, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %8
%13 = phi i32 [ %10, %8 ], [ %6, %4 ]
%14 = phi i32 [ 1, %8 ], [ 0, %4 ]
%15 = mul nuw nsw i32 %14, %13
br label %16
16: ; preds = %12, %2
%17 = phi i32 [ %15, %12 ], [ 1, %2 ]
ret i32 %17
}
long int d(long int n) {
  long int sum = -n;
  int i;
  for (i = 1; i * i <= n; i++)
    if (n % i == 0)
      sum += i + n / i;
  return sum;
}


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
cmp    -0x8(%rbp),%rax
jg     117d <d+0x7d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    116a <d+0x6a>
movslq -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    116f <d+0x6f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <d+0x19>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d>:
mov    %rdi,%rcx
neg    %rcx
test   %rdi,%rdi
jle    1157 <d+0x57>
mov    $0x1,%esi
jmp    1143 <d+0x43>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rdi,%rax
cqto
idiv   %rsi
add    %rcx,%rax
add    %rsi,%rax
test   %rdx,%rdx
cmove  %rax,%rcx
add    $0x1,%rsi
mov    %esi,%eax
imul   %eax,%eax
cmp    %rdi,%rax
jg     1157 <d+0x57>
mov    %rdi,%rax
or     %rsi,%rax
shr    $0x20,%rax
jne    1120 <d+0x20>
mov    %edi,%eax
xor    %edx,%edx
div    %esi
jmp    1128 <d+0x28>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @d(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = sub nsw i64 0, %5
store i64 %6, i64* %3
store i32 1, i32* %4
br label %7
7: ; preds = %31, %1
%8 = load i32, i32* %4
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = sext i32 %10 to i64
%12 = load i64, i64* %2
%13 = icmp sle i64 %11, %12
br i1 %13, label %14, label %34
14: ; preds = %7
%15 = load i64, i64* %2
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = srem i64 %15, %17
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %30
20: ; preds = %14
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = load i64, i64* %2
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = sdiv i64 %23, %25
%27 = add nsw i64 %22, %26
%28 = load i64, i64* %3
%29 = add nsw i64 %28, %27
store i64 %29, i64* %3
br label %30
30: ; preds = %20, %14
br label %31
31: ; preds = %30
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %7
34: ; preds = %7
%35 = load i64, i64* %3
ret i64 %35
}

LLVM IR (-O2):
define i64 @d(i64 %0) {
%2 = sub nsw i64 0, %0
%3 = icmp slt i64 %0, 1
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %13, %4 ], [ 1, %1 ]
%6 = phi i64 [ %12, %4 ], [ %2, %1 ]
%7 = srem i64 %0, %5
%8 = sdiv i64 %0, %5
%9 = icmp eq i64 %7, 0
%10 = add i64 %6, %5
%11 = add i64 %10, %8
%12 = select i1 %9, i64 %11, i64 %6
%13 = add nuw nsw i64 %5, 1
%14 = mul i64 %13, %13
%15 = and i64 %14, 4294967295
%16 = icmp sgt i64 %15, %0
br i1 %16, label %17, label %4
17: ; preds = %4, %1
%18 = phi i64 [ %2, %1 ], [ %12, %4 ]
ret i64 %18
}
void auth_encrypt_connect(int cnt) { (void)cnt; }


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

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

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

LLVM IR (-O2):
define void @auth_encrypt_connect(i32 %0) {
ret void
}
void border_se_ext_diagonal_special_sand_long_vert(unsigned char *pic,
                                                   unsigned char *mirr) {
  *pic = 0x2F;
  ;
}


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

x86 assembly (clang, -O2):
<border_se_ext_diagonal_special_sand_long_vert>:
movb   $0x2f,(%rdi)
ret

LLVM IR (-O0):
define void @border_se_ext_diagonal_special_sand_long_vert(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
store i8 47, i8* %5
ret void
}

LLVM IR (-O2):
define void @border_se_ext_diagonal_special_sand_long_vert(i8* nocapture writeonly %0, i8* nocapture readnone %1) {
store i8 47, i8* %0
ret void
}
/* Variables and functions */
double log2(double);
double log10(double x) {
  double log10_2;
  return log10_2 * log2(x);
}


x86 assembly (clang, -O0):
<log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log2@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jae    1125 <log10+0x15>
movsd  0xedd(%rip),%xmm0
pop    %rax
ret
call   1030 <log2@plt>
jmp    111b <log10+0xb>

LLVM IR (-O0):
define double @log10(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %3
%5 = load double, double* %2
%6 = call double @log2(double %5)
%7 = fmul double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @log10(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double @log2(double %0)
br label %5
5: ; preds = %1, %3
ret double 0x7FF8000000000000
}
void gtk_invisible_new_for_screen() {}


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

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

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

LLVM IR (-O2):
define void @gtk_invisible_new_for_screen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void error_exit(const char *msg) {
  printf("Error: %s\n", msg);
  exit(1);
}


x86 assembly (clang, -O0):
<error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_exit>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @error_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"Error: %s\0A\00"
define void @error_exit(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
const char *selectOpName(int id) {
  char *z;
  switch (id) {
  case 110:
    z = "UNION ALL";
    break;
  case 111:
    z = "INTERSECT";
    break;
  case 112:
    z = "EXCEPT";
    break;
  default:
    z = "UNION";
    break;
  }
  return z;
}


x86 assembly (clang, -O0):
<selectOpName>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x6e,%eax
je     113d <selectOpName+0x3d>
jmp    111b <selectOpName+0x1b>
mov    -0x14(%rbp),%eax
sub    $0x6f,%eax
je     114d <selectOpName+0x4d>
jmp    112c <selectOpName+0x2c>
mov    -0x14(%rbp),%eax
sub    $0x70,%eax
je     115d <selectOpName+0x5d>
jmp    116d <selectOpName+0x6d>
lea    0xebc(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1178 <selectOpName+0x78>
lea    0xeb6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1178 <selectOpName+0x78>
lea    0xeb0(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1178 <selectOpName+0x78>
lea    0xea7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<selectOpName>:
add    $0xffffff92,%edi
cmp    $0x2,%edi
ja     111a <selectOpName+0x1a>
movslq %edi,%rax
lea    0xf12(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xefa(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"UNION ALL\00"
@.str.1 = [10 x i8] c"INTERSECT\00"
@.str.2 = [7 x i8] c"EXCEPT\00"
@.str.3 = [6 x i8] c"UNION\00"
define i8* @selectOpName(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %8 [
i32 110, label %5
i32 111, label %6
i32 112, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %3
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [10 x i8] c"UNION ALL\00"
@.str.1 = [10 x i8] c"INTERSECT\00"
@.str.2 = [7 x i8] c"EXCEPT\00"
@.str.3 = [6 x i8] c"UNION\00"
@reltable.selectOpName = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.selectOpName to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.selectOpName to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.selectOpName to i64)) to i32)]
define i8* @selectOpName(i32 %0) {
%2 = add i32 %0, -110
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.selectOpName to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %9
}
/* Variables and functions */
double fabs(double);
double sign(double a, double b) {
  if (b >= 0.)
    return fabs(a);
  else
    return -fabs(a);
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113a <sign+0x3a>
movsd  -0x10(%rbp),%xmm0
movaps 0xed4(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1166 <sign+0x66>
movsd  -0x10(%rbp),%xmm0
movaps 0xeba(%rip),%xmm1
pand   %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
movapd 0xef8(%rip),%xmm2
andpd  %xmm0,%xmm2
orpd   0xefc(%rip),%xmm0
xorpd  %xmm3,%xmm3
cmpnlesd %xmm1,%xmm3
andpd  %xmm3,%xmm0
andnpd %xmm2,%xmm3
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @sign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = fcmp oge double %6, 0.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load double, double* %4
%10 = call double @llvm.fabs.f64(double %9)
store double %10, double* %3
br label %15
11: ; preds = %2
%12 = load double, double* %4
%13 = call double @llvm.fabs.f64(double %12)
%14 = fneg double %13
store double %14, double* %3
br label %15
15: ; preds = %11, %8
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @sign(double %0, double %1) {
%3 = fcmp ult double %1, 0.000000e+00
%4 = tail call double @llvm.fabs.f64(double %0)
%5 = fneg double %4
%6 = select i1 %3, double %5, double %4
ret double %6
}
void OTG_HS_EP1_OUT_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @OTG_HS_EP1_OUT_IRQHandler() {
ret void
}
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ st_push(struct forth_instance *, int);
void ver(struct forth_instance *fi) { st_push(fi, 101); }


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

x86 assembly (clang, -O2):
<ver>:
mov    $0x65,%esi
jmp    1030 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @ver(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%3 = load %struct.forth_instance*, %struct.forth_instance** %2
%4 = call i32 @st_push(%struct.forth_instance* %3, i32 101)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @ver(%struct.forth_instance* %0) {
%2 = tail call i32 @st_push(%struct.forth_instance* %0, i32 101)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void malloc_check_triple_pointer(uint8_t ***check_me, char *name) {
  if (check_me == NULL) {
    fprintf(stderr, "%s malloc error\n", name);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<malloc_check_triple_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115e <malloc_check_triple_pointer+0x3e>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_check_triple_pointer>:
test   %rdi,%rdi
je     1126 <malloc_check_triple_pointer+0x6>
ret
push   %rax
mov    %rsi,%rdx
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"%s malloc error\0A\00"
define void @malloc_check_triple_pointer(i32*** %0, i8* %1) {
%3 = alloca i32***
%4 = alloca i8*
store i32*** %0, i32**** %3
store i8* %1, i8** %4
%5 = load i32***, i32**** %3
%6 = icmp eq i32*** %5, null
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"%s malloc error\0A\00"
define void @malloc_check_triple_pointer(i32*** readnone %0, i8* %1) {
%3 = icmp eq i32*** %0, null
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
ret void
}