xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bubbleSort(int *, int);
int main() {
  int a[20] = {20, 19, 18, 17, 16, 15, 14, 13, 12, 11,
               10, 9,  8,  7,  6,  5,  4,  3,  2,  1};
  bubbleSort(a, 20);
  return a[3];
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movaps 0xf25(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xf09(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeed(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x14,%esi
call   1030 <bubbleSort@plt>
mov    0xc(%rsp),%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [20 x i32] [i32 20, i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
store i32 0, i32* %1
%3 = bitcast [20 x i32]* %2 to i8*
%4 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%5 = call i32 @bubbleSort(i32* %4, i32 20)
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 3
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
@__const.main.a = [20 x i32] [i32 20, i32 19, i32 18, i32 17, i32 16, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @bubbleSort(i32* %3, i32 20)
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 3
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, unsigned char);
int /*<<< orphan*/ stdout;
void WriteChar_Real(unsigned int c) {
  unsigned char c_real = c & 0xFF;
  printf("%c", c_real);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<WriteChar_Real>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
lea    0xec3(%rip),%rdi
movzbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteChar_Real>:
push   %rax
movzbl %dil,%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@stdout = global i32 0
define void @WriteChar_Real(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = trunc i32 %5 to i8
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 zeroext %7)
%9 = load i32, i32* @stdout
%10 = call i32 @fflush(i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@stdout = global i32 0
define void @WriteChar_Real(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 zeroext %2)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int func();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (func() == 1) {
    printf("Iz success.\n");
  } else {
    printf("Iz fail.\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <func@plt>
cmp    $0x1,%eax
jne    1157 <main+0x37>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    116f <main+0x4f>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1176 <main+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <func@plt>
xor    %ebx,%ebx
cmp    $0x1,%eax
setne  %bl
lea    0xed2(%rip),%rax
lea    0xec2(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [9 x i8] c"Iz fail.\00"
@str.2 = [12 x i8] c"Iz success.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func()
%4 = icmp eq i32 %3, 1
%5 = select i1 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0)
%6 = xor i1 %4, true
%7 = zext i1 %6 to i32
%8 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ writeport(int, char *);
int cleanup(int fd) {
  printf("cleanup\n");
  writeport(fd, "lock\n");
  writeport(fd, "linefeed\n");
  writeport(fd, "baud0\n");
  sleep(2);
  return 0;
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
lea    0xeb8(%rip),%rsi
call   1030 <writeport@plt>
mov    -0x4(%rbp),%edi
lea    0xeaf(%rip),%rsi
call   1030 <writeport@plt>
mov    -0x4(%rbp),%edi
lea    0xeaa(%rip),%rsi
call   1030 <writeport@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rbx
mov    %edi,%ebx
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
lea    0xeba(%rip),%rsi
mov    %ebx,%edi
call   1040 <writeport@plt>
lea    0xeb2(%rip),%rsi
mov    %ebx,%edi
call   1040 <writeport@plt>
lea    0xeae(%rip),%rsi
mov    %ebx,%edi
call   1040 <writeport@plt>
mov    $0x2,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"cleanup\0A\00"
@.str.1 = [6 x i8] c"lock\0A\00"
@.str.2 = [10 x i8] c"linefeed\0A\00"
@.str.3 = [7 x i8] c"baud0\0A\00"
define i32 @cleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @writeport(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @writeport(i32 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = call i32 @writeport(i32 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @sleep(i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"lock\0A\00"
@.str.2 = [10 x i8] c"linefeed\0A\00"
@.str.3 = [7 x i8] c"baud0\0A\00"
@str = [8 x i8] c"cleanup\00"
define i32 @cleanup(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @writeport(i32 %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @writeport(i32 %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @writeport(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test(unsigned int, unsigned int);
int main(int argc, char *argv[]) {
  unsigned int x = 0x80000000;
  test(x, x);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x80000000,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <test@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80000000,%edi
mov    $0x80000000,%esi
call   1040 <test@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -2147483648, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @test(i32 %7, i32 %8)
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test(i32 -2147483648, i32 -2147483648)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int isNan(float arg) {
  float x;
  return arg != arg;
}


x86 assembly (clang, -O0):
<isNan>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNan>:
xor    %eax,%eax
ucomiss %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @isNan(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fcmp une float %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @isNan(float %0) {
%2 = fcmp uno float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
void NV12ToABGR() {}


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

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

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

LLVM IR (-O2):
define void @NV12ToABGR() {
ret void
}
/* Variables and functions */
int print_rng(int *);
int fprint_rng(int **genptr) { return print_rng(*genptr); }


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

x86 assembly (clang, -O2):
<fprint_rng>:
mov    (%rdi),%rdi
jmp    1030 <print_rng@plt>

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

LLVM IR (-O2):
define i32 @fprint_rng(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = tail call i32 @print_rng(i32* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_number(int);
int /*<<< orphan*/ output_with_tab(char *);
void add_offset(int val) {
  output_with_tab("add r1 ");
  output_number(val);
  newline();
}


x86 assembly (clang, -O0):
<add_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <output_with_tab@plt>
mov    -0x4(%rbp),%edi
call   1050 <output_number@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_offset>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <output_with_tab@plt>
mov    %ebx,%edi
call   1050 <output_number@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"add r1 \00"
define void @add_offset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @output_with_tab(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @output_number(i32 %4)
%6 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"add r1 \00"
define void @add_offset(i32 %0) {
%2 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @output_number(i32 %0)
%4 = tail call i32 (...) @newline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ acos(int /*<<< orphan*/);
float glmDegf(int /*<<< orphan*/);
int /*<<< orphan*/ glmDotProduct3f(float const *, float const *);
float glmComputeNormalizedVectorAngle3fDeg(const float v1[3],
                                           const float v2[3]) {
  return glmDegf(acos(glmDotProduct3f(v1, v2)));
}


x86 assembly (clang, -O0):
<glmComputeNormalizedVectorAngle3fDeg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <glmDotProduct3f@plt>
mov    %eax,%edi
call   1030 <acos@plt>
mov    %eax,%edi
call   1050 <glmDegf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeNormalizedVectorAngle3fDeg>:
push   %rax
call   1040 <glmDotProduct3f@plt>
mov    %eax,%edi
call   1030 <acos@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <glmDegf@plt>

LLVM IR (-O0):
define float @glmComputeNormalizedVectorAngle3fDeg(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = call i32 @glmDotProduct3f(float* %5, float* %6)
%8 = call i32 @acos(i32 %7)
%9 = call float @glmDegf(i32 %8)
ret float %9
}

LLVM IR (-O2):
define float @glmComputeNormalizedVectorAngle3fDeg(float* %0, float* %1) {
%3 = tail call i32 @glmDotProduct3f(float* %0, float* %1)
%4 = tail call i32 @acos(i32 %3)
%5 = tail call float @glmDegf(i32 %4)
ret float %5
}
/* Variables and functions */
char *parse_priv(unsigned char);
int /*<<< orphan*/ printf(char *, char *);
void show_priv(unsigned char c) {
  char *privstr;
  privstr = parse_priv(c);
  printf("%s", privstr);
}


x86 assembly (clang, -O0):
<show_priv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <parse_priv@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_priv>:
push   %rax
call   1040 <parse_priv@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @show_priv(i8 zeroext %0) {
%2 = tail call i8* @parse_priv(i8 zeroext %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char c = '3';
  int n = 0;
  printf("The ASCII number of character c is: %d\n", c);
  printf("Convert the char to int\n");
  n = c - '0';
  printf("The integer number of the char is: %d\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x33,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
movsbl -0x5(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x33,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf14(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"The ASCII number of character c is: %d\0A\00"
@.str.1 = [25 x i8] c"Convert the char to int\0A\00"
@.str.2 = [39 x i8] c"The integer number of the char is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
store i32 0, i32* %1
store i8 51, i8* %2
store i32 0, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 48
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"The ASCII number of character c is: %d\0A\00"
@.str.2 = [39 x i8] c"The integer number of the char is: %d\0A\00"
@str = [24 x i8] c"Convert the char to int\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 51)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
int /*<<< orphan*/ system(char *);
void ARPreqReplay(char *bssid, char *mon, char *mac) {
  char cmd[256];
  sprintf(cmd,
          "xterm 2> /dev/null -T ARPreqReplay -e \"aireplay-ng -3 -b %s -h %s "
          "%s --ignore-negative-one\" &",
          bssid, mac, mon);
  system(cmd);
}


x86 assembly (clang, -O0):
<ARPreqReplay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xeaf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x120(%rbp),%rdi
call   1030 <system@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ARPreqReplay>:
push   %rbx
sub    $0x100,%rsp
mov    %rdx,%rcx
mov    %rsi,%r8
mov    %rdi,%rdx
lea    0xec8(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [94 x i8] c"xterm 2> /dev/null -T ARPreqReplay -e \22aireplay-ng -3 -b %s -h %s %s --ignore-negative-one\22 &\00"
define void @ARPreqReplay(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [256 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i8*, i8** %6
%11 = load i8*, i8** %5
%12 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%14 = call i32 @system(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [94 x i8] c"xterm 2> /dev/null -T ARPreqReplay -e \22aireplay-ng -3 -b %s -h %s %s --ignore-negative-one\22 &\00"
define void @ARPreqReplay(i8* %0, i8* %1, i8* %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %2, i8* %1)
%7 = call i32 @system(i8* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int ImageKit_Colorspace_HSV2RGB(double *src, double *dst, uint32_t channels) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @ImageKit_Colorspace_HSV2RGB(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @ImageKit_Colorspace_HSV2RGB(double* nocapture readnone %0, double* nocapture readnone %1, i32 %2) {
ret i32 0
}
__float128 from_single(float a) { return (__float128)a; }


x86 assembly (clang, -O0):
<from_single>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1120 <__extendsftf2>
add    $0x10,%rsp
pop    %rbp
ret
nopl   (%rax)

x86 assembly (clang, -O2):
<from_single>:
jmp    1110 <__extendsftf2>
cs nopw 0x0(%rax,%rax,1)
nop

LLVM IR (-O0):
define fp128 @from_single(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to fp128
ret fp128 %4
}

LLVM IR (-O2):
define fp128 @from_single(float %0) {
%2 = fpext float %0 to fp128
ret fp128 %2
}
void test_odd() {
  int unsigned const const *const a;
  int *const b[5];
  unsigned const *const c[5];
  static const unsigned *const d;
  const static signed const *const e;
  int unsigned auto *const *const f;
  void *restrict g;
  volatile int *const restrict h;
  int *(*A)[3];
  char(*(*B[3])())[5];
  int(*(*C)(void))[3];
  float *(*(*D)(int))(double **, char);
  unsigned **(*(*E)[5])(char const *, int *);
  char *(*F(const char *))(char *);
  char *G(
      char (*a)(int), struct {
        char (*a)(union {
          struct {
            int(a[5])[5];
            enum { A, B, C } b;
          };
          char (*p)(int[]);
        } a);
        int b;
      } * *b);
}


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

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

LLVM IR (-O0):
@test_odd.d = internal constant i32* null
@test_odd.e = internal constant i32* null
define void @test_odd() {
%1 = alloca i32*
%2 = alloca [5 x i32*]
%3 = alloca [5 x i32*]
%4 = alloca i32**
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca [3 x i32*]*
%8 = alloca [3 x [5 x i8]* (...)*]
%9 = alloca [3 x i32]* ()*
%10 = alloca float* (double**, i8)* (i32)*
%11 = alloca [5 x i32** (i8*, i32*)*]*
ret void
}

LLVM IR (-O2):
define void @test_odd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, int *);
int Read_int(char prompt[]) {
  int n;
  printf("%s", prompt);
  scanf("%d", &n);
  return n;
}


x86 assembly (clang, -O0):
<Read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read_int>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @Read_int(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
scalar_t__ nrfx_usbd_errata_type_52840();
int /*<<< orphan*/ nrfx_usbd_errata_type_52840_eng_b_or_later();
bool nrfx_usbd_errata_200(void) {
  return (1 && (nrfx_usbd_errata_type_52840() &&
                !nrfx_usbd_errata_type_52840_eng_b_or_later()));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <nrfx_usbd_errata_type_52840@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1153 <nrfx_usbd_errata_200+0x33>
mov    $0x0,%al
call   1030 <nrfx_usbd_errata_type_52840_eng_b_or_later@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <nrfx_usbd_errata_type_52840@plt>
test   %rax,%rax
je     113d <nrfx_usbd_errata_200+0x1d>
xor    %eax,%eax
call   1030 <nrfx_usbd_errata_type_52840_eng_b_or_later@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nrfx_usbd_errata_200() {
%1 = call i64 (...) @nrfx_usbd_errata_type_52840()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 (...) @nrfx_usbd_errata_type_52840_eng_b_or_later()
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br label %7
7: ; preds = %3, %0
%8 = phi i1 [ false, %0 ], [ %6, %3 ]
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @nrfx_usbd_errata_200() {
%1 = tail call i64 (...) @nrfx_usbd_errata_type_52840()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 (...) @nrfx_usbd_errata_type_52840_eng_b_or_later()
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
int DivRoundUp(int value, int divisor) {
  return ((value + divisor - 1) / divisor);
}


x86 assembly (clang, -O0):
<DivRoundUp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DivRoundUp>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @DivRoundUp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @DivRoundUp(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sdiv i32 %4, %1
ret i32 %5
}
void gtk_text_view_move_mark_onscreen() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_move_mark_onscreen() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int total_score();
int main() {
  int n;
  scanf("%d", &n);
  while (n--)
    printf("%d\n", total_score());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     117d <main+0x4d>
mov    $0x0,%al
call   1030 <total_score@plt>
mov    %eax,%esi
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
jmp    114f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
subl   $0x1,0xc(%rsp)
jb     1178 <main+0x48>
lea    0xeaf(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <total_score@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
subl   $0x1,0xc(%rsp)
jae    1160 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
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)
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = call i32 (...) @total_score()
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %4
11: ; preds = %4
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 = add nsw i32 %4, -1
store i32 %5, i32* %1
%6 = icmp eq i32 %4, 0
br i1 %6, label %13, label %7
7: ; preds = %0, %7
%8 = call i32 (...) @total_score()
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %1
%11 = add nsw i32 %10, -1
store i32 %11, i32* %1
%12 = icmp eq i32 %10, 0
br i1 %12, label %13, label %7
13: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *app) {
  fprintf(stderr,
          "Usage:\n"
          "	%s out.bin out.h binary1 [binary2 [...]]\n",
          app);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Usage:\0A\09%s out.bin out.h binary1 [binary2 [...]]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Usage:\0A\09%s out.bin out.h binary1 [binary2 [...]]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int do_573() { return 573; }


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

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

LLVM IR (-O0):
define i32 @do_573() {
ret i32 573
}

LLVM IR (-O2):
define i32 @do_573() {
ret i32 573
}
int compare(const void *a, const void *b) {
  if (*((float *)a) < *((float *)b))
    return -1;
  else if (*((float *)a) > *((float *)b))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1131 <compare+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <compare+0x59>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    1152 <compare+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1159 <compare+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to float*
%8 = load float, float* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to float*
%11 = load float, float* %10
%12 = fcmp olt float %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to float*
%17 = load float, float* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to float*
%20 = load float, float* %19
%21 = fcmp ogt float %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 1, i32* %3
br label %24
23: ; preds = %14
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp olt float %4, %6
%8 = fcmp ogt float %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void DEBUG_PRINT(const char *s) { printf("%s", s); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @DEBUG_PRINT(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ write_byte(int, scalar_t__, int);
void write_word(int fd, uint32_t pos, uint16_t value) {
  write_byte(fd, pos, value);
  write_byte(fd, pos + 1, value >> 8);
}


x86 assembly (clang, -O0):
<write_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write_byte@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    -0x14(%rbp),%edx
sar    $0x8,%edx
call   1030 <write_byte@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_word>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %edi,%r14d
call   1030 <write_byte@plt>
add    $0x1,%rbx
sar    $0x8,%ebp
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write_byte@plt>

LLVM IR (-O0):
define void @write_word(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i32 @write_byte(i32 %7, i64 %8, i32 %9)
%11 = load i32, i32* %4
%12 = load i64, i64* %5
%13 = add nsw i64 %12, 1
%14 = load i32, i32* %6
%15 = ashr i32 %14, 8
%16 = call i32 @write_byte(i32 %11, i64 %13, i32 %15)
ret void
}

LLVM IR (-O2):
define void @write_word(i32 %0, i64 %1, i32 %2) {
%4 = tail call i32 @write_byte(i32 %0, i64 %1, i32 %2)
%5 = add nsw i64 %1, 1
%6 = ashr i32 %2, 8
%7 = tail call i32 @write_byte(i32 %0, i64 %5, i32 %6)
ret void
}
/* Variables and functions */
size_t strlen(const char *restrict s) {
  char *os = (char *)s;
  for (; *s; ++s)
    ;
  return s - os;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <strlen+0x33>
jmp    1122 <strlen+0x22>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* noalias %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
scalar_t__ i2c_smbus_write_byte_data(int, int, int);
int /*<<< orphan*/ perror(char *);
int vct_erase(int i2c) {
  if (i2c_smbus_write_byte_data(i2c, 0x2a, 0x00)) {
    perror("Error sending erase command");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<vct_erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2a,%esi
xor    %edx,%edx
call   1030 <i2c_smbus_write_byte_data@plt>
cmp    $0x0,%rax
je     115c <vct_erase+0x3c>
lea    0xeb5(%rip),%rdi
call   1040 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1163 <vct_erase+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vct_erase>:
push   %rbx
xor    %ebx,%ebx
mov    $0x2a,%esi
xor    %edx,%edx
call   1030 <i2c_smbus_write_byte_data@plt>
test   %rax,%rax
jne    1138 <vct_erase+0x18>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec1(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%ebx
jmp    1134 <vct_erase+0x14>

LLVM IR (-O0):
@.str = [28 x i8] c"Error sending erase command\00"
define i32 @vct_erase(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @i2c_smbus_write_byte_data(i32 %4, i32 42, i32 0)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [28 x i8] c"Error sending erase command\00"
define i32 @vct_erase(i32 %0) {
%2 = tail call i64 @i2c_smbus_write_byte_data(i32 %0, i32 42, i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
char *decompose_shortdesc(void) {
  return "split an export file, with optional decryption";
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"split an export file, with optional decryption\00"
define i8* @decompose_shortdesc() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [47 x i8] c"split an export file, with optional decryption\00"
define i8* @decompose_shortdesc() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}
void av_color_transfer_name() {}


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

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

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

LLVM IR (-O2):
define void @av_color_transfer_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write(int, unsigned char *, int);
void __attribute__((noreturn)) die(void) {
  unsigned char zero = 0;
  write(1, &zero, 1);
  exit(3);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @die() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @write(i32 1, i8* %1, i32 1)
%3 = tail call i32 @exit(i32 3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
size_t fmt_bytes_hex_reverse(char *, int /*<<< orphan*/ *, int);
size_t fmt_u64_hex(char *out, uint64_t val) {
  return fmt_bytes_hex_reverse(out, (uint8_t *)&val, 8);
}


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

x86 assembly (clang, -O2):
<fmt_u64_hex>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x8,%edx
call   1030 <fmt_bytes_hex_reverse@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @fmt_u64_hex(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i64 @fmt_bytes_hex_reverse(i8* %0, i32* %3, i32 8)
ret i64 %4
}
/* Variables and functions */
scalar_t__ malloc(int);
int **init_2d_Array(void) {
  int **newarr = (int **)malloc(sizeof(int *));
  return newarr;
}


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

x86 assembly (clang, -O2):
<init_2d_Array>:
mov    $0x8,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32** @init_2d_Array() {
%1 = alloca i32**
%2 = call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to i32**
store i32** %3, i32*** %1
%4 = load i32**, i32*** %1
ret i32** %4
}

LLVM IR (-O2):
define i32** @init_2d_Array() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to i32**
ret i32** %2
}
int ft_iswhitespace(int c) {
  static char authorized[6] = {'\n', '\v', '\t', '\r', '\f', ' '};
  int i;
  i = 0;
  while (i < 6) {
    if (authorized[i] == (char)c)
      return (1);
    i++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_iswhitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    114f <ft_iswhitespace+0x4f>
movslq -0xc(%rbp),%rcx
lea    0x2efd(%rip),%rax
movsbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    1141 <ft_iswhitespace+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1156 <ft_iswhitespace+0x56>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <ft_iswhitespace+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_iswhitespace>:
shl    $0x18,%edi
mov    $0x1,%eax
cmp    $0xbffffff,%edi
jg     1129 <ft_iswhitespace+0x29>
cmp    $0x9000000,%edi
je     1128 <ft_iswhitespace+0x28>
cmp    $0xa000000,%edi
je     1128 <ft_iswhitespace+0x28>
cmp    $0xb000000,%edi
jne    1141 <ft_iswhitespace+0x41>
ret
cmp    $0xc000000,%edi
je     1128 <ft_iswhitespace+0x28>
cmp    $0xd000000,%edi
je     1128 <ft_iswhitespace+0x28>
cmp    $0x20000000,%edi
je     1128 <ft_iswhitespace+0x28>
xor    %eax,%eax
ret

LLVM IR (-O0):
@ft_iswhitespace.authorized = internal global [6 x i8] c"\0A\0B\09\0D\0C "
define i32 @ft_iswhitespace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %19, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 6
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [6 x i8], [6 x i8]* @ft_iswhitespace.authorized, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i32, i32* %3
%15 = trunc i32 %14 to i8
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br i1 %17, label %18, label %19
18: ; preds = %8
store i32 1, i32* %2
br label %23
19: ; preds = %8
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %5
22: ; preds = %5
store i32 0, i32* %2
br label %23
23: ; preds = %22, %18
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @ft_iswhitespace(i32 %0) {
%2 = shl i32 %0, 24
switch i32 %2, label %3 [
i32 167772160, label %4
i32 184549376, label %4
i32 150994944, label %4
i32 218103808, label %4
i32 201326592, label %4
i32 536870912, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %1, %1, %3
%5 = phi i32 [ 1, %1 ], [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ABMON_12;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_abmon_12() { return nl_langinfo(ABMON_12); }


x86 assembly (clang, -O0):
<langinfo_abmon_12>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_abmon_12>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@ABMON_12 = global i32 0
define i8* @langinfo_abmon_12() {
%1 = load i32, i32* @ABMON_12
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@ABMON_12 = global i32 0
define i8* @langinfo_abmon_12() {
%1 = load i32, i32* @ABMON_12
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
int foo(int x) {
  int a;
  int *p = &a;
#pragma omp taskloop lastprivate(a)
  for (a = 0; a < x; ++a)
    ;
  return *p;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1135 <foo+0x35>
jmp    1127 <foo+0x27>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1116 <foo+0x16>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
test   %edi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 0)
ret i32 %2
}