xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int main(int argc, char *argv[]) {
  int value = 200;
  int value2 = 300;
  int value3 = 400;
  int const *pvalue = &value;
  pvalue = &value2;
  int *const pvalue2 = &value;
  *pvalue2 = 400;
  const int *const ppvalue = &value3;
  printf("%d\n", *ppvalue);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xc8,-0x14(%rbp)
movl   $0x12c,-0x18(%rbp)
movl   $0x190,-0x1c(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movl   $0x190,(%rax)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x190,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 400)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ shandler(int /*<<< orphan*/);
int s0handler() { shandler(0); }


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

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

LLVM IR (-O0):
define i32 @s0handler() {
%1 = alloca i32
%2 = call i32 @shandler(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @s0handler() {
%1 = tail call i32 @shandler(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int yyerror(char *s) { printf("yyerror : %s\n", s); }


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

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"yyerror : %s\0A\00"
define i32 @yyerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
unsigned short ntohs(unsigned short n) {
  return ((n & 0xFF) << 8) | ((n & 0xFF00) >> 8);
}


x86 assembly (clang, -O0):
<ntohs>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohs>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @ntohs(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 255
%6 = shl i32 %5, 8
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = and i32 %8, 65280
%10 = ashr i32 %9, 8
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @ntohs(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
void ScaleRowDown34_1_Box_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown34_1_Box_C() {
ret void
}
__attribute__((always_)) int tracing_is_on(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tracing_is_on() {
ret i32 0
}
unsigned int remove_color(unsigned int yCbCr422) {
  return (yCbCr422 & 0xFF00FF00) | 0x00800080;
}


x86 assembly (clang, -O0):
<remove_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff00,%eax
or     $0x800080,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_color>:
and    $0xff00ff00,%edi
lea    0x800080(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @remove_color(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16711936
%5 = or i32 %4, 8388736
ret i32 %5
}

LLVM IR (-O2):
define i32 @remove_color(i32 %0) {
%2 = and i32 %0, -16711936
%3 = or i32 %2, 8388736
ret i32 %3
}
/* Variables and functions */
int pow(double, int);
double sqrt(int);
double g4(double x) { return (sqrt((pow(x, 2) + 1) / x)); }


x86 assembly (clang, -O0):
<g4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g4>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  (%rsp),%xmm0
cvttsd2si %xmm0,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @g4(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, i32 2)
%5 = add nsw i32 %4, 1
%6 = sitofp i32 %5 to double
%7 = load double, double* %2
%8 = fdiv double %6, %7
%9 = fptosi double %8 to i32
%10 = call double @sqrt(i32 %9)
ret double %10
}

LLVM IR (-O2):
define double @g4(double %0) {
%2 = tail call i32 @pow(double %0, i32 2)
%3 = add nsw i32 %2, 1
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, %0
%6 = fptosi double %5 to i32
%7 = tail call double @sqrt(i32 %6)
ret double %7
}
void nested_f() {}


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

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

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

LLVM IR (-O2):
define void @nested_f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void puts(char *str) {
  while (*str) {
    if (*str == '\n')
      putchar('\r');
    putchar(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <puts+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1143 <puts+0x33>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    %rdi,%rbx
jmp    1139 <puts+0x29>
cs nopw 0x0(%rax,%rax,1)
mov    $0xd,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1120 <puts+0x10>
test   %al,%al
jne    112d <puts+0x1d>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @puts(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %11, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %12
i8 10, label %5
]
5: ; preds = %2
%6 = tail call i32 @putchar(i8 signext 13)
%7 = load i8, i8* %3
br label %8
8: ; preds = %2, %5
%9 = phi i8 [ %4, %2 ], [ %7, %5 ]
%10 = tail call i32 @putchar(i8 signext %9)
%11 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
12: ; preds = %2
ret void
}
int main(void) {
  int a = 1;
  switch (a) {
  case 1:
    a = 1;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
jne    112a <main+0x2a>
jmp    1123 <main+0x23>
movl   $0x1,-0x8(%rbp)
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 1, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 1, label %4
]
4: ; preds = %0
store i32 1, i32* %2
br label %5
5: ; preds = %4, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  if (a % 2 == 0) {
    a = a + 1;
  }
  printf("%d\n", a);
  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
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115c <main+0x3c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9d(%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
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
test   $0x1,%sil
jne    1143 <main+0x23>
add    $0x1,%esi
mov    %esi,0x4(%rsp)
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = add nuw nsw i32 %4, 1
store i32 %8, i32* %1
br label %9
9: ; preds = %7, %0
%10 = phi i32 [ %8, %7 ], [ %4, %0 ]
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int opt_vverb(char *opt) {
  if (strcmp(opt, "-v") == 0)
    return 1;
  if (strcmp(opt, "--verbose") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<opt_vverb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <opt_vverb+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_vverb+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <opt_vverb+0x58>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_vverb+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_vverb>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <opt_vverb+0x31>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"-v\00"
@.str.1 = [10 x i8] c"--verbose\00"
define i32 @opt_vverb(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
char *make_return_packet(int /*<<< orphan*/);
char *gdb_kill() { return (make_return_packet(0)); }


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

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

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

LLVM IR (-O2):
define i8* @gdb_kill() {
%1 = tail call i8* @make_return_packet(i32 0)
ret i8* %1
}
int test_imm_7Aint64_midword_reg(long long val) {
  return ((val >> 16) & (0x7A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Aint64_midword_reg>:
test   $0x7a0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Aint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 122
%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_7Aint64_midword_reg(i64 %0) {
%2 = and i64 %0, 7995392
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int ft_toupper(int c) { return (((c >= 97) && (c <= 122)) ? c - 32 : c); }


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1129 <ft_toupper+0x29>
cmpl   $0x7a,-0x4(%rbp)
jg     1129 <ft_toupper+0x29>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <ft_toupper+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void c_pomp_sections_enter_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_sections_enter_(%struct.ompregdescr* nocapture %0) {
ret void
}
int test1() {
  int a[10];
  int i;
  for (i = 0; i < 10; i++)
    a[i] = i;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    112e <test1+0x2e>
mov    -0x34(%rbp),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    110b <test1+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test1() {
ret i32 undef
}
int main() {
  volatile int a = 0x00000001;
  if (__builtin_clz(a) != sizeof(int) * 8 - 1) {
    return 1;
  }
  volatile int b = 0x6000beef;
  if (__builtin_clz(b) != sizeof(int) * 8 - 31) {
    return 1;
  }
  volatile int c = 0x8abc0000;
  if (__builtin_clz(c) != sizeof(int) * 8 - 32) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
cltq
cmp    $0x1f,%rax
je     1133 <main+0x33>
movl   $0x1,-0x4(%rbp)
jmp    118a <main+0x8a>
movl   $0x6000beef,-0xc(%rbp)
mov    -0xc(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
cltq
cmp    $0x1,%rax
je     115b <main+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    118a <main+0x8a>
movl   $0x8abc0000,-0x10(%rbp)
mov    -0x10(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
cltq
cmp    $0x0,%rax
je     1183 <main+0x83>
movl   $0x1,-0x4(%rbp)
jmp    118a <main+0x8a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%ecx
mov    $0x1,%eax
cmp    $0x1,%ecx
jne    1145 <main+0x45>
movl   $0x6000beef,-0x8(%rsp)
60
mov    $0xc0000000,%ecx
and    -0x8(%rsp),%ecx
mov    $0x1,%eax
cmp    $0x40000000,%ecx
jne    1145 <main+0x45>
movl   $0x8abc0000,-0xc(%rsp)
8a
mov    -0xc(%rsp),%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store volatile i32 1, i32* %2
%5 = load volatile i32, i32* %2
%6 = call i32 @llvm.ctlz.i32(i32 %5, i1 true)
%7 = sext i32 %6 to i64
%8 = icmp ne i64 %7, 31
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %1
br label %23
10: ; preds = %0
store volatile i32 1610661615, i32* %3
%11 = load volatile i32, i32* %3
%12 = call i32 @llvm.ctlz.i32(i32 %11, i1 true)
%13 = sext i32 %12 to i64
%14 = icmp ne i64 %13, 1
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 1, i32* %1
br label %23
16: ; preds = %10
store volatile i32 -1967390720, i32* %4
%17 = load volatile i32, i32* %4
%18 = call i32 @llvm.ctlz.i32(i32 %17, i1 true)
%19 = sext i32 %18 to i64
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %16
store i32 1, i32* %1
br label %23
22: ; preds = %16
store i32 0, i32* %1
br label %23
23: ; preds = %22, %21, %15, %9
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store volatile i32 1, i32* %1
%5 = load volatile i32, i32* %1
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %19
7: ; preds = %0
%8 = bitcast i32* %2 to i8*
store volatile i32 1610661615, i32* %2
%9 = load volatile i32, i32* %2
%10 = and i32 %9, -1073741824
%11 = icmp eq i32 %10, 1073741824
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = bitcast i32* %3 to i8*
store volatile i32 -1967390720, i32* %3
%14 = load volatile i32, i32* %3
%15 = xor i32 %14, -1
%16 = lshr i32 %15, 31
br label %17
17: ; preds = %7, %12
%18 = phi i32 [ %16, %12 ], [ 1, %7 ]
br label %19
19: ; preds = %0, %17
%20 = phi i32 [ %18, %17 ], [ 1, %0 ]
ret i32 %20
}
void g_slist_nth() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_nth() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int **calloc(int, int);
int main(void) {
  int(*r)[5] = calloc(2, sizeof(int[5]));
  r[0][1] = 3;
  int *z = &r[0][1];
  assert(*z == 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x14,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3,0x4(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x3,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x14,%esi
call   1030 <calloc@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [5 x i32]*
%2 = alloca i32*
%3 = call i32** @calloc(i32 2, i32 20)
%4 = bitcast i32** %3 to [5 x i32]*
store [5 x i32]* %4, [5 x i32]** %1
%5 = load [5 x i32]*, [5 x i32]** %1
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %6, i64 0, i64 1
store i32 3, i32* %7
%8 = load [5 x i32]*, [5 x i32]** %1
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0
%10 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 1
store i32* %10, i32** %2
%11 = load i32*, i32** %2
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 3
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32** @calloc(i32 2, i32 20)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
void TestTimeout(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<TestTimeout>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <TestTimeout+0x9>
jmp    1109 <TestTimeout+0x9>

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

LLVM IR (-O0):
define void @TestTimeout() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @TestTimeout() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int uint8_t;
typedef unsigned int uint16_t;
typedef unsigned int int16_t;

/* Variables and functions */
int16_t adpcm_predict_sample(uint8_t byte, uint8_t mask, unsigned lshift,
                             unsigned rshift) {
  int16_t sample = (uint16_t)(byte & mask) << lshift;
  sample >>= rshift;
  return sample;
}


x86 assembly (clang, -O0):
<adpcm_predict_sample>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%eax
shr    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adpcm_predict_sample>:
mov    %ecx,%eax
mov    %edx,%ecx
and    %esi,%edi
shl    %cl,%edi
mov    %eax,%ecx
shr    %cl,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @adpcm_predict_sample(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = and i32 %10, %11
%13 = load i32, i32* %7
%14 = shl i32 %12, %13
store i32 %14, i32* %9
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = lshr i32 %16, %15
store i32 %17, i32* %9
%18 = load i32, i32* %9
ret i32 %18
}

LLVM IR (-O2):
define i32 @adpcm_predict_sample(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %1, %0
%6 = shl i32 %5, %2
%7 = lshr i32 %6, %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ bucket_sort(int *, int, int);
int check_max_digit(int *, int);
void radix_sort(int *vec, int length) {
  int max_digit;
  max_digit = check_max_digit(vec, length);
  bucket_sort(vec, length, max_digit);
}


x86 assembly (clang, -O0):
<radix_sort>:
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 <check_max_digit@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <bucket_sort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radix_sort>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <check_max_digit@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <bucket_sort@plt>

LLVM IR (-O0):
define void @radix_sort(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** %3
%7 = load i32, i32* %4
%8 = call i32 @check_max_digit(i32* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = call i32 @bucket_sort(i32* %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @radix_sort(i32* %0, i32 %1) {
%3 = tail call i32 @check_max_digit(i32* %0, i32 %1)
%4 = tail call i32 @bucket_sort(i32* %0, i32 %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("what??!\n"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"what??!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"what??!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ rmdir(char *);
int main() {
  if (rmdir("hoo")) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <rmdir@plt>
cmp    $0x0,%rax
je     113a <main+0x2a>
jmp    113a <main+0x2a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <rmdir@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"hoo\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @rmdir(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
br label %5
5: ; preds = %4, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"hoo\00"
define i32 @main() {
%1 = tail call i64 @rmdir(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void __kunmap_local(void *addr) {}


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

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

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

LLVM IR (-O2):
define void @__kunmap_local(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int is_quit(char cmd[20]) {
  if (!strcmp(cmd, "quit\n"))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1141 <is_quit+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <is_quit+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"quit\0A\00"
define i32 @is_quit(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"quit\0A\00"
define i32 @is_quit(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void hash_open_initalize(int table[]) {
  int i;
  for (i = 0; i < 10; i += 1)
    table[i] = -2;
}


x86 assembly (clang, -O0):
<hash_open_initalize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1136 <hash_open_initalize+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xfffffffe,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_open_initalize+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_open_initalize>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movabs $0xfffffffefffffffe,%rax
ff ff ff
mov    %rax,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @hash_open_initalize(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 -2, i32 -2, i32 -2, i32 -2>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 -2, i32 -2, i32 -2, i32 -2>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
store i32 -2, i32* %5
%6 = getelementptr inbounds i32, i32* %0, i64 9
store i32 -2, i32* %6
ret void
}
int check_prime(int a) {
  for (int n = 2; n < a; n++) {
    if (a % n == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <check_prime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <check_prime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <check_prime+0x50>
jmp    113b <check_prime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <check_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
mov    $0x1,%eax
cmp    $0x3,%edi
jl     1139 <check_prime+0x39>
xor    %eax,%eax
test   $0x1,%dil
je     1139 <check_prime+0x39>
mov    $0x3,%eax
nopw   0x0(%rax,%rax,1)
mov    %eax,%ecx
cmp    %eax,%edi
je     1132 <check_prime+0x32>
mov    %edi,%eax
cltd
idiv   %ecx
lea    0x1(%rcx),%eax
test   %edx,%edx
jne    1120 <check_prime+0x20>
xor    %eax,%eax
cmp    %edi,%ecx
setge  %al
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %16
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %9
%7 = phi i32 [ %12, %9 ], [ 3, %3 ]
%8 = icmp eq i32 %7, %0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = srem i32 %0, %7
%11 = icmp eq i32 %10, 0
%12 = add nuw nsw i32 %7, 1
br i1 %11, label %13, label %6
13: ; preds = %6, %9
%14 = icmp sge i32 %7, %0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %13, %3, %1
%17 = phi i32 [ 1, %1 ], [ 0, %3 ], [ %15, %13 ]
ret i32 %17
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_add_standard_term(int i, int n, int *exp, double *c) {
  int a[2], fail;
  a[0] = n;
  a[1] = i;
  fail = _ada_use_c2phc(26, a, exp, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_add_standard_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
lea    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1a,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_add_standard_term>:
push   %rax
mov    %esi,(%rsp)
mov    %edi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x1a,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_add_standard_term(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double*
%9 = alloca [2 x i32]
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store double* %3, double** %8
%11 = load i32, i32* %6
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %13, i32* %14
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%16 = load i32*, i32** %7
%17 = load double*, double** %8
%18 = call i32 @_ada_use_c2phc(i32 26, i32* %15, i32* %16, double* %17)
store i32 %18, i32* %10
%19 = load i32, i32* %10
ret i32 %19
}

LLVM IR (-O2):
define i32 @syscon_add_standard_term(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca [2 x i32]
%6 = bitcast [2 x i32]* %5 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %1, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %0, i32* %8
%9 = call i32 @_ada_use_c2phc(i32 26, i32* %7, i32* %2, double* %3)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ closeConnections();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void sigTERM_handler(int signum) {
  syslog(LOG_INFO, "Caught SIGTERM. Exiting...");
  closeConnections();
  exit(0);
}


x86 assembly (clang, -O0):
<sigTERM_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closeConnections@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sigTERM_handler>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <syslog@plt>
xor    %eax,%eax
call   1030 <closeConnections@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [27 x i8] c"Caught SIGTERM. Exiting...\00"
define void @sigTERM_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_INFO
%4 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @closeConnections()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [27 x i8] c"Caught SIGTERM. Exiting...\00"
define void @sigTERM_handler(i32 %0) {
%2 = load i32, i32* @LOG_INFO
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @closeConnections()
%5 = tail call i32 @exit(i32 0)
unreachable
}
int fn_42_c(int locked, int i) {
  if (locked)
    ;

  if (i > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<fn_42_c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1119 <fn_42_c+0x19>
jmp    1119 <fn_42_c+0x19>
cmpl   $0x0,-0xc(%rbp)
jle    112f <fn_42_c+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <fn_42_c+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_42_c>:
xor    %eax,%eax
test   %esi,%esi
setg   %al
ret

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

LLVM IR (-O2):
define i32 @fn_42_c(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t potentiometers_get_value_hal(uint8_t pot_nr) {}


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

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

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

LLVM IR (-O2):
define i32 @potentiometers_get_value_hal(i32 %0) {
ret i32 undef
}
/* Variables and functions */
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
int parseInt(char *string) { return (int)strtol(string, NULL, 10); }


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

x86 assembly (clang, -O2):
<parseInt>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @parseInt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i32* null, i32 10)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @parseInt(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%3 = trunc i64 %2 to i32
ret i32 %3
}
void ff_hevc_put_hevc_uni_epel_hv48_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_hv48_8_avx2() {
ret void
}
/* Variables and functions */
char *getcwd(int /*<<< orphan*/ *, int /*<<< orphan*/);
char *get_cwd_c() { return getcwd(NULL, 0); }


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

x86 assembly (clang, -O2):
<get_cwd_c>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <getcwd@plt>

LLVM IR (-O0):
define i8* @get_cwd_c() {
%1 = call i8* @getcwd(i32* null, i32 0)
ret i8* %1
}

LLVM IR (-O2):
define i8* @get_cwd_c() {
%1 = tail call i8* @getcwd(i32* null, i32 0)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Programing is fun.\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Programing is fun.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void fputi(FILE *file, int val) {
  fputc(val & 0xff, file);
  fputc((val >> 8) & 0xff, file);
  fputc((val >> 16) & 0xff, file);
  fputc((val >> 24) & 0xff, file);
}


x86 assembly (clang, -O0):
<fputi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x10,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x18,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputi>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @fputi(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = load i32*, i32** %3
%8 = call i32 @fputc(i32 %6, i32* %7)
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = call i32 @fputc(i32 %11, i32* %12)
%14 = load i32, i32* %4
%15 = ashr i32 %14, 16
%16 = and i32 %15, 255
%17 = load i32*, i32** %3
%18 = call i32 @fputc(i32 %16, i32* %17)
%19 = load i32, i32* %4
%20 = ashr i32 %19, 24
%21 = and i32 %20, 255
%22 = load i32*, i32** %3
%23 = call i32 @fputc(i32 %21, i32* %22)
ret void
}

LLVM IR (-O2):
define void @fputi(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @fputc(i32 %3, i32* %0)
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = tail call i32 @fputc(i32 %6, i32* %0)
%8 = lshr i32 %1, 16
%9 = and i32 %8, 255
%10 = tail call i32 @fputc(i32 %9, i32* %0)
%11 = lshr i32 %1, 24
%12 = tail call i32 @fputc(i32 %11, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *thread2() {
  sleep(5);
  printf("This is thread 2 running.\n");
}


x86 assembly (clang, -O0):
<thread2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1040 <sleep@plt>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread2>:
push   %rax
mov    $0x5,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"This is thread 2 running.\0A\00"
define i8* @thread2() {
%1 = alloca i8*
%2 = call i32 @sleep(i32 5)
%3 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %1
ret i8* %4
}

LLVM IR (-O2):
@str = [26 x i8] c"This is thread 2 running.\00"
define noalias i8* @thread2() {
%1 = tail call i32 @sleep(i32 5)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i8* undef
}
/* Variables and functions */
int _system(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", _system("ls"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <_system@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
call   1040 <_system@plt>
lea    0xecc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"ls\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @_system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"ls\00"
define i32 @main() {
%1 = tail call i32 @_system(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}