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

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
pid_t wait(int *status) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "wait");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
lea    0xee9(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [5 x i8] c"wait\00"
define i32 @wait(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @assert(i32 0)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [5 x i8] c"wait\00"
define i32 @wait(i32* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @assert(i32 0)
ret i32 undef
}
unsigned int vbyte_len(unsigned long int n) {
  unsigned int ret = 1;
  while (n >= 128) {
    n >>= 7;
    ret++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<vbyte_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x80,-0x8(%rbp)
jb     1137 <vbyte_len+0x37>
mov    -0x8(%rbp),%rax
shr    $0x7,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <vbyte_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vbyte_len>:
mov    $0x1,%eax
cmp    $0x80,%rdi
jb     1133 <vbyte_len+0x33>
mov    $0x1,%eax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
shr    $0x7,%rcx
add    $0x1,%eax
cmp    $0x3fff,%rdi
mov    %rcx,%rdi
ja     1120 <vbyte_len+0x20>
ret

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

LLVM IR (-O2):
define i32 @vbyte_len(i64 %0) {
%2 = icmp ugt i64 %0, 127
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 7
%7 = add nuw nsw i32 %4, 1
%8 = icmp ugt i64 %5, 16383
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ display(struct node **);
int /*<<< orphan*/ init(struct node **);
int /*<<< orphan*/ insert(int, struct node **);
int main() {
  struct node *p;
  init(&p);
  insert(10, &p);
  insert(20, &p);
  insert(30, &p);
  insert(40, &p);
  display(&p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1040 <init@plt>
mov    $0xa,%edi
lea    -0x8(%rbp),%rsi
call   1050 <insert@plt>
mov    $0x14,%edi
lea    -0x8(%rbp),%rsi
call   1050 <insert@plt>
mov    $0x1e,%edi
lea    -0x8(%rbp),%rsi
call   1050 <insert@plt>
mov    $0x28,%edi
lea    -0x8(%rbp),%rsi
call   1050 <insert@plt>
lea    -0x8(%rbp),%rdi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <init@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1050 <insert@plt>
mov    $0x14,%edi
mov    %rbx,%rsi
call   1050 <insert@plt>
mov    $0x1e,%edi
mov    %rbx,%rsi
call   1050 <insert@plt>
mov    $0x28,%edi
mov    %rbx,%rsi
call   1050 <insert@plt>
mov    %rbx,%rdi
call   1030 <display@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca %struct.node*
%2 = call i32 @init(%struct.node** %1)
%3 = call i32 @insert(i32 10, %struct.node** %1)
%4 = call i32 @insert(i32 20, %struct.node** %1)
%5 = call i32 @insert(i32 30, %struct.node** %1)
%6 = call i32 @insert(i32 40, %struct.node** %1)
%7 = call i32 @display(%struct.node** %1)
ret i32 0
}

LLVM IR (-O2):
%struct.node = type { i32 }
define i32 @main() {
%1 = alloca %struct.node*
%2 = bitcast %struct.node** %1 to i8*
%3 = call i32 @init(%struct.node** %1)
%4 = call i32 @insert(i32 10, %struct.node** %1)
%5 = call i32 @insert(i32 20, %struct.node** %1)
%6 = call i32 @insert(i32 30, %struct.node** %1)
%7 = call i32 @insert(i32 40, %struct.node** %1)
%8 = call i32 @display(%struct.node** %1)
ret i32 0
}
/* Variables and functions */
int client2server_socket(char *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void timeout_cb() {
  int fd = client2server_socket("www.google.com", 80);
  fprintf(stderr, "timeout ping\n");
  close(fd);
}


x86 assembly (clang, -O0):
<timeout_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x50,%esi
call   1030 <client2server_socket@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeout_cb>:
push   %rbx
lea    0xec8(%rip),%rdi
mov    $0x50,%esi
call   1030 <client2server_socket@plt>
mov    %eax,%ebx
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
call   1050 <fprintf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"www.google.com\00"
@stderr = global i32 0
@.str.1 = [14 x i8] c"timeout ping\0A\00"
define void @timeout_cb() {
%1 = alloca i32
%2 = call i32 @client2server_socket(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 80)
store i32 %2, i32* %1
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = call i32 @close(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"www.google.com\00"
@stderr = global i32 0
@.str.1 = [14 x i8] c"timeout ping\0A\00"
define void @timeout_cb() {
%1 = tail call i32 @client2server_socket(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 80)
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @close(i32 %1)
ret void
}
int is_digit(char c) { return c <= '9' && c >= '0'; }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jg     1129 <is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
setge  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 %4, 57
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 48
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ DoWork(int *, int, int);
int /*<<< orphan*/ GetWork(int **, int *);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Running...\n");
  int *buf;
  int count, ind;
  GetWork(&buf, &count);
  for (ind = 0;;) {
    DoWork(buf, count, ind);
    ind++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <GetWork@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1050 <DoWork@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    %eax,-0x18(%rbp)
jmp    115f <main+0x2f>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1040 <GetWork@plt>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x8(%rsp),%rdi
mov    0x4(%rsp),%esi
mov    %ebx,%edx
call   1050 <DoWork@plt>
add    $0x1,%ebx
jmp    1160 <main+0x30>

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

LLVM IR (-O2):
@str = [11 x i8] c"Running...\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = bitcast i32** %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = call i32 @GetWork(i32** %1, i32* %2)
br label %7
7: ; preds = %7, %0
%8 = phi i32 [ 0, %0 ], [ %12, %7 ]
%9 = load i32*, i32** %1
%10 = load i32, i32* %2
%11 = call i32 @DoWork(i32* %9, i32 %10, i32 %8)
%12 = add nuw nsw i32 %8, 1
br label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ INR_MDIO_write_b(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
void INR_MDIO_write(uint8_t PHY_addr, uint8_t REG_addr, uint16_t data) {
  INR_MDIO_write_b(1, PHY_addr, REG_addr, data);
}


x86 assembly (clang, -O0):
<INR_MDIO_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x1,%edi
call   1030 <INR_MDIO_write_b@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INR_MDIO_write>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <INR_MDIO_write_b@plt>

LLVM IR (-O0):
define void @INR_MDIO_write(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @INR_MDIO_write_b(i32 1, i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @INR_MDIO_write(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @INR_MDIO_write_b(i32 1, i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
char *copyString(char *);
int /*<<< orphan*/ sprintf(char *, char *, int /*<<< orphan*/);
char *genNewLabel(void) {
  static int nextLabel = 0;
  char labelBuffer[40];
  sprintf(labelBuffer, "label%d", nextLabel++);
  return copyString(labelBuffer);
}


x86 assembly (clang, -O0):
<genNewLabel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
mov    0x2f02(%rip),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,0x2ef7(%rip)
lea    0xebc(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <copyString@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genNewLabel>:
push   %rbx
sub    $0x30,%rsp
mov    0x2f09(%rip),%edx
lea    0x1(%rdx),%eax
mov    %eax,0x2f00(%rip)
lea    0xec5(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <copyString@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@genNewLabel.nextLabel = internal global i32 0
@.str = [8 x i8] c"label%d\00"
define i8* @genNewLabel() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @genNewLabel.nextLabel
%4 = add nsw i32 %3, 1
store i32 %4, i32* @genNewLabel.nextLabel
%5 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%7 = call i8* @copyString(i8* %6)
ret i8* %7
}

LLVM IR (-O2):
@genNewLabel.nextLabel = internal unnamed_addr global i32 0
@.str = [8 x i8] c"label%d\00"
define i8* @genNewLabel() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @genNewLabel.nextLabel
%4 = add nsw i32 %3, 1
store i32 %4, i32* @genNewLabel.nextLabel
%5 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%6 = call i8* @copyString(i8* %2)
ret i8* %6
}
float berechne_durchschnittsverbrauch_us_mi_pro_gal(float strecke,
                                                    float verbrauch) {
  float durchschnittsverbrauch = 0.0;
  durchschnittsverbrauch = strecke / verbrauch;
  return durchschnittsverbrauch;
}


x86 assembly (clang, -O0):
<berechne_durchschnittsverbrauch_us_mi_pro_gal>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<berechne_durchschnittsverbrauch_us_mi_pro_gal>:
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @berechne_durchschnittsverbrauch_us_mi_pro_gal(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
store float 0.000000e+00, float* %5
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fdiv float %6, %7
store float %8, float* %5
%9 = load float, float* %5
ret float %9
}

LLVM IR (-O2):
define float @berechne_durchschnittsverbrauch_us_mi_pro_gal(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ time(int /*<<< orphan*/);
void snapper_func(void *timep) { *(time_t *)timep = time(0); }


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

x86 assembly (clang, -O2):
<snapper_func>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @snapper_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @time(i32 0)
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32 %3, i32* %5
ret void
}

LLVM IR (-O2):
define void @snapper_func(i8* nocapture writeonly %0) {
%2 = tail call i32 @time(i32 0)
%3 = bitcast i8* %0 to i32*
store i32 %2, i32* %3
ret void
}
int foo(int a) {
  if (a < 0)
    return -(1 + 0);
  if (a > 100)
    return 0;
  return a * 2 + 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <foo+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    113f <foo+0x3f>
cmpl   $0x64,-0x8(%rbp)
jle    1133 <foo+0x33>
movl   $0x0,-0x4(%rbp)
jmp    113f <foo+0x3f>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
js     1112 <foo+0x12>
xor    %eax,%eax
cmp    $0x64,%edi
ja     1111 <foo+0x11>
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 100
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = shl nuw nsw i32 %0, 1
%7 = or i32 %6, 1
br label %8
8: ; preds = %3, %1, %5
%9 = phi i32 [ %7, %5 ], [ -1, %1 ], [ 0, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, char const *argv[]) {
  int x, y;
  scanf("%d %d", &x, &y);
  printf("%s%d\n", "sum = ", ((x) + (y)));
  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)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%edx
add    -0x18(%rbp),%edx
lea    0xeaf(%rip),%rdi
lea    0xeae(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [6 x i8] c"%s%d\0A\00"
@.str.2 = [7 x i8] c"sum = \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %9, %8
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ munmap(void *, size_t);
void dispose_section(void *section, size_t len) { munmap(section, len); }


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

x86 assembly (clang, -O2):
<dispose_section>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define void @dispose_section(i8* %0, i64 %1) {
%3 = tail call i32 @munmap(i8* %0, i64 %1)
ret void
}
/* Variables and functions */
int ft_atoi(char *);
int /*<<< orphan*/ ft_putnbr(int);
void plus(char *num1, char *num2) {
  int i_num1;
  int i_num2;
  i_num1 = ft_atoi(num1);
  i_num2 = ft_atoi(num2);
  ft_putnbr(i_num1 + i_num2);
}


x86 assembly (clang, -O0):
<plus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ft_atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
add    -0x18(%rbp),%edi
call   1030 <ft_putnbr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <ft_atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <ft_atoi@plt>
add    %eax,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ft_putnbr@plt>

LLVM IR (-O0):
define void @plus(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @ft_atoi(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @ft_atoi(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = call i32 @ft_putnbr(i32 %13)
ret void
}

LLVM IR (-O2):
define void @plus(i8* %0, i8* %1) {
%3 = tail call i32 @ft_atoi(i8* %0)
%4 = tail call i32 @ft_atoi(i8* %1)
%5 = add nsw i32 %4, %3
%6 = tail call i32 @ft_putnbr(i32 %5)
ret void
}
long hashify(long num, long size) { return (num * num * 37) % size; }


x86 assembly (clang, -O0):
<hashify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
imul   $0x25,%rax,%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashify>:
imul   %rdi,%rdi
lea    (%rdi,%rdi,8),%rax
lea    (%rdi,%rax,4),%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1121 <hashify+0x21>
cqto
idiv   %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @hashify(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* %3
%7 = mul nsw i64 %5, %6
%8 = mul nsw i64 %7, 37
%9 = load i64, i64* %4
%10 = srem i64 %8, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @hashify(i64 %0, i64 %1) {
%3 = mul i64 %0, 37
%4 = mul i64 %3, %0
%5 = srem i64 %4, %1
ret i64 %5
}
unsigned int f75(unsigned int x, int y __attribute__((unused))) {
  return (x << 1) + (x >> ((-1) & (8 * sizeof(unsigned int) - 1)));
}


x86 assembly (clang, -O0):
<f75>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f75(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 = shl i32 %5, 1
%7 = load i32, i32* %3
%8 = lshr i32 %7, 31
%9 = add i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f75(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %3
}
void nop_handler(int signo) {}


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

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

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

LLVM IR (-O2):
define void @nop_handler(i32 %0) {
ret void
}
void cmd_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @cmd_cleanup() {
ret void
}
int test_imm_60int16_mem(short *val) {
  return ((*val) & (0x60 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_60int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 96
%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_60int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 96
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int f(int /*<<< orphan*/);
main() {
  if (f(0) != 0xaf)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <f@plt>
cmp    $0xaf,%eax
je     1158 <main+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <f@plt>
cmp    $0xaf,%eax
jne    1146 <main+0x16>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 0)
%3 = icmp ne i32 %2, 175
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 0)
%2 = icmp eq i32 %1, 175
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
long test(long x, long y, long z) {
  long val = x + y + z;
  if (x < -3) {
    if (y < z)
      val = x * y;
    else
      val = y * z;
  } else if (x > 2)
    val = x * z;
  return val;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0xfffffffffffffffd,-0x8(%rbp)
jge    115d <test+0x5d>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    114b <test+0x4b>
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1158 <test+0x58>
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    117a <test+0x7a>
cmpq   $0x2,-0x8(%rbp)
jle    1175 <test+0x75>
mov    -0x8(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    117a <test+0x7a>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %rsi,%rax
cmp    $0xfffffffffffffffc,%rdi
jg     1113 <test+0x13>
cmp    %rdx,%rax
jge    1126 <test+0x26>
imul   %rdi,%rax
ret
add    %rdi,%rax
add    %rdx,%rax
imul   %rdi,%rdx
cmp    $0x3,%rdi
cmovge %rdx,%rax
ret
imul   %rdx,%rax
ret

LLVM IR (-O0):
define i64 @test(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = add nsw i64 %8, %9
%11 = load i64, i64* %6
%12 = add nsw i64 %10, %11
store i64 %12, i64* %7
%13 = load i64, i64* %4
%14 = icmp slt i64 %13, -3
br i1 %14, label %15, label %28
15: ; preds = %3
%16 = load i64, i64* %5
%17 = load i64, i64* %6
%18 = icmp slt i64 %16, %17
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i64, i64* %4
%21 = load i64, i64* %5
%22 = mul nsw i64 %20, %21
store i64 %22, i64* %7
br label %27
23: ; preds = %15
%24 = load i64, i64* %5
%25 = load i64, i64* %6
%26 = mul nsw i64 %24, %25
store i64 %26, i64* %7
br label %27
27: ; preds = %23, %19
br label %36
28: ; preds = %3
%29 = load i64, i64* %4
%30 = icmp sgt i64 %29, 2
br i1 %30, label %31, label %35
31: ; preds = %28
%32 = load i64, i64* %4
%33 = load i64, i64* %6
%34 = mul nsw i64 %32, %33
store i64 %34, i64* %7
br label %35
35: ; preds = %31, %28
br label %36
36: ; preds = %35, %27
%37 = load i64, i64* %7
ret i64 %37
}

LLVM IR (-O2):
define i64 @test(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, -3
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = icmp slt i64 %1, %2
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = mul nsw i64 %1, %0
br label %17
9: ; preds = %5
%10 = mul nsw i64 %2, %1
br label %17
11: ; preds = %3
%12 = add nsw i64 %1, %0
%13 = add nsw i64 %12, %2
%14 = icmp sgt i64 %0, 2
%15 = mul nsw i64 %2, %0
%16 = select i1 %14, i64 %15, i64 %13
br label %17
17: ; preds = %11, %7, %9
%18 = phi i64 [ %8, %7 ], [ %10, %9 ], [ %16, %11 ]
ret i64 %18
}
/* Type definitions */
struct binNode {
  int dummy;
};

/* Variables and functions */
struct binNode *insert(struct binNode *, int);
struct binNode *buildsubtree() {
  struct binNode *root = NULL;
  root = insert(root, 6);
  root = insert(root, 4);
  root = insert(root, 5);
  root = insert(root, 23);
  return (root);
}


x86 assembly (clang, -O0):
<buildsubtree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
call   1030 <insert@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1030 <insert@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
call   1030 <insert@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x17,%esi
call   1030 <insert@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buildsubtree>:
push   %rax
xor    %edi,%edi
mov    $0x6,%esi
call   1030 <insert@plt>
mov    %rax,%rdi
mov    $0x4,%esi
call   1030 <insert@plt>
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <insert@plt>
mov    %rax,%rdi
mov    $0x17,%esi
pop    %rax
jmp    1030 <insert@plt>

LLVM IR (-O0):
%struct.binNode = type { i32 }
define %struct.binNode* @buildsubtree() {
%1 = alloca %struct.binNode*
store %struct.binNode* null, %struct.binNode** %1
%2 = load %struct.binNode*, %struct.binNode** %1
%3 = call %struct.binNode* @insert(%struct.binNode* %2, i32 6)
store %struct.binNode* %3, %struct.binNode** %1
%4 = load %struct.binNode*, %struct.binNode** %1
%5 = call %struct.binNode* @insert(%struct.binNode* %4, i32 4)
store %struct.binNode* %5, %struct.binNode** %1
%6 = load %struct.binNode*, %struct.binNode** %1
%7 = call %struct.binNode* @insert(%struct.binNode* %6, i32 5)
store %struct.binNode* %7, %struct.binNode** %1
%8 = load %struct.binNode*, %struct.binNode** %1
%9 = call %struct.binNode* @insert(%struct.binNode* %8, i32 23)
store %struct.binNode* %9, %struct.binNode** %1
%10 = load %struct.binNode*, %struct.binNode** %1
ret %struct.binNode* %10
}

LLVM IR (-O2):
%struct.binNode = type { i32 }
define %struct.binNode* @buildsubtree() {
%1 = tail call %struct.binNode* @insert(%struct.binNode* null, i32 6)
%2 = tail call %struct.binNode* @insert(%struct.binNode* %1, i32 4)
%3 = tail call %struct.binNode* @insert(%struct.binNode* %2, i32 5)
%4 = tail call %struct.binNode* @insert(%struct.binNode* %3, i32 23)
ret %struct.binNode* %4
}
void translate_seconds(int total_seconds, int *hours, int *minutes,
                       int *seconds) {
  int secs_reminder;
  *hours = total_seconds / 3600;
  secs_reminder = total_seconds % 3600;
  *minutes = secs_reminder / 60;
  *seconds = secs_reminder % 60;
}


x86 assembly (clang, -O0):
<translate_seconds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0xe10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%rax
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate_seconds>:
movslq %edi,%rax
imul   $0xffffffff91a2b3c5,%rax,%rdi
shr    $0x20,%rdi
add    %eax,%edi
mov    %edi,%r8d
shr    $0x1f,%r8d
sar    $0xb,%edi
add    %r8d,%edi
mov    %edi,(%rsi)
imul   $0xe10,%edi,%esi
sub    %esi,%eax
movswl %ax,%esi
imul   $0xffff8889,%esi,%esi
shr    $0x10,%esi
add    %eax,%esi
movzwl %si,%esi
movswl %si,%edi
shr    $0xf,%esi
sar    $0x5,%edi
add    %esi,%edi
movswl %di,%esi
mov    %esi,(%rdx)
imul   $0x3c,%edi,%edx
sub    %edx,%eax
cwtl
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
define void @translate_seconds(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32, i32* %5
%11 = sdiv i32 %10, 3600
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = srem i32 %13, 3600
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = sdiv i32 %15, 60
%17 = load i32*, i32** %7
store i32 %16, i32* %17
%18 = load i32, i32* %9
%19 = srem i32 %18, 60
%20 = load i32*, i32** %8
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
define void @translate_seconds(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = sdiv i32 %0, 3600
store i32 %5, i32* %1
%6 = srem i32 %0, 3600
%7 = trunc i32 %6 to i16
%8 = sdiv i16 %7, 60
%9 = sext i16 %8 to i32
store i32 %9, i32* %2
%10 = srem i16 %7, 60
%11 = sext i16 %10 to i32
store i32 %11, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
unsigned short func_1(void) {
  unsigned char l_2 = 0xF6L;
  step_hash(1);
  return l_2;
}


x86 assembly (clang, -O0):
<func_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xf6,-0x1(%rbp)
mov    $0x1,%edi
call   1030 <step_hash@plt>
movzbl -0x1(%rbp),%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_1>:
push   %rax
mov    $0x1,%edi
call   1030 <step_hash@plt>
mov    $0xf6,%ax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @func_1() {
%1 = alloca i8
store i8 -10, i8* %1
%2 = call i32 @step_hash(i32 1)
%3 = load i8, i8* %1
%4 = zext i8 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @func_1() {
%1 = tail call i32 @step_hash(i32 1)
ret i16 246
}
/* Variables and functions */
double sin(double);
double a2r_fish(double A, double K) { return K * sin(A / K); }


x86 assembly (clang, -O0):
<a2r_fish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a2r_fish>:
push   %rax
movsd  %xmm1,(%rsp)
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @a2r_fish(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @sin(double %3)
%5 = fmul double %4, %1
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void g(int b, void *q) {
  if (b == 2) {
    g(b, q);
  }
  free(q);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jne    1145 <g+0x25>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <g@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1136 <g+0x16>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1040 <g@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @g(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
br label %10
10: ; preds = %7, %2
%11 = load i8*, i8** %4
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @g(i32 %0, i8* nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %5
4: ; preds = %2
tail call void @g(i32 2, i8* %1)
br label %5
5: ; preds = %4, %2
%6 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ai_check(unsigned short, scalar_t__);
int client_set_stone(unsigned short);
scalar_t__ get_stone(unsigned short);
int ai_set_stone(unsigned short int x) {
  if (!ai_check(x, get_stone(x) - 1))
    return client_set_stone(x);
  else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<ai_set_stone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
mov    -0x6(%rbp),%ax
mov    %ax,-0x8(%rbp)
movzwl -0x6(%rbp),%edi
call   1040 <get_stone@plt>
mov    %rax,%rsi
mov    -0x8(%rbp),%ax
sub    $0x1,%rsi
movzwl %ax,%edi
call   1030 <ai_check@plt>
cmp    $0x0,%eax
jne    117d <ai_set_stone+0x4d>
movzwl -0x6(%rbp),%edi
call   1050 <client_set_stone@plt>
mov    %eax,-0x4(%rbp)
jmp    1184 <ai_set_stone+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai_set_stone>:
push   %rbx
mov    %edi,%ebx
call   1040 <get_stone@plt>
lea    -0x1(%rax),%rsi
mov    %ebx,%edi
call   1030 <ai_check@plt>
test   %eax,%eax
je     114b <ai_set_stone+0x1b>
xor    %eax,%eax
pop    %rbx
ret
movzwl %bx,%edi
pop    %rbx
jmp    1050 <client_set_stone@plt>

LLVM IR (-O0):
define i32 @ai_set_stone(i16 zeroext %0) {
%2 = alloca i32
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = load i16, i16* %3
%6 = call i64 @get_stone(i16 zeroext %5)
%7 = sub nsw i64 %6, 1
%8 = call i32 @ai_check(i16 zeroext %4, i64 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %1
%11 = load i16, i16* %3
%12 = call i32 @client_set_stone(i16 zeroext %11)
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @ai_set_stone(i16 zeroext %0) {
%2 = tail call i64 @get_stone(i16 zeroext %0)
%3 = add nsw i64 %2, -1
%4 = tail call i32 @ai_check(i16 zeroext %0, i64 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @client_set_stone(i16 zeroext %0)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ %7, %6 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ UNUSED(void *);
void Zip_Interrupt_Install(unsigned long irq,
                           void (*handler)(unsigned int, void *), void *arg) {
  UNUSED(irq);
  UNUSED(handler);
  UNUSED(arg);
  return;
}


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

x86 assembly (clang, -O2):
<Zip_Interrupt_Install>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <UNUSED@plt>
mov    %rbx,%rdi
call   1030 <UNUSED@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <UNUSED@plt>

LLVM IR (-O0):
define void @Zip_Interrupt_Install(i64 %0, void (i32, i8*)* %1, i8* %2) {
%4 = alloca i64
%5 = alloca void (i32, i8*)*
%6 = alloca i8*
store i64 %0, i64* %4
store void (i32, i8*)* %1, void (i32, i8*)** %5
store i8* %2, i8** %6
%7 = load i64, i64* %4
%8 = inttoptr i64 %7 to i8*
%9 = call i32 @UNUSED(i8* %8)
%10 = load void (i32, i8*)*, void (i32, i8*)** %5
%11 = bitcast void (i32, i8*)* %10 to i8*
%12 = call i32 @UNUSED(i8* %11)
%13 = load i8*, i8** %6
%14 = call i32 @UNUSED(i8* %13)
ret void
}

LLVM IR (-O2):
define void @Zip_Interrupt_Install(i64 %0, void (i32, i8*)* %1, i8* %2) {
%4 = inttoptr i64 %0 to i8*
%5 = tail call i32 @UNUSED(i8* %4)
%6 = bitcast void (i32, i8*)* %1 to i8*
%7 = tail call i32 @UNUSED(i8* %6)
%8 = tail call i32 @UNUSED(i8* %2)
ret void
}
/* Variables and functions */
unsigned short _xcrc16(unsigned char *, long);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
unsigned short mon_xcrc16(char *buf, long nbytes) {
  unsigned short ret;
  monLock();
  ret = _xcrc16((unsigned char *)buf, nbytes);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_xcrc16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <_xcrc16@plt>
mov    %ax,-0x12(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
movzwl -0x12(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_xcrc16>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <_xcrc16@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define zeroext i16 @mon_xcrc16(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i16
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i32 (...) @monLock()
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call zeroext i16 @_xcrc16(i8* %7, i64 %8)
store i16 %9, i16* %5
%10 = call i32 (...) @monUnlock()
%11 = load i16, i16* %5
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @mon_xcrc16(i8* %0, i64 %1) {
%3 = tail call i32 (...) @monLock()
%4 = tail call zeroext i16 @_xcrc16(i8* %0, i64 %1)
%5 = tail call i32 (...) @monUnlock()
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ io_error_msg(char *, int, int);
void graph_set_style(int data_set, char *style) {
  if ((data_set < 0) || (data_set >= 10))
    io_error_msg(
        "set-graph-style -- data-set out of range: %d (should be in [0..%d])",
        data_set, 10);
}


x86 assembly (clang, -O0):
<graph_set_style>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1133 <graph_set_style+0x23>
cmpl   $0xa,-0x4(%rbp)
jl     1147 <graph_set_style+0x37>
mov    -0x4(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0xa,%edx
call   1030 <io_error_msg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<graph_set_style>:
cmp    $0xa,%edi
jb     1128 <graph_set_style+0x18>
mov    %edi,%esi
lea    0xee2(%rip),%rdi
mov    $0xa,%edx
jmp    1030 <io_error_msg@plt>
ret

LLVM IR (-O0):
@.str = [68 x i8] c"set-graph-style -- data-set out of range: %d (should be in [0..%d])\00"
define void @graph_set_style(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 10
br i1 %9, label %10, label %13
10: ; preds = %7, %2
%11 = load i32, i32* %3
%12 = call i32 @io_error_msg(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i32 %11, i32 10)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [68 x i8] c"set-graph-style -- data-set out of range: %d (should be in [0..%d])\00"
define void @graph_set_style(i32 %0, i8* nocapture readnone %1) {
%3 = icmp ugt i32 %0, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @io_error_msg(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i32 %0, i32 10)
br label %6
6: ; preds = %2, %4
ret void
}
/* Variables and functions */
scalar_t__ eval();
int /*<<< orphan*/ pbstr(char *);
int /*<<< orphan*/ pushback(char);
int /*<<< orphan*/ sprintf(char *, char *, long);
void pragvalue() {
  char buf[5100 + 1];
  sprintf(buf, "%ld", (long)eval());
  pbstr(buf);
  pushback('\n');
}


x86 assembly (clang, -O0):
<pragvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1400,%rsp
lea    -0x13f0(%rbp),%rax
mov    %rax,-0x13f8(%rbp)
mov    $0x0,%al
call   1050 <eval@plt>
mov    -0x13f8(%rbp),%rdi
mov    %rax,%rdx
lea    0xe8f(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x13f0(%rbp),%rdi
call   1040 <pbstr@plt>
mov    $0xa,%edi
call   1030 <pushback@plt>
add    $0x1400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pragvalue>:
push   %rbx
sub    $0x13f0,%rsp
xor    %eax,%eax
call   1050 <eval@plt>
lea    0xeaa(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rax,%rdx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <pbstr@plt>
mov    $0xa,%edi
call   1030 <pushback@plt>
add    $0x13f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define void @pragvalue() {
%1 = alloca [5101 x i8]
%2 = getelementptr inbounds [5101 x i8], [5101 x i8]* %1, i64 0, i64 0
%3 = call i64 (...) @eval()
%4 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = getelementptr inbounds [5101 x i8], [5101 x i8]* %1, i64 0, i64 0
%6 = call i32 @pbstr(i8* %5)
%7 = call i32 @pushback(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @pragvalue() {
%1 = alloca [5101 x i8]
%2 = getelementptr inbounds [5101 x i8], [5101 x i8]* %1, i64 0, i64 0
%3 = tail call i64 (...) @eval()
%4 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = call i32 @pbstr(i8* %2)
%6 = call i32 @pushback(i8 signext 10)
ret void
}
int sdebug(char *str, const char *format, ...) { return 0; }


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

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

LLVM IR (-O0):
define i32 @sdebug(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @sdebug(i8* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 0
}
__attribute__((__no__)) void
do_nothing_trailing_hole_dynamic_all(struct test_trailing_hole *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_trailing_hole_dynamic_all>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_trailing_hole_dynamic_all+0x1b>
jmp    1120 <do_nothing_trailing_hole_dynamic_all+0x20>
jmp    1120 <do_nothing_trailing_hole_dynamic_all+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_trailing_hole = type opaque
define void @do_nothing_trailing_hole_dynamic_all(%struct.test_trailing_hole* %0) {
%2 = alloca %struct.test_trailing_hole*
store %struct.test_trailing_hole* %0, %struct.test_trailing_hole** %2
%3 = load %struct.test_trailing_hole*, %struct.test_trailing_hole** %2
%4 = ptrtoint %struct.test_trailing_hole* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_trailing_hole = type opaque
define void @do_nothing_trailing_hole_dynamic_all(%struct.test_trailing_hole* nocapture %0) {
ret void
}