xunge/DecIR huggingface dataset:
/* Variables and functions */
double Pi(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n = 0;
  printf("Geben Sie ein, wie viele Glieder Sie berechnen wollen\n");
  scanf("%d", &n);
  printf("Das Ergebniss: %f", Pi(n));
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1060 <Pi@plt>
lea    0xe8d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"Geben Sie ein, wie viele Glieder Sie berechnen wollen\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"Das Ergebniss: %f\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call double @Pi(i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [18 x i8] c"Das Ergebniss: %f\00"
@str = [54 x i8] c"Geben Sie ein, wie viele Glieder Sie berechnen wollen\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call double @Pi(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double volatile);
scalar_t__ sqrt(int);
int main() {
  volatile double x = 0.0;
  for (int i = 0; i < 2; ++i) {
    x += sqrt(i);
  }
  printf("%e\n", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1171 <main+0x51>
mov    -0x14(%rbp),%edi
call   1040 <sqrt@plt>
cvtsi2sd %rax,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <main+0x1e>
movsd  -0x10(%rbp),%xmm0
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
xor    %edi,%edi
call   1040 <sqrt@plt>
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    $0x1,%edi
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rsp),%xmm0
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
store i32 0, i32* %1
store volatile double 0.000000e+00, double* %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i64 @sqrt(i32 %8)
%10 = sitofp i64 %9 to double
%11 = load volatile double, double* %2
%12 = fadd double %11, %10
store volatile double %12, double* %2
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load volatile double, double* %2
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %17)
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store volatile double 0.000000e+00, double* %1
%3 = tail call i64 @sqrt(i32 0)
%4 = sitofp i64 %3 to double
%5 = load volatile double, double* %1
%6 = fadd double %5, %4
store volatile double %6, double* %1
%7 = tail call i64 @sqrt(i32 1)
%8 = sitofp i64 %7 to double
%9 = load volatile double, double* %1
%10 = fadd double %9, %8
store volatile double %10, double* %1
%11 = load volatile double, double* %1
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %11)
ret i32 0
}
int myFunc(void) { return 55; }


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

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

LLVM IR (-O0):
define i32 @myFunc() {
ret i32 55
}

LLVM IR (-O2):
define i32 @myFunc() {
ret i32 55
}
__attribute__((no, noclone)) int bar(int b) {
  return (((b ^ ~5) & ~1) ^ ~5) & ~1;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xfffffffa,%eax
and    $0xfffffffe,%eax
xor    $0xfffffffa,%eax
and    $0xfffffffe,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    %edi,%eax
and    $0xfffffffe,%eax
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -6
%5 = and i32 %4, -2
%6 = xor i32 %5, -6
%7 = and i32 %6, -2
ret i32 %7
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = and i32 %0, -2
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rot32r3(uint32_t x) { return (x >> 3) | (x << 29); }


x86 assembly (clang, -O0):
<rot32r3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1d,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot32r3>:
mov    %edi,%eax
sar    $0x3,%eax
shl    $0x1d,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot32r3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 3
%5 = load i32, i32* %2
%6 = shl i32 %5, 29
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot32r3(i32 %0) {
%2 = ashr i32 %0, 3
%3 = shl i32 %0, 29
%4 = or i32 %2, %3
ret i32 %4
}
int test_imm_8Bint64_lowword_mem(long long *val) {
  return ((*val) & (0x8B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_8Bint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 139
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool int_eq(const void *litem, const void *ritem) {
  uint32_t *lint = (uint32_t *)litem;
  uint32_t *rint = (uint32_t *)ritem;
  return *lint == *rint;
}


x86 assembly (clang, -O0):
<int_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_eq>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @int_eq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
store i64* %8, i64** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
store i64* %10, i64** %6
%11 = load i64*, i64** %5
%12 = load i64, i64* %11
%13 = load i64*, i64** %6
%14 = load i64, i64* %13
%15 = icmp eq i64 %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @int_eq(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void display_prompt(void) {
  char prompt[] = "mysh # ";
  write(STDOUT_FILENO, prompt, strlen(prompt));
}


x86 assembly (clang, -O0):
<display_prompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_prompt>:
push   %r14
push   %rbx
push   %rax
movabs $0x2023206873796d,%rax
mov    %rax,(%rsp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%ebx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.display_prompt.prompt = [8 x i8] c"mysh # \00"
@STDOUT_FILENO = global i32 0
define void @display_prompt() {
%1 = alloca [8 x i8]
%2 = bitcast [8 x i8]* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @write(i32 %3, i8* %4, i32 %6)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @display_prompt() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 9045821353064813, i64* %1
%3 = load i32, i32* @STDOUT_FILENO
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @write(i32 %3, i8* %2, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M586_f(char *s) {
  debug("M586_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


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

x86 assembly (clang, -O2):
<M586_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M586_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M586_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M586_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M586_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int *twoSum(int *, int, int);
void testTwoSum() {
  int numbers[3] = {3, 2, 4};
  int target = 6;
  int *result = twoSum(numbers, 4, target);
  printf("index1 = %d, index2 = %d", result[0], result[1]);
}


x86 assembly (clang, -O0):
<testTwoSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
movl   $0x6,-0x10(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    $0x4,%esi
call   1040 <twoSum@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTwoSum>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x4,%esi
mov    $0x6,%edx
call   1040 <twoSum@plt>
mov    (%rax),%esi
mov    0x4(%rax),%edx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.testTwoSum.numbers = [3 x i32] [i32 3, i32 2, i32 4]
@.str = [25 x i8] c"index1 = %d, index2 = %d\00"
define void @testTwoSum() {
%1 = alloca [3 x i32]
%2 = alloca i32
%3 = alloca i32*
%4 = bitcast [3 x i32]* %1 to i8*
store i32 6, i32* %2
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32* @twoSum(i32* %5, i32 4, i32 %6)
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %13)
ret void
}

LLVM IR (-O2):
@__const.testTwoSum.numbers = [3 x i32] [i32 3, i32 2, i32 4]
@.str = [25 x i8] c"index1 = %d, index2 = %d\00"
define void @testTwoSum() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32* @twoSum(i32* %3, i32 4, i32 6)
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret void
}
int sa11x0_pm_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sa11x0_pm_init() {
ret i32 0
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, int);
void affiche() {
#pragma omp parallel
  {
    int id_threadOMP = omp_get_thread_num();
    int nb_threadOMP = omp_get_num_threads();
    printf("Mon rang est : %d sur %d\n", id_threadOMP, nb_threadOMP);
  }
}


x86 assembly (clang, -O0):
<affiche>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<affiche>:
push   %rbx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Mon rang est : %d sur %d\0A\00"
define void @affiche() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @omp_get_thread_num()
store i32 %3, i32* %1
%4 = call i32 (...) @omp_get_num_threads()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Mon rang est : %d sur %d\0A\00"
define void @affiche() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 (...) @omp_get_num_threads()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef unsigned char uint32_t;

/* Variables and functions */
uint32_t read_be32_3(unsigned char *data) {
  return *(data + 3) | (*(data + 2) << 8) | (*(data + 1) << 16) | (*data << 24);
}


x86 assembly (clang, -O0):
<read_be32_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_be32_3>:
mov    0x3(%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @read_be32_3(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = shl i32 %21, 24
%23 = or i32 %18, %22
%24 = trunc i32 %23 to i8
ret i8 %24
}

LLVM IR (-O2):
define zeroext i8 @read_be32_3(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
ret i8 %3
}
struct running_checksum *priv_to_rc(struct xxhash_running_checksum *priv) {
  return (struct running_checksum *)priv;
}


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

x86 assembly (clang, -O2):
<priv_to_rc>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.running_checksum = type opaque
%struct.xxhash_running_checksum = type opaque
define %struct.running_checksum* @priv_to_rc(%struct.xxhash_running_checksum* %0) {
%2 = alloca %struct.xxhash_running_checksum*
store %struct.xxhash_running_checksum* %0, %struct.xxhash_running_checksum** %2
%3 = load %struct.xxhash_running_checksum*, %struct.xxhash_running_checksum** %2
%4 = bitcast %struct.xxhash_running_checksum* %3 to %struct.running_checksum*
ret %struct.running_checksum* %4
}

LLVM IR (-O2):
%struct.running_checksum = type opaque
%struct.xxhash_running_checksum = type opaque
define %struct.running_checksum* @priv_to_rc(%struct.xxhash_running_checksum* readnone %0) {
%2 = bitcast %struct.xxhash_running_checksum* %0 to %struct.running_checksum*
ret %struct.running_checksum* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
time_t octave_mktime_wrapper(struct tm *tp) { return mktime(tp); }


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

x86 assembly (clang, -O2):
<octave_mktime_wrapper>:
jmp    1030 <mktime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @octave_mktime_wrapper(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = call i32 @mktime(%struct.tm* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @octave_mktime_wrapper(%struct.tm* nocapture %0) {
%2 = tail call i32 @mktime(%struct.tm* %0)
ret i32 %2
}
int c_mod(int a, int b) {
  if (a == 0)
    return (0);
  return (b % a);
}


x86 assembly (clang, -O0):
<c_mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1120 <c_mod+0x20>
movl   $0x0,-0x4(%rbp)
jmp    112a <c_mod+0x2a>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_mod>:
test   %edi,%edi
je     110c <c_mod+0xc>
mov    %esi,%eax
cltd
idiv   %edi
mov    %edx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @c_mod(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* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %13
9: ; preds = %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
store i32 %12, i32* %3
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @c_mod(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = srem i32 %1, %0
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc18(void) {
  printf("Executing exitfunc"
         "18"
         ".\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc18>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc18>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc18.\0A\00"
define void @exitfunc18() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc18.\00"
define void @exitfunc18() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int side_detect() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @side_detect() {
ret i32 0
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *get_last_ext(const char *name) {
  const char *ext = strrchr(name, '.');
  if (ext == NULL)
    return "";
  else
    return ext + 1;
}


x86 assembly (clang, -O0):
<get_last_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1149 <get_last_ext+0x39>
lea    0xec0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1155 <get_last_ext+0x45>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_last_ext>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
lea    0xed7(%rip),%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @get_last_ext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8* %12, i8** %2
br label %13
13: ; preds = %10, %9
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @get_last_ext(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %4
ret i8* %5
}
unsigned char random_u8(unsigned int seed) { return seed; }


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

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

LLVM IR (-O0):
define zeroext i8 @random_u8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @random_u8(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
void bfqg_stats_update_io_add(struct bfq_group *bfqg, struct bfq_queue *bfqq,
                              unsigned int op) {}


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

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

LLVM IR (-O0):
%struct.bfq_group = type opaque
%struct.bfq_queue = type opaque
define void @bfqg_stats_update_io_add(%struct.bfq_group* %0, %struct.bfq_queue* %1, i32 %2) {
%4 = alloca %struct.bfq_group*
%5 = alloca %struct.bfq_queue*
%6 = alloca i32
store %struct.bfq_group* %0, %struct.bfq_group** %4
store %struct.bfq_queue* %1, %struct.bfq_queue** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.bfq_group = type opaque
%struct.bfq_queue = type opaque
define void @bfqg_stats_update_io_add(%struct.bfq_group* nocapture %0, %struct.bfq_queue* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
_wrtchk() { abort(); }


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

x86 assembly (clang, -O2):
<_wrtchk>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @_wrtchk() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @_wrtchk() {
%1 = tail call i32 (...) @abort()
unreachable
}
void avcodec_get_chroma_sub_sample() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_get_chroma_sub_sample() {
ret void
}
int strcmp(const char *cs, const char *ct) {
  register signed char __res;
  while (1) {
    if ((__res = *cs - *ct++) != 0 || !*cs++)
      break;
  }
  return __res;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
jne    114e <strcmp+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1153 <strcmp+0x53>
jmp    1158 <strcmp+0x58>
jmp    110c <strcmp+0xc>
movsbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%edx
mov    %edx,%ecx
sub    (%rsi,%rax,1),%cl
test   %dl,%dl
je     1125 <strcmp+0x25>
add    $0x1,%rax
test   %cl,%cl
je     1110 <strcmp+0x10>
movsbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %10, %3 ]
%5 = phi i8* [ %0, %2 ], [ %11, %3 ]
%6 = load i8, i8* %5
%7 = load i8, i8* %4
%8 = sub i8 %6, %7
%9 = icmp ne i8 %8, 0
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp eq i8 %6, 0
%13 = or i1 %12, %9
br i1 %13, label %14, label %3
14: ; preds = %3
%15 = sext i8 %8 to i32
ret i32 %15
}
/* Variables and functions */
void sanitize_environment() {
  extern char **environ;
  environ = NULL;
}


x86 assembly (clang, -O0):
<sanitize_environment>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sanitize_environment>:
mov    0x2ee1(%rip),%rax
movq   $0x0,(%rax)
ret

LLVM IR (-O0):
@environ = external global i8**
define void @sanitize_environment() {
store i8** null, i8*** @environ
ret void
}

LLVM IR (-O2):
@environ = external global i8**
define void @sanitize_environment() {
store i8** null, i8*** @environ
ret void
}
/* Type definitions */
struct display {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ out(struct display *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void outs(struct display *display, const char *str) {
  out(display, str, strlen(str));
}


x86 assembly (clang, -O0):
<outs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <out@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <out@plt>

LLVM IR (-O0):
%struct.display = type { i32 }
define void @outs(%struct.display* %0, i8* %1) {
%3 = alloca %struct.display*
%4 = alloca i8*
store %struct.display* %0, %struct.display** %3
store i8* %1, i8** %4
%5 = load %struct.display*, %struct.display** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @out(%struct.display* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.display = type { i32 }
define void @outs(%struct.display* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @out(%struct.display* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *j_build_month(char *buf, int y, int m) {
  (void)y;
  (void)m;
  strcpy(buf, "TODO: Julian calendar for dates before September 1752.\n");
  return buf;
}


x86 assembly (clang, -O0):
<j_build_month>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_build_month>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [56 x i8] c"TODO: Julian calendar for dates before September 1752.\0A\00"
define i8* @j_build_month(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
@.str = [56 x i8] c"TODO: Julian calendar for dates before September 1752.\0A\00"
define i8* @j_build_month(i8* returned %0, i32 %1, i32 %2) {
%4 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf_s(char *, int *);
int /*<<< orphan*/ stdin;
int view_selectMenu(void) {
  int menuItem = 0;
  printf("Select the Menu : ");
  scanf_s("%d", &menuItem);
  fflush(stdin);
  return menuItem;
}


x86 assembly (clang, -O0):
<view_selectMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf_s@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<view_selectMenu>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf_s@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Select the Menu : \00"
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
define i32 @view_selectMenu() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* @stdin
%5 = call i32 @fflush(i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [19 x i8] c"Select the Menu : \00"
@.str.1 = [3 x i8] c"%d\00"
@stdin = global i32 0
define i32 @view_selectMenu() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* @stdin
%6 = call i32 @fflush(i32 %5)
%7 = load i32, i32* %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void ResetDevice() {
  SendChar((0XEE) & 0xFF);
  SendChar((0x07) & 0xFF);
  SendChar((0x35) & 0xFF);
  SendChar((0x5A) & 0xFF);
  SendChar((0x53) & 0xFF);
  SendChar((0xA5) & 0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<ResetDevice>:
push   %rbp
mov    %rsp,%rbp
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x7,%edi
call   1030 <SendChar@plt>
mov    $0x35,%edi
call   1030 <SendChar@plt>
mov    $0x5a,%edi
call   1030 <SendChar@plt>
mov    $0x53,%edi
call   1030 <SendChar@plt>
mov    $0xa5,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ResetDevice>:
push   %rax
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x7,%edi
call   1030 <SendChar@plt>
mov    $0x35,%edi
call   1030 <SendChar@plt>
mov    $0x5a,%edi
call   1030 <SendChar@plt>
mov    $0x53,%edi
call   1030 <SendChar@plt>
mov    $0xa5,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
pop    %rax
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @ResetDevice() {
%1 = call i32 @SendChar(i32 238)
%2 = call i32 @SendChar(i32 7)
%3 = call i32 @SendChar(i32 53)
%4 = call i32 @SendChar(i32 90)
%5 = call i32 @SendChar(i32 83)
%6 = call i32 @SendChar(i32 165)
%7 = call i32 @SendChar(i32 255)
%8 = call i32 @SendChar(i32 252)
%9 = call i32 @SendChar(i32 255)
%10 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @ResetDevice() {
%1 = tail call i32 @SendChar(i32 238)
%2 = tail call i32 @SendChar(i32 7)
%3 = tail call i32 @SendChar(i32 53)
%4 = tail call i32 @SendChar(i32 90)
%5 = tail call i32 @SendChar(i32 83)
%6 = tail call i32 @SendChar(i32 165)
%7 = tail call i32 @SendChar(i32 255)
%8 = tail call i32 @SendChar(i32 252)
%9 = tail call i32 @SendChar(i32 255)
%10 = tail call i32 @SendChar(i32 255)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DeleteDeviceEntriesFromQueue(int);
int /*<<< orphan*/ printQueue();
int /*<<< orphan*/ printf(char *);
void testQueue(void) {
  printf("START\r\n");
  printQueue();
  DeleteDeviceEntriesFromQueue(1);
  printQueue();
}


x86 assembly (clang, -O0):
<testQueue>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <printQueue@plt>
mov    $0x1,%edi
call   1030 <DeleteDeviceEntriesFromQueue@plt>
mov    $0x0,%al
call   1050 <printQueue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testQueue>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <printQueue@plt>
mov    $0x1,%edi
call   1030 <DeleteDeviceEntriesFromQueue@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <printQueue@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"START\0D\0A\00"
define void @testQueue() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @printQueue()
%3 = call i32 @DeleteDeviceEntriesFromQueue(i32 1)
%4 = call i32 (...) @printQueue()
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"START\0D\00"
define void @testQueue() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @printQueue()
%3 = tail call i32 @DeleteDeviceEntriesFromQueue(i32 1)
%4 = tail call i32 (...) @printQueue()
ret void
}
int min(int x, int y) {
  if (x <= y)
    return x;
  return y;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1121 <min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @min(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* %4
%7 = load i32, i32* %5
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int readDataBit(uint8_t *data, int wBytes, int hBytes, int xBitRead,
                int yBitRead) {
  int byteOffsetToRead = yBitRead * wBytes;
  byteOffsetToRead += xBitRead / 8;
  int bitsToShift = 7 - (xBitRead % 8);
  int retVal = (data[byteOffsetToRead] >> bitsToShift) & 0x1;
  return retVal;
}


x86 assembly (clang, -O0):
<readDataBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x18(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    $0x7,%eax
sub    %edx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x20(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readDataBit>:
imul   %r8d,%esi
lea    0x7(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
mov    %eax,%edx
sar    $0x3,%edx
add    %esi,%edx
and    $0xfffffff8,%eax
sub    %eax,%ecx
movslq %edx,%rax
mov    (%rdi,%rax,4),%eax
mov    $0x7,%dl
sub    %cl,%dl
mov    %edx,%ecx
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @readDataBit(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%14 = load i32, i32* %10
%15 = load i32, i32* %7
%16 = mul nsw i32 %14, %15
store i32 %16, i32* %11
%17 = load i32, i32* %9
%18 = sdiv i32 %17, 8
%19 = load i32, i32* %11
%20 = add nsw i32 %19, %18
store i32 %20, i32* %11
%21 = load i32, i32* %9
%22 = srem i32 %21, 8
%23 = sub nsw i32 7, %22
store i32 %23, i32* %12
%24 = load i32*, i32** %6
%25 = load i32, i32* %11
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
%28 = load i32, i32* %27
%29 = load i32, i32* %12
%30 = ashr i32 %28, %29
%31 = and i32 %30, 1
store i32 %31, i32* %13
%32 = load i32, i32* %13
ret i32 %32
}

LLVM IR (-O2):
define i32 @readDataBit(i32* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = mul nsw i32 %4, %1
%7 = sdiv i32 %3, 8
%8 = add nsw i32 %6, %7
%9 = srem i32 %3, 8
%10 = sub nsw i32 7, %9
%11 = sext i32 %8 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = lshr i32 %13, %10
%15 = and i32 %14, 1
ret i32 %15
}
/* Variables and functions */
char recv_char();
int /*<<< orphan*/ send_packet_no_ack(char *);
void send_packet(char *buffer) {
  char ch;
  for (;;) {
    send_packet_no_ack(buffer);
    ch = recv_char();
    if (ch == -1)
      return;
    if (ch == '+')
      break;
  }
}


x86 assembly (clang, -O0):
<send_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <send_packet_no_ack@plt>
mov    $0x0,%al
call   1030 <recv_char@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xffffffff,%eax
jne    1151 <send_packet+0x31>
jmp    1168 <send_packet+0x48>
movsbl -0x9(%rbp),%eax
cmp    $0x2b,%eax
jne    1163 <send_packet+0x43>
jmp    1168 <send_packet+0x48>
jmp    112c <send_packet+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_packet>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <send_packet_no_ack@plt>
xor    %eax,%eax
call   1030 <recv_char@plt>
cmp    $0x2b,%al
je     1147 <send_packet+0x27>
cmp    $0xff,%al
jne    1130 <send_packet+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @send_packet(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %17, %1
%5 = load i8*, i8** %2
%6 = call i32 @send_packet_no_ack(i8* %5)
%7 = call signext i8 (...) @recv_char()
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %4
br label %18
12: ; preds = %4
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 43
br i1 %15, label %16, label %17
16: ; preds = %12
br label %18
17: ; preds = %12
br label %4
18: ; preds = %11, %16
ret void
}

LLVM IR (-O2):
define void @send_packet(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @send_packet_no_ack(i8* %0)
%4 = tail call signext i8 (...) @recv_char()
switch i8 %4, label %2 [
i8 -1, label %5
i8 43, label %5
]
5: ; preds = %2, %2
ret void
}
int main(void) {
  int n;
  for (n = 0; n < 10; n++) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    112f <main+0x2f>
jmp    1121 <main+0x21>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LINUX_REBOOT_MAGIC1;
int /*<<< orphan*/ LINUX_REBOOT_MAGIC2;
int /*<<< orphan*/ SYS_reboot;
scalar_t__ syscall(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                   int, void const *);
int raw_reboot(int cmd, const void *arg) {
  return (int)syscall(SYS_reboot, LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, cmd,
                      arg);
}


x86 assembly (clang, -O0):
<raw_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%r8
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_reboot>:
mov    %rsi,%r8
mov    %edi,%ecx
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_reboot = global i32 0
@LINUX_REBOOT_MAGIC1 = global i32 0
@LINUX_REBOOT_MAGIC2 = global i32 0
define i32 @raw_reboot(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @SYS_reboot
%6 = load i32, i32* @LINUX_REBOOT_MAGIC1
%7 = load i32, i32* @LINUX_REBOOT_MAGIC2
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = call i64 @syscall(i32 %5, i32 %6, i32 %7, i32 %8, i8* %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@SYS_reboot = global i32 0
@LINUX_REBOOT_MAGIC1 = global i32 0
@LINUX_REBOOT_MAGIC2 = global i32 0
define i32 @raw_reboot(i32 %0, i8* %1) {
%3 = load i32, i32* @SYS_reboot
%4 = load i32, i32* @LINUX_REBOOT_MAGIC1
%5 = load i32, i32* @LINUX_REBOOT_MAGIC2
%6 = tail call i64 @syscall(i32 %3, i32 %4, i32 %5, i32 %0, i8* %1)
%7 = trunc i64 %6 to i32
ret i32 %7
}