xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ args;

/* Variables and functions */
int spawn(int, char **);
int main(int argc, char *argv[]) {
  char *args[] = {"/bin/ps", NULL};
  return (spawn((sizeof(args) / sizeof((args)[0])) - 1, args));
}


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)
mov    0x2ce3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ce0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x1,%edi
call   1030 <spawn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edi
call   1030 <spawn@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/ps\00"
@__const.main.args = [2 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [2 x i8*]* %6 to i8*
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%9 = call i32 @spawn(i32 1, i8** %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/ps\00"
@__const.main.args = [2 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* null]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i8*]
%4 = bitcast [2 x i8*]* %3 to i8*
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%6 = call i32 @spawn(i32 1, i8** %5)
ret i32 %6
}
int map_parameter_oceanographic_ice(int center, int disc, int param_cat,
                                    int param_num) {
  (void)(center);
  (void)(disc);
  (void)(center);
  (void)(param_cat);
  switch (param_num) {
  case 0:
    return 91;
  case 1:
    return 92;
  case 2:
    return 93;
  case 3:
    return 94;
  case 4:
    return 95;
  case 5:
    return 96;
  case 6:
    return 97;
  case 7:
    return 98;
  default:
    break;
  }
  return -1;
}


x86 assembly (clang, -O0):
<map_parameter_oceanographic_ice>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x7,%rax
ja     1195 <map_parameter_oceanographic_ice+0x95>
mov    -0x20(%rbp),%rax
lea    0xed4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x5b,-0x4(%rbp)
jmp    11a1 <map_parameter_oceanographic_ice+0xa1>
movl   $0x5c,-0x4(%rbp)
jmp    11a1 <map_parameter_oceanographic_ice+0xa1>
movl   $0x5d,-0x4(%rbp)
jmp    11a1 <map_parameter_oceanographic_ice+0xa1>
movl   $0x5e,-0x4(%rbp)
jmp    11a1 <map_parameter_oceanographic_ice+0xa1>
movl   $0x5f,-0x4(%rbp)
jmp    11a1 <map_parameter_oceanographic_ice+0xa1>
movl   $0x60,-0x4(%rbp)
jmp    11a1 <map_parameter_oceanographic_ice+0xa1>
movl   $0x61,-0x4(%rbp)
jmp    11a1 <map_parameter_oceanographic_ice+0xa1>
movl   $0x62,-0x4(%rbp)
jmp    11a1 <map_parameter_oceanographic_ice+0xa1>
jmp    119a <map_parameter_oceanographic_ice+0x9a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_parameter_oceanographic_ice>:
lea    0x5b(%rcx),%edx
cmp    $0x8,%ecx
mov    $0xffffffff,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @map_parameter_oceanographic_ice(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* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %8
%14 = load i32, i32* %9
switch i32 %14, label %23 [
i32 0, label %15
i32 1, label %16
i32 2, label %17
i32 3, label %18
i32 4, label %19
i32 5, label %20
i32 6, label %21
i32 7, label %22
]
15: ; preds = %4
store i32 91, i32* %5
br label %25
16: ; preds = %4
store i32 92, i32* %5
br label %25
17: ; preds = %4
store i32 93, i32* %5
br label %25
18: ; preds = %4
store i32 94, i32* %5
br label %25
19: ; preds = %4
store i32 95, i32* %5
br label %25
20: ; preds = %4
store i32 96, i32* %5
br label %25
21: ; preds = %4
store i32 97, i32* %5
br label %25
22: ; preds = %4
store i32 98, i32* %5
br label %25
23: ; preds = %4
br label %24
24: ; preds = %23
store i32 -1, i32* %5
br label %25
25: ; preds = %24, %22, %21, %20, %19, %18, %17, %16, %15
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @map_parameter_oceanographic_ice(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ult i32 %3, 8
%6 = add i32 %3, 91
%7 = select i1 %5, i32 %6, i32 -1
ret i32 %7
}
int main(int argc, char **argv) {
  int r;
#pragma omp target exit data
#pragma omp target exit data map(r)
#pragma omp target exit data map(tofrom : r)
#pragma omp target exit data map(always, from : r)
#pragma omp target exit data map(delete : r)
#pragma omp target exit data map(release : r)
#pragma omp target exit data map(always, alloc : r)
#pragma omp target exit data map(to : r)
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int test_imm_E5uint16_mem(unsigned short *val) {
  return ((*val) & (0xE5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E5uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 229
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_copy_from_dobldobl_systems_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(464, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_copy_from_dobldobl_systems_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1d0,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_copy_from_dobldobl_systems_container>:
mov    $0x1d0,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @celcon_copy_from_dobldobl_systems_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 464, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_copy_from_dobldobl_systems_container() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 464, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_sec;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int date_get_sec(void) {
  time_t t;
  struct tm *lt;
  t = time(NULL);
  lt = localtime(&t);
  return lt->tm_sec;
}


x86 assembly (clang, -O0):
<date_get_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_get_sec>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @date_get_sec() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @date_get_sec() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ pRender_DumpScreen();
void Render_DumpDisplay(void) { pRender_DumpScreen(); }


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

x86 assembly (clang, -O2):
<Render_DumpDisplay>:
xor    %eax,%eax
jmp    1030 <pRender_DumpScreen@plt>

LLVM IR (-O0):
define void @Render_DumpDisplay() {
%1 = call i32 (...) @pRender_DumpScreen()
ret void
}

LLVM IR (-O2):
define void @Render_DumpDisplay() {
%1 = tail call i32 (...) @pRender_DumpScreen()
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int multprec_Newton_step(int deci) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(195, &deci, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<multprec_Newton_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xc3,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @multprec_Newton_step(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 195, i32* %2, i32* %6, double* %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @multprec_Newton_step(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 195, i32* %2, i32* undef, double* undef)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void dump_begin(int dump) {
  if (dump == 2) {
    printf("{\n");
    printf("\"type\": \"FeatureCollection\",\n");
    printf("\"features\": [\n");
  }
}


x86 assembly (clang, -O0):
<dump_begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1149 <dump_begin+0x39>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_begin>:
cmp    $0x2,%edi
jne    113b <dump_begin+0x2b>
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [30 x i8] c"\22type\22: \22FeatureCollection\22,\0A\00"
@.str.2 = [15 x i8] c"\22features\22: [\0A\00"
define void @dump_begin(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 2
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@str = [2 x i8] c"{\00"
@str.3 = [29 x i8] c"\22type\22: \22FeatureCollection\22,\00"
@str.4 = [14 x i8] c"\22features\22: [\00"
define void @dump_begin(i32 %0) {
%2 = icmp eq i32 %0, 2
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.3, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.4, i64 0, i64 0))
br label %7
7: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void switch4() {
  int x = 3;
  switch (x) {
  case 6:
    puts("x = 6");
    break;
  case 5:
  case 4:
  case 3:
    puts("x es 3, 4 o 5");
    break;
  default:
    puts("x < 3 o x > 6");
  }
}


x86 assembly (clang, -O0):
<switch4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
add    $0xfffffffd,%eax
sub    $0x3,%eax
jb     1158 <switch4+0x48>
jmp    1136 <switch4+0x26>
mov    -0x8(%rbp),%eax
sub    $0x6,%eax
jne    1169 <switch4+0x59>
jmp    1147 <switch4+0x37>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
jmp    1175 <switch4+0x65>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
jmp    1175 <switch4+0x65>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch4>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"x = 6\00"
@.str.1 = [14 x i8] c"x es 3, 4 o 5\00"
@.str.2 = [14 x i8] c"x < 3 o x > 6\00"
define void @switch4() {
%1 = alloca i32
store i32 3, i32* %1
%2 = load i32, i32* %1
switch i32 %2, label %7 [
i32 6, label %3
i32 5, label %5
i32 4, label %5
i32 3, label %5
]
3: ; preds = %0
%4 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %0, %0, %0
%6 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5, %3
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"x es 3, 4 o 5\00"
define void @switch4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gps_init(void) {}


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

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

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

LLVM IR (-O2):
define void @gps_init() {
ret void
}
/* Variables and functions */
int strerror_r(int errno, char *str, size_t n) { return 0; }


x86 assembly (clang, -O0):
<strerror_r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strerror_r(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i32 0
}
/* Type definitions */
typedef int u_int;
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ TIOCGPGRP;
int /*<<< orphan*/ _DIAGASSERT(int);
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
pid_t tcgetpgrp(int fd) {
  int s;
  _DIAGASSERT(fd != -1);
  if (ioctl(fd, TIOCGPGRP, &s) < 0)
    return ((pid_t)-1);
  if (s == (pid_t)-1)
    s = (u_int)(pid_t)~0u >> 1;
  return ((pid_t)s);
}


x86 assembly (clang, -O0):
<tcgetpgrp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <_DIAGASSERT@plt>
mov    -0x8(%rbp),%edi
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1167 <tcgetpgrp+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    117e <tcgetpgrp+0x5e>
cmpl   $0xffffffff,-0xc(%rbp)
jne    1178 <tcgetpgrp+0x58>
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcgetpgrp>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0xffffffff,%ebx
setne  %dil
call   1040 <_DIAGASSERT@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xc(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     115b <tcgetpgrp+0x3b>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@TIOCGPGRP = global i32 0
define i32 @tcgetpgrp(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
%8 = call i32 @_DIAGASSERT(i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* @TIOCGPGRP
%11 = call i64 @ioctl(i32 %9, i32 %10, i32* %4)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %20
14: ; preds = %1
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 -1, i32* %4
br label %18
18: ; preds = %17, %14
%19 = load i32, i32* %4
store i32 %19, i32* %2
br label %20
20: ; preds = %18, %13
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@TIOCGPGRP = global i32 0
define i32 @tcgetpgrp(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = icmp ne i32 %0, -1
%5 = zext i1 %4 to i32
%6 = tail call i32 @_DIAGASSERT(i32 %5)
%7 = load i32, i32* @TIOCGPGRP
%8 = call i64 @ioctl(i32 %0, i32 %7, i32* %2)
%9 = icmp slt i64 %8, 0
%10 = load i32, i32* %2
%11 = select i1 %9, i32 -1, i32 %10
ret i32 %11
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s1) {
  char *s = malloc(strlen(s1) + 1);
  strcpy(s, s1);
  return s;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
scalar_t__ calloc(size_t, int);
double *alloc_matrix(size_t nrows, size_t ncols) {
  return (double *)calloc(nrows * ncols, sizeof(double));
}


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

x86 assembly (clang, -O2):
<alloc_matrix>:
imul   %rsi,%rdi
mov    $0x8,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define double* @alloc_matrix(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = mul i64 %5, %6
%8 = call i64 @calloc(i64 %7, i32 8)
%9 = inttoptr i64 %8 to double*
ret double* %9
}

LLVM IR (-O2):
define double* @alloc_matrix(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i64 @calloc(i64 %3, i32 8)
%5 = inttoptr i64 %4 to double*
ret double* %5
}
unsigned int cpuid_ecx(unsigned int fn) {
  unsigned int eax, ebx, ecx, edx;
  asm("cpuid" : "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) : "0"(fn));
  return ecx;
}


x86 assembly (clang, -O0):
<cpuid_ecx>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,-0x10(%rbp)
mov    %ebx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_ecx>:
push   %rbx
mov    %edi,%eax
cpuid
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpuid_ecx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %7)
%9 = extractvalue { i32, i32, i32, i32 } %8, 0
%10 = extractvalue { i32, i32, i32, i32 } %8, 1
%11 = extractvalue { i32, i32, i32, i32 } %8, 2
%12 = extractvalue { i32, i32, i32, i32 } %8, 3
store i32 %9, i32* %3
store i32 %10, i32* %4
store i32 %11, i32* %5
store i32 %12, i32* %6
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @cpuid_ecx(i32 %0) {
%2 = tail call { i32, i32, i32, i32 } asm "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = extractvalue { i32, i32, i32, i32 } %2, 2
ret i32 %3
}
double e_mb2rhoden(double e_mbar, double tkair) {
  double lrho;
  lrho = (18.016 / 28.966) * e_mbar / (287.04 * 1e-5 * tkair);
  return (lrho);
}


x86 assembly (clang, -O0):
<e_mb2rhoden>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xef2(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xedd(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_mb2rhoden>:
mulsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @e_mb2rhoden(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fmul double 0x3FE3E72EDBDA50A2, %6
%8 = load double, double* %4
%9 = fmul double 0x3F6783AA440BC88C, %8
%10 = fdiv double %7, %9
store double %10, double* %5
%11 = load double, double* %5
ret double %11
}

LLVM IR (-O2):
define double @e_mb2rhoden(double %0, double %1) {
%3 = fmul double %0, 0x3FE3E72EDBDA50A2
%4 = fmul double %1, 0x3F6783AA440BC88C
%5 = fdiv double %3, %4
ret double %5
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int res = fib(20);
  printf("%d\n", res);
  return 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)
mov    $0x14,%edi
call   1040 <fib@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1040 <fib@plt>
lea    0xece(%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"
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
%7 = call i32 @fib(i32 20)
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
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 @fib(i32 20)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
char *strchr(const char *s, int c) {
  char *S = (char *)s;
  char C = c;
  do {
    if (*S == C)
      return S;
    S++;
  } while (*S != 0);
  return (void *)0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x21(%rbp),%ecx
cmp    %ecx,%eax
jne    1139 <strchr+0x39>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <strchr+0x5d>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1119 <strchr+0x19>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
mov    (%rdi),%dl
nopl   0x0(%rax)
movsbl %dl,%edx
cmp    %edx,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%edx
add    $0x1,%rax
test   %dl,%dl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
br label %6
6: ; preds = %11, %2
%7 = phi i8 [ %5, %2 ], [ %13, %11 ]
%8 = phi i8* [ %0, %2 ], [ %12, %11 ]
%9 = sext i8 %7 to i32
%10 = icmp eq i32 %4, %9
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %6
%16 = phi i8* [ %8, %6 ], [ null, %11 ]
ret i8* %16
}
void swap_res(int *a, int *b) {
  int tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
}


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

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

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

LLVM IR (-O2):
define void @swap_res(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
void locka(pthread_mutex_t *a, pthread_mutex_t *b) {
  pthread_mutex_lock(a);
  return;
}


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

x86 assembly (clang, -O2):
<locka>:
jmp    1030 <pthread_mutex_lock@plt>

LLVM IR (-O0):
define void @locka(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 = call i32 @pthread_mutex_lock(i32* %5)
ret void
}

LLVM IR (-O2):
define void @locka(i32* %0, i32* nocapture readnone %1) {
%3 = tail call i32 @pthread_mutex_lock(i32* %0)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int32_t FixedMulShift(int32_t a, int32_t b, int32_t shift) {
  int64_t x = a;
  int64_t y = b;
  int64_t z = x * y;
  return (((uint64_t)z) >> shift) & 0xffffffff;
}


x86 assembly (clang, -O0):
<FixedMulShift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FixedMulShift>:
mov    %edx,%ecx
mov    %edi,%eax
imul   %esi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @FixedMulShift(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = ashr i32 %4, %2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fc_host_get_statistic(char *, char const *);
uint64_t fc_stat_link_failure_count(const char *host) {
  return fc_host_get_statistic("link_failure_count", host);
}


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

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"link_failure_count\00"
define i32 @fc_stat_link_failure_count(i8* %0) {
%2 = tail call i32 @fc_host_get_statistic(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ app_init();
int /*<<< orphan*/ bsp_init();
void init(void *arg) {
  bsp_init();
  app_init();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <bsp_init@plt>
mov    $0x0,%al
call   1030 <app_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1040 <bsp_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <app_init@plt>

LLVM IR (-O0):
define void @init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @bsp_init()
%4 = call i32 (...) @app_init()
ret void
}

LLVM IR (-O2):
define void @init(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @bsp_init()
%3 = tail call i32 (...) @app_init()
ret void
}
struct s34 {
  struct {
    int : 0;
  } a;
  float b;
} f34(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define float @f34() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int bottom_up_cut_rod(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int p[] = {0, 1, 5, 8, 9, 10, 17, 17, 20, 24, 30};
  int max;
  max = bottom_up_cut_rod(p, 12);
  printf("the max:%d\n", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x2c,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xc,%esi
call   1050 <bottom_up_cut_rod@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xc,%esi
call   1040 <bottom_up_cut_rod@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.p = [11 x i32] [i32 0, i32 1, i32 5, i32 8, i32 9, i32 10, i32 17, i32 17, i32 20, i32 24, i32 30]
@.str = [12 x i8] c"the max:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [11 x i32]* %2 to i8*
%5 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%6 = call i32 @bottom_up_cut_rod(i32* %5, i32 12)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.p = [11 x i32] [i32 0, i32 1, i32 5, i32 8, i32 9, i32 10, i32 17, i32 17, i32 20, i32 24, i32 30]
@.str = [12 x i8] c"the max:%d\0A\00"
define i32 @main() {
%1 = alloca [11 x i32]
%2 = bitcast [11 x i32]* %1 to i8*
%3 = getelementptr inbounds [11 x i32], [11 x i32]* %1, i64 0, i64 0
%4 = call i32 @bottom_up_cut_rod(i32* %3, i32 12)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint16_t;

/* Variables and functions */
uint16_t GetPixel16(int x, int y) {
  return ((volatile uint16_t *)(0x6000000))[y * 240 + x];
}


x86 assembly (clang, -O0):
<GetPixel16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0xf0,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
movslq %eax,%rcx
mov    $0x6000000,%eax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetPixel16>:
imul   $0xf0,%esi,%eax
add    %edi,%eax
cltq
mov    0x6000000(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @GetPixel16(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 = mul nsw i32 %5, 240
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* inttoptr (i64 100663296 to i32*), i64 %9
%11 = load volatile i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @GetPixel16(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 240
%4 = add nsw i32 %3, %0
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* inttoptr (i64 100663296 to i32*), i64 %5
%7 = load volatile i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fresnl(double, double *, double *);
void eval_cornu(double t, double *ps, double *pc) {
  double s, c;
  double rspio2 = 0.7978845608028653;
  double spio2 = 1.2533141373155;
  fresnl(t * rspio2, &s, &c);
  *ps = s * spio2;
  *pc = c * spio2;
}


x86 assembly (clang, -O0):
<eval_cornu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <fresnl@plt>
movsd  -0x20(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_cornu>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mulsd  0xedb(%rip),%xmm0
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <fresnl@plt>
movsd  0xecc(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx)
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @eval_cornu(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
store double 0x3FE9884533D43650, double* %9
store double 0x3FF40D931FF62704, double* %10
%11 = load double, double* %4
%12 = load double, double* %9
%13 = fmul double %11, %12
%14 = call i32 @fresnl(double %13, double* %7, double* %8)
%15 = load double, double* %7
%16 = load double, double* %10
%17 = fmul double %15, %16
%18 = load double*, double** %5
store double %17, double* %18
%19 = load double, double* %8
%20 = load double, double* %10
%21 = fmul double %19, %20
%22 = load double*, double** %6
store double %21, double* %22
ret void
}

LLVM IR (-O2):
define void @eval_cornu(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %4 to i8*
%7 = bitcast double* %5 to i8*
%8 = fmul double %0, 0x3FE9884533D43650
%9 = call i32 @fresnl(double %8, double* %4, double* %5)
%10 = load double, double* %4
%11 = fmul double %10, 0x3FF40D931FF62704
store double %11, double* %1
%12 = load double, double* %5
%13 = fmul double %12, 0x3FF40D931FF62704
store double %13, double* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *mpfr_get_version();
scalar_t__ strcmp(char *, char *);
int main(int argc, char **argv) {
  const char *version = mpfr_get_version();
  char subversion[5];
  memcpy(subversion, version, 5);
  subversion[5] = '\0';
  if (strcmp(subversion, "3.1.6") <= 0)
    return 0;
  return 1;
}


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)
mov    $0x0,%al
call   1050 <mpfr_get_version@plt>
mov    %rax,-0x18(%rbp)
lea    -0x1d(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x5,%edx
call   1040 <memcpy@plt>
movb   $0x0,-0x18(%rbp)
lea    -0x1d(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jg     118d <main+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1194 <main+0x64>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1050 <mpfr_get_version@plt>
lea    0xb(%rsp),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0x5,%edx
call   1040 <memcpy@plt>
movb   $0x0,0x10(%rsp)
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"3.1.6\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i8]
%4 = tail call i8* (...) @mpfr_get_version()
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%6 = call i32 @memcpy(i8* %5, i8* %4, i32 5)
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 5
store i8 0, i8* %7
%8 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = icmp sgt i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
cbuf33(f, n) { return (cbuf(f, n, 33)); }


x86 assembly (clang, -O0):
<cbuf33>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x21,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf33>:
mov    $0x21,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf33(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 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 33)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf33(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 33)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
char *showParameters_il() {
  static char text[200];
  sprintf(text, "no parameters needed");
  return text;
}


x86 assembly (clang, -O0):
<showParameters_il>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f12(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<showParameters_il>:
movups 0xef9(%rip),%xmm0
movaps %xmm0,0x2f22(%rip)
movabs $0x64656465656e20,%rax
mov    %rax,0x2f1e(%rip)
lea    0x2f0a(%rip),%rax
ret

LLVM IR (-O0):
@showParameters_il.text = internal global [200 x i8] zeroinitializer
@.str = [21 x i8] c"no parameters needed\00"
define i8* @showParameters_il() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0)
}

LLVM IR (-O2):
@showParameters_il.text = internal global [200 x i8] zeroinitializer
@.str = [21 x i8] c"no parameters needed\00"
define i8* @showParameters_il() {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 16 dereferenceable(21) getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0), i8* align 1 dereferenceable(21) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 21, i1 false)
ret i8* getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0)
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ must_fail(char *, size_t);
void *must_alloc(size_t size) {
  void *mem = malloc(size);
  if (!mem)
    must_fail("malloc", size);
  return mem;
}


x86 assembly (clang, -O0):
<must_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <must_alloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <must_fail@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<must_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <must_alloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <must_fail@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @must_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @must_fail(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
bool is_header_offset_valid(uint16_t offset) {
  return offset == 0x7FF0 || offset == 0x3FF0 || offset == 0x1FF0;
}


x86 assembly (clang, -O0):
<is_header_offset_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x7ff0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1138 <is_header_offset_valid+0x38>
mov    $0x1,%al
cmpl   $0x3ff0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1138 <is_header_offset_valid+0x38>
cmpl   $0x1ff0,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_header_offset_valid>:
mov    %edi,%eax
and    $0xffffbfff,%eax
cmp    $0x3ff0,%eax
sete   %al
cmp    $0x1ff0,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_header_offset_valid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32752
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 16368
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 8176
br label %11
11: ; preds = %8, %5, %1
%12 = phi i1 [ true, %5 ], [ true, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_header_offset_valid(i32 %0) {
%2 = and i32 %0, -16385
%3 = icmp eq i32 %2, 16368
%4 = icmp eq i32 %0, 8176
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
int test_imm_79uint8_reg(unsigned char val) {
  return ((val) & (-0x79 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_79uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff87,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_79uint8_reg>:
test   $0x87,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_79uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -121
%6 = icmp ne i32 %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_79uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -121
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}