xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void test(bool test, const char *label) {
  if (test)
    printf("\x1B[32m"
           ""
           "\xE2\x9C\x94"
           ""
           "\033[0m"
           " : %s\n",
           label);
  else
    printf("\x1B[31m"
           ""
           "\xE2\x9C\x98"
           ""
           "\033[0m"
           " : %s\n",
           label);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <test+0x2e>
mov    -0x10(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    114e <test+0x3e>
mov    -0x10(%rbp),%rsi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
test   %edi,%edi
lea    0xefa(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\1B[32m\E2\9C\94\1B[0m : %s\0A\00"
@.str.1 = [19 x i8] c"\1B[31m\E2\9C\98\1B[0m : %s\0A\00"
define void @test(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 ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %13
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\1B[32m\E2\9C\94\1B[0m : %s\0A\00"
@.str.1 = [19 x i8] c"\1B[31m\E2\9C\98\1B[0m : %s\0A\00"
define void @test(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
void *a_thread_func() {
  sleep(10);
  fprintf(stderr, "Could not send cancel request correctly\n");
  return NULL;
}


x86 assembly (clang, -O0):
<a_thread_func>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1040 <sleep@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_thread_func>:
push   %rax
mov    $0xa,%edi
call   1040 <sleep@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Could not send cancel request correctly\0A\00"
define i8* @a_thread_func() {
%1 = call i32 @sleep(i32 10)
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Could not send cancel request correctly\0A\00"
define noalias i8* @a_thread_func() {
%1 = tail call i32 @sleep(i32 10)
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
__attribute__((noipa)) double f1(double a, double b) { return a < 0 ? a : b; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    112b <f1+0x2b>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1135 <f1+0x35>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm0
andnpd %xmm1,%xmm3
orpd   %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @f1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load double, double* %3
br label %11
9: ; preds = %2
%10 = load double, double* %4
br label %11
11: ; preds = %9, %7
%12 = phi double [ %8, %7 ], [ %10, %9 ]
ret double %12
}

LLVM IR (-O2):
define double @f1(double %0, double %1) {
%3 = fcmp olt double %0, 0.000000e+00
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long long quot;
  long long rem;
};
typedef TYPE_1__ lldiv_t;

/* Variables and functions */
lldiv_t lldiv(long long num, long long den) {
  lldiv_t rv;
  rv.quot = num / den;
  rv.rem = num % den;
  return rv;
}


x86 assembly (clang, -O0):
<lldiv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<lldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <lldiv+0x15>
cqto
idiv   %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define { i64, i64 } @lldiv(i64 %0, i64 %1) {
%3 = alloca %struct.TYPE_3__
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = sdiv i64 %6, %7
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 0
store i64 %8, i64* %9
%10 = load i64, i64* %4
%11 = load i64, i64* %5
%12 = srem i64 %10, %11
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
store i64 %12, i64* %13
%14 = bitcast %struct.TYPE_3__* %3 to { i64, i64 }*
%15 = load { i64, i64 }, { i64, i64 }* %14
ret { i64, i64 } %15
}

LLVM IR (-O2):
define { i64, i64 } @lldiv(i64 %0, i64 %1) {
%3 = sdiv i64 %0, %1
%4 = srem i64 %0, %1
%5 = insertvalue { i64, i64 } poison, i64 %3, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
/* Variables and functions */
void *dlink_get(int /*<<< orphan*/);
void *dlink_get_first() { return dlink_get(0); }


x86 assembly (clang, -O0):
<dlink_get_first>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <dlink_get@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlink_get_first>:
xor    %edi,%edi
jmp    1030 <dlink_get@plt>

LLVM IR (-O0):
define i8* @dlink_get_first() {
%1 = call i8* @dlink_get(i32 0)
ret i8* %1
}

LLVM IR (-O2):
define i8* @dlink_get_first() {
%1 = tail call i8* @dlink_get(i32 0)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void sigalarm_handler(int sig) { _exit(1); }


x86 assembly (clang, -O0):
<sigalarm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<sigalarm_handler>:
push   %rax
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @sigalarm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @sigalarm_handler(i32 %0) {
%2 = tail call i32 @_exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ xos_msecs_to_cycles(int /*<<< orphan*/);
int /*<<< orphan*/ xos_thread_sleep(int /*<<< orphan*/);
int32_t xos_thread_sleep_msec(uint64_t msecs) {
  return xos_thread_sleep(xos_msecs_to_cycles(msecs));
}


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

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

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

LLVM IR (-O2):
define i32 @xos_thread_sleep_msec(i32 %0) {
%2 = tail call i32 @xos_msecs_to_cycles(i32 %0)
%3 = tail call i32 @xos_thread_sleep(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long fwrite(int const *, int, long, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int ivec_fwrite_raw(FILE *fo, const int *v, long d) {
  long ret = fwrite(v, sizeof(int), d, fo);
  if (ret != d) {
    perror("ivec_fwrite_raw: write error 2");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ivec_fwrite_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x4,%esi
call   1040 <fwrite@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     1174 <ivec_fwrite_raw+0x54>
lea    0xe9d(%rip),%rdi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <ivec_fwrite_raw+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivec_fwrite_raw>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x4,%esi
call   1040 <fwrite@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
jne    1140 <ivec_fwrite_raw+0x20>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"ivec_fwrite_raw: write error 2\00"
define i32 @ivec_fwrite_raw(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i64
store i32* %0, i32** %5
store i32* %1, i32** %6
store i64 %2, i64* %7
%9 = load i32*, i32** %6
%10 = load i64, i64* %7
%11 = load i32*, i32** %5
%12 = call i64 @fwrite(i32* %9, i32 4, i64 %10, i32* %11)
store i64 %12, i64* %8
%13 = load i64, i64* %8
%14 = load i64, i64* %7
%15 = icmp ne i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %3
%17 = call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %4
br label %19
18: ; preds = %3
store i32 0, i32* %4
br label %19
19: ; preds = %18, %16
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [31 x i8] c"ivec_fwrite_raw: write error 2\00"
define i32 @ivec_fwrite_raw(i32* nocapture %0, i32* nocapture %1, i64 %2) {
%4 = tail call i64 @fwrite(i32* %1, i32 4, i64 %2, i32* %0)
%5 = icmp eq i64 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ -1, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void banner(const char *name) {
  printf("\n");
  printf("------------------------------------------"
         "------------------------------\n");
  printf("%s\n", name);
  printf("------------------------------------------"
         "------------------------------\n");
}


x86 assembly (clang, -O0):
<banner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xf25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<banner>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xec8(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@str.3 = [73 x i8] c"------------------------------------------------------------------------\00"
define void @banner(i8* nocapture %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.3, i64 0, i64 0))
ret void
}
unsigned short my_func(unsigned short x, unsigned short y, unsigned short z) {
  return x + y + z;
}


x86 assembly (clang, -O0):
<my_func>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
movzwl -0x6(%rbp),%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_func>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @my_func(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = load i16, i16* %5
%10 = zext i16 %9 to i32
%11 = add nsw i32 %8, %10
%12 = load i16, i16* %6
%13 = zext i16 %12 to i32
%14 = add nsw i32 %11, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @my_func(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2) {
%4 = add i16 %1, %0
%5 = add i16 %4, %2
ret i16 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fputs(char const *, int /*<<< orphan*/ *);
extern int fprint(const char *str, FILE *stream) { return fputs(str, stream); }


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

x86 assembly (clang, -O2):
<fprint>:
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
define i32 @fprint(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fputs(i8* %0, i32* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pData;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int /*<<< orphan*/ *);
void SendNU8(unsigned char *pData, unsigned short int nDataLen) {
  unsigned short int i = 0;
  for (; i < nDataLen; ++i) {
    SendChar((pData[i]) & 0xFF);
  }
}


x86 assembly (clang, -O0):
<SendNU8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movw   $0x0,-0xc(%rbp)
movzwl -0xc(%rbp),%eax
movzwl -0xa(%rbp),%ecx
cmp    %ecx,%eax
jge    1163 <SendNU8+0x53>
mov    -0x8(%rbp),%rax
movzwl -0xc(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
and    $0xff,%eax
movslq %eax,%rdi
call   1030 <SendChar@plt>
mov    -0xc(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xc(%rbp)
jmp    1129 <SendNU8+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SendNU8>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1143 <SendNU8+0x33>
mov    %rdi,%r14
movzwl %si,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%edi
call   1030 <SendChar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <SendNU8+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @SendNU8(i8* nocapture %0, i16 zeroext %1) {
%3 = icmp eq i16 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = zext i16 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %13, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = tail call i32 @SendChar(i32* %11)
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret void
}
/* Variables and functions */
int UINTPTR_MAX;
uintptr_t my_mul_2exp(uintptr_t x, int k) {
  if (x <= (UINTPTR_MAX >> k))
    x = (x << k);
  else
    return UINTPTR_MAX;
  return x;
}


x86 assembly (clang, -O0):
<my_mul_2exp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%edx
mov    -0x14(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
ja     113e <my_mul_2exp+0x3e>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    %cl,%rax
mov    %rax,-0x10(%rbp)
jmp    1151 <my_mul_2exp+0x51>
mov    0x2e9b(%rip),%rax
movslq (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <my_mul_2exp+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_mul_2exp>:
mov    %esi,%ecx
mov    0x2ed7(%rip),%rax
movslq (%rax),%rdx
mov    %edx,%esi
sar    %cl,%esi
mov    %rdi,%rax
shl    %cl,%rax
movslq %esi,%rcx
cmp    %rdi,%rcx
cmovb  %rdx,%rax
ret

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

LLVM IR (-O2):
@UINTPTR_MAX = global i32 0
define i64 @my_mul_2exp(i64 %0, i32 %1) {
%3 = load i32, i32* @UINTPTR_MAX
%4 = ashr i32 %3, %1
%5 = sext i32 %4 to i64
%6 = icmp ult i64 %5, %0
%7 = zext i32 %1 to i64
%8 = shl i64 %0, %7
%9 = sext i32 %3 to i64
%10 = select i1 %6, i64 %9, i64 %8
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR45_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR45_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR45_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void swap(int *x, int *y) {
  int tmp = *y;
  *y = *x;
  *x = tmp;
}


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

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %3
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
store i32 %4, i32* %1
store i32 %3, i32* %0
ret void
}
int _isdigit(int c) {
  if (c >= '0' && c <= '9')
    return (1);
  else
    return (0);
}


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

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

LLVM IR (-O0):
define i32 @_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 @_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void meter_and_collector_test(void) {
  unsigned char *meter = "23051705000008";
  char collector[15] = "00000000000013";
}


x86 assembly (clang, -O0):
<meter_and_collector_test>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xef9(%rip),%rax
mov    %rax,-0x17(%rbp)
mov    0xef7(%rip),%eax
mov    %eax,-0xf(%rbp)
mov    0xef1(%rip),%ax
mov    %ax,-0xb(%rbp)
mov    0xee9(%rip),%al
mov    %al,-0x9(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"23051705000008\00"
@__const.meter_and_collector_test.collector = [15 x i8] c"00000000000013\00"
define void @meter_and_collector_test() {
%1 = alloca i8*
%2 = alloca [15 x i8]
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = bitcast [15 x i8]* %2 to i8*
ret void
}

LLVM IR (-O2):
define void @meter_and_collector_test() {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef scalar_t__ ui32Base;

/* Variables and functions */
void PWMGenDisable(uint32_t ui32Base, uint32_t ui32Gen) {
  ;
  ;
  (*((volatile uint32_t *)(((ui32Base) + (ui32Gen)) + 0x00000000))) &=
      ~(0x00000001);
}


x86 assembly (clang, -O0):
<PWMGenDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenDisable>:
movslq %esi,%rax
movslq %edi,%rcx
andl   $0xfffffffe,(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @PWMGenDisable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = add nsw i32 %7, 0
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, -2
store volatile i32 %12, i32* %10
ret void
}

LLVM IR (-O2):
define void @PWMGenDisable(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -2
store volatile i32 %7, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ print_version();
int /*<<< orphan*/ stderr;
void print_help(void) {
  print_version();
  fprintf(stderr,
          "\nUsage: %s [OPTIONS]\n"
          "where OPTIONS are:\n"
          "  -h,  --help            Print help information\n"
          "  -v,  --version         Print version information\n"
          "  -S,  --flash-size      Sets the flash size in bytes\n",
          "hex2image");
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <print_version@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
lea    0xf80(%rip),%rdx
call   1040 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rax
xor    %eax,%eax
call   1030 <print_version@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
lea    0xf83(%rip),%rdx
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [194 x i8] c"\0AUsage: %s [OPTIONS]\0Awhere OPTIONS are:\0A -h, --help Print help information\0A -v, --version Print version information\0A -S, --flash-size Sets the flash size in bytes\0A\00"
@.str.1 = [10 x i8] c"hex2image\00"
define void @print_help() {
%1 = call i32 (...) @print_version()
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([194 x i8], [194 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [194 x i8] c"\0AUsage: %s [OPTIONS]\0Awhere OPTIONS are:\0A -h, --help Print help information\0A -v, --version Print version information\0A -S, --flash-size Sets the flash size in bytes\0A\00"
@.str.1 = [10 x i8] c"hex2image\00"
define void @print_help() {
%1 = tail call i32 (...) @print_version()
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([194 x i8], [194 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
char *skip_space(const char *s) {
  while (isspace(*s))
    ++s;
  return (char *)s;
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skip_space+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_space+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skip_space+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_space(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int f333(int *);
int f334(int *p) { return f333(p); }


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

x86 assembly (clang, -O2):
<f334>:
jmp    1030 <f333@plt>

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

LLVM IR (-O2):
define i32 @f334(i32* %0) {
%2 = tail call i32 @f333(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ database_run(int);
int main() { database_run(4); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <database_run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @database_run(i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @database_run(i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  a = a + b;
  b = a - b;
  a = a - b;
  printf("%d %d\n", a, b);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    (%rsp),%esi
mov    %edx,(%rsp)
mov    %esi,0x4(%rsp)
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
store i32 %6, i32* %2
store i32 %7, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
char *getenv(char *);
uid_t fake_secret_peer(uid_t orig_id) {
  char *val;
  val = getenv("SSSD_INTG_SECRETS_PEER");
  if (val == NULL) {
    return orig_id;
  }
  return atoi(val);
}


x86 assembly (clang, -O0):
<fake_secret_peer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xece(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <fake_secret_peer+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <fake_secret_peer+0x3d>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fake_secret_peer>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     113d <fake_secret_peer+0x1d>
mov    %rax,%rdi
pop    %rbx
jmp    1040 <atoi@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"SSSD_INTG_SECRETS_PEER\00"
define i32 @fake_secret_peer(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = call i8* @getenv(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32, i32* %3
store i32 %9, i32* %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [23 x i8] c"SSSD_INTG_SECRETS_PEER\00"
define i32 @fake_secret_peer(i32 %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @atoi(i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
int gcd(int a, int b) {
  if (b == 0) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <gcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <gcd+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(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 %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = call i32 @gcd(i32 %11, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int read(int, void *, int);
int util_read(int fd, void *p, int max) {
  int n;
  do {
    n = read(fd, p, max);
  } while (n < 0 && errno == EINTR);
  return n;
}


x86 assembly (clang, -O0):
<util_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jge    115d <util_read+0x4d>
mov    0x2e96(%rip),%rax
mov    (%rax),%rax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1122 <util_read+0x12>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_read>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <read@plt>
test   %eax,%eax
jns    114a <util_read+0x3a>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <util_read+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @util_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @read(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @util_read(i32 %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%6 = icmp slt i32 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sndfile_readf_function() {
  printf("NOT IMPLEMENTED:"
         "pa_sndfile_readf_function"
         "\n");
}


x86 assembly (clang, -O0):
<pa_sndfile_readf_function>:
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_sndfile_readf_function>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [42 x i8] c"NOT IMPLEMENTED:pa_sndfile_readf_function\00"
define i32 @pa_sndfile_readf_function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
unsigned long long __udivdi3(unsigned long long, unsigned long long);
unsigned long long __gnu_uldivmod_helper(unsigned long long a,
                                         unsigned long long b,
                                         unsigned long long *remainder) {
  unsigned long long quotient;
  quotient = __udivdi3(a, b);
  *remainder = a - b * quotient;
  return quotient;
}


x86 assembly (clang, -O0):
<__gnu_uldivmod_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__udivdi3@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
imul   -0x20(%rbp),%rax
sub    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gnu_uldivmod_helper>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
call   1030 <__udivdi3@plt>
imul   %rax,%rbx
sub    %rbx,%r15
mov    %r15,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @__gnu_uldivmod_helper(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = call i64 @__udivdi3(i64 %8, i64 %9)
store i64 %10, i64* %7
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = load i64, i64* %7
%14 = mul i64 %12, %13
%15 = sub i64 %11, %14
%16 = load i64*, i64** %6
store i64 %15, i64* %16
%17 = load i64, i64* %7
ret i64 %17
}

LLVM IR (-O2):
define i64 @__gnu_uldivmod_helper(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = tail call i64 @__udivdi3(i64 %0, i64 %1)
%5 = mul i64 %4, %1
%6 = sub i64 %0, %5
store i64 %6, i64* %2
ret i64 %4
}
int order_of_magnitude(unsigned long long int key) {
  int bucket = 0;
  while (key) {
    key /= 10;
    bucket++;
  }
  return bucket;
}


x86 assembly (clang, -O0):
<order_of_magnitude>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <order_of_magnitude+0x3a>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <order_of_magnitude+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<order_of_magnitude>:
xor    %ecx,%ecx
test   %rdi,%rdi
je     1136 <order_of_magnitude+0x36>
movabs $0xcccccccccccccccd,%rsi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
add    $0x1,%ecx
cmp    $0x9,%rdi
mov    %rdx,%rdi
ja     1120 <order_of_magnitude+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @order_of_magnitude(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i64 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i64 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
void rule_dgp_act_update(const struct XCSF *xcsf, const struct Cl *c,
                         const double *x, const double *y) {
  (void)xcsf;
  (void)c;
  (void)x;
  (void)y;
}


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

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

LLVM IR (-O0):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @rule_dgp_act_update(%struct.XCSF* %0, %struct.Cl* %1, double* %2, double* %3) {
%5 = alloca %struct.XCSF*
%6 = alloca %struct.Cl*
%7 = alloca double*
%8 = alloca double*
store %struct.XCSF* %0, %struct.XCSF** %5
store %struct.Cl* %1, %struct.Cl** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load %struct.XCSF*, %struct.XCSF** %5
%10 = load %struct.Cl*, %struct.Cl** %6
%11 = load double*, double** %7
%12 = load double*, double** %8
ret void
}

LLVM IR (-O2):
%struct.XCSF = type opaque
%struct.Cl = type opaque
define void @rule_dgp_act_update(%struct.XCSF* nocapture %0, %struct.Cl* nocapture %1, double* nocapture %2, double* nocapture %3) {
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int obtenirNombreAleatoire() {
  srand(time(NULL));
  return rand() % 100;
}


x86 assembly (clang, -O0):
<obtenirNombreAleatoire>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<obtenirNombreAleatoire>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @obtenirNombreAleatoire() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 100
ret i32 %4
}

LLVM IR (-O2):
define i32 @obtenirNombreAleatoire() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 100
ret i32 %4
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ test(int);
int /*<<< orphan*/ testL(int);
int main() {
  int B20 = -(1 << 20);
  int64_t B53 = -((int64_t)1 << 53);
  test(B20 + 32);
  test(B20 + 33);
  testL(B53 + 64);
  testL(B53 + 65);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfff00000,-0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
add    $0x20,%edi
call   1040 <test@plt>
mov    -0x8(%rbp),%edi
add    $0x21,%edi
call   1040 <test@plt>
mov    -0xc(%rbp),%edi
add    $0x40,%edi
call   1030 <testL@plt>
mov    -0xc(%rbp),%edi
add    $0x41,%edi
call   1030 <testL@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfff00020,%edi
call   1040 <test@plt>
mov    $0xfff00021,%edi
call   1040 <test@plt>
call   1030 <testL@plt>
call   1030 <testL@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -1048576, i32* %2
store i32 poison, i32* %3
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 32
%6 = call i32 @test(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 33
%9 = call i32 @test(i32 %8)
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 64
%12 = call i32 @testL(i32 %11)
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 65
%15 = call i32 @testL(i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 -1048544)
%2 = tail call i32 @test(i32 -1048543)
%3 = tail call i32 @testL(i32 poison)
%4 = tail call i32 @testL(i32 poison)
ret i32 0
}
int strlen2(char *s) {
  int n;
  for (n = 0; *s != '\0'; s++)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<strlen2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <strlen2+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlen2+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen2>:
cmpb   $0x0,(%rdi)
je     111c <strlen2+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen2+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}